File indexing completed on 2025-03-09 04:10:17
0001 <h1 id="batch-exporter-krita-plugin-for-game-developers-and-graphic-designers">Batch Exporter: Krita Plugin for Game Developers and Graphic Designers</h1> 0002 <p>Free Krita plugin for designers, game artists and digital artists to work more productively:</p> 0003 <ul> 0004 <li>Batch export assets to multiple sizes, file types, and custom paths. Supports <code>jpg</code> and <code>png</code>.</li> 0005 <li>Rename layers quickly with the smart rename tool</li> 0006 </ul> 0007 <h2 id="batch-export-layers">Batch Export Layers</h2> 0008 <p>Batch Exporter exports individual layers to image files based on metadata in the layer name. The supported options are:</p> 0009 <ul> 0010 <li><code>[e=jpg,png]</code> - supported export image extensions</li> 0011 <li><code>[s=20,50,100,150]</code> - size in <code>%</code></li> 0012 <li><code>[p=path/to/custom/export/directory]</code> - custom output path. Paths can be absolute or relative to the Krita document.</li> 0013 <li><code>[m=20,30,100]</code> - extra margin in <code>px</code>. The layer is trimmed to the smallest bounding box by default. This option adds extra padding around the layer.</li> 0014 <li><code>[t=false]</code> or <code>[t=no]</code> - disable trimming the exported layer to the bounding box of the content.</li> 0015 <li><code>[i=false]</code> or <code>[i=no]</code> - disable parent metadata inheritance for a layer. More info <a href="#layer-inheritance">below</a>.</li> 0016 </ul> 0017 <p>A typical layer name with metadata looks like: <code>CharacterTorso e=png m=30 s=50,100</code>. This exports the layer as two images, with an added padding of 30 pixels on each side: <code>CharacterTorso_s100_m030.png</code>, and <code>CharacterTorso_s050_m030.png</code>, a copy of the layer scaled down to half the original size.</p> 0018 <p>All the metadata tags are optional. Each tag can contain one or multiple options separated by comma <code>,</code>. Write <code>e=jpg</code> to export the layer to <code>jpg</code> only and <code>e=jpg,png</code> to export the layer twice, as a <code>jpg</code> and as a <code>png</code> file. Note that the other tag, <code>p=</code> has been left out. Below we describe how the plugin works.</p> 0019 <h2 id="getting-started">Getting Started</h2> 0020 <p>Batch Exporter gives two options to batch export layers: <code>Export All Layers</code> or <code>Export Selected Layers</code>.</p> 0021 <p><code>Export All Layers</code> only takes layers with the <code>e=extension[s]</code> tag into account. For example, if the layer name is <code>LeftArm e=png s=50,100</code>, <code>Export All Layers</code> will take it into account. If the layer name is <code>LeftArm s=50,100</code>, it will not be exported with this option.</p> 0022 <p><code>Export Selected Layers</code> exports all selected layers regardless of the tags.</p> 0023 <p>By default, the plugin exports the images in an <code>export</code> folder next to your Krita document. The export follows the structure of your layer stack. The group layers become directories and other layers export as files.</p> 0024 <blockquote> 0025 <p><strong>Supported layer types:</strong> paint, vector, group & file layers.</p> 0026 </blockquote> 0027 <h2 id="smart-layer-rename-tool">Smart Layer Rename tool</h2> 0028 <p>Say we have this Krita document structure:</p> 0029 <pre><code>GodetteGroupLayer 0030 +-- HeadGroupLayer 0031 +-- Hair 0032 +-- Eyes 0033 +-- Rest 0034 +-- Torso 0035 +-- LeftArm 0036 +-- RightArm 0037 Background</code></pre> 0038 <p>If you want to export <code>GodetteGroupLayer</code>, <code>HeadGroupLayer</code>, <code>Torso</code>, <code>LeftArm</code>, and <code>RightArm</code>, but not the other layers, you can select these layers and write the following in the <code>Update Layer Name</code> text box: <code>e=png s=40,100</code> and press <kbd>Enter</kbd>. In this example, Art Tools will export two copies of the selected layers to png at <code>40%</code> and <code>100%</code> scale. This is what <code>s=40,100</code> does.</p> 0039 <p>Say that we made a mistake: we want to export to <code>50%</code> instead of <code>40%</code>. Select the layers once more and write <code>s=50,100</code> in the text box. Press <kbd>Enter</kbd>. This will update the size tag and leave <code>e=png</code> untouched.</p> 0040 <p>The tool can do more than add and update meta tags. If you want to remove <code>GroupLayer</code> from the name on <code>GodetteGroupLayer</code> and <code>HeadGroupLayer</code>, select them and write <code>GroupLayer=</code> in the text box. Press <kbd>Enter</kbd> and the <code>GroupLayer</code> text will disappear from the selected layers.</p> 0041 <p>The <code>=</code> tells the tool to search and replace. <code>this=[that]</code> will replace <code>this</code> with <code>[that]</code>. If you don’t write anything after the equal sign, the tool will erase the text you searched for.</p> 0042 <p>The rename tool is smarter with meta tags. Writing <code>e=</code> will remove the extension tag entirely. For example, <code>Godette e=png s=50,100</code> will become <code>Godette s=50,100</code>.</p> 0043 <h2 id="coa-tools-format">COA Tools format</h2> 0044 <p>The exporter will generate the necessary sprite contents and metadata file for easy import in COA Tools / Blender.</p> 0045 <p>If you want to export your krita document to COA Tools format, simply click the <code>Document</code> button under COA Tools.</p> 0046 <p>If you want to export multiple or specific COA Tool documents from one Krita document (if you have e.g. multiple characters in one Krita document), you can do so by selecting a Group Layer to serve as root for each COA Tool export you want done.</p> 0047 <h3 id="example">Example</h3> 0048 <p>You want to export two characters from the same Krita document in one go</p> 0049 <pre><code>Root 0050 +-- Robot (Group Layer) <-- Select this layer 0051 | +-- Head 0052 | +-- Body 0053 | +-- Legs 0054 | 0055 +-- Sketches 0056 | +-- ... 0057 | 0058 +-- Minion (Group Layer) <-- ... and this layer 0059 | +-- Hat 0060 | +-- Head 0061 | 0062 Background</code></pre> 0063 <p>Once the Group Layers are selected you push “COA Tools -> Selected Layers”.</p> 0064 <p>Each export root supports the following metadata:</p> 0065 <ul> 0066 <li><code>[p=path/to/custom/export/directory]</code> - custom output path. Paths can be absolute or relative to the Krita document.</li> 0067 </ul> 0068 <p>Each child node of an export root supports the following metadata:</p> 0069 <ul> 0070 <li><code>[e=jpg,png]</code> - supported export image extensions</li> 0071 </ul> 0072 <p>Generating frames to a sprite sheet from a Group Layer is also possible. Simply mark the layer containing each frame you want in the sheet with a <code>c=sheet</code> and each child layer will act as one frame you can switch when Working with COA Tools in Blender.</p> 0073 <h3 id="example-1">Example</h3> 0074 <p>You want to export a character from the document, and be able to switch between each state of e.g. the mouth:</p> 0075 <pre><code>Root 0076 +-- Robot (Group Layer) <-- If this is the export root 0077 | +-- Mouth States c=sheet <-- ... mark this layer 0078 | | +-- Open 0079 | | +-- Half Open 0080 | | +-- Closed 0081 | | 0082 | +-- Head 0083 | +-- Body 0084 | +-- Legs 0085 | 0086 Background</code></pre> 0087 <h2 id="layer-inheritance">Layer Inheritance</h2> 0088 <p>Batch Exporter now allows child layers to inherit metadata from parent layers without the <code>e=</code> tag. This makes it easier to manage documents with lots of layers and results in cleaner looking layer names.</p> 0089 <p>Any layers tagged with <code>i=no</code> or <code>i=false</code> will not inherit metadata from their parent layers. Tagged group layers will still share <strong>their own</strong> metadata with their children.</p> 0090 <h3 id="example-2">Example</h3> 0091 <p>Consider the following document structure:</p> 0092 <pre><code>Background e=png m=5 s=50,100 p=assets/images 0093 0094 InterfaceGroupLayer 0095 +-- ui_skin e=png m=5 s=50,100 p=assets/images/interface 0096 +-- ui_skin_dark e=png m=5 s=50,100 p=assets/images/interface 0097 0098 MapsGroupLayer 0099 +-- map01 e=png p=assets/images/interface/maps 0100 +-- map02 e=png p=assets/images/interface/maps 0101 0102 MobsGroupLayer 0103 +-- mob01 e=png,jpg m=10 s=75 p=assets/images/mobs 0104 +-- mob02 e=png,jpg m=10 s=25 p=assets/images/mobs</code></pre> 0105 <p>Using metadata inheritance, you could achieve the above like so:</p> 0106 <pre><code>InterfaceGroupLayer m=5 s=50,100 p=assets/images/interface 0107 +-- ui_skin e=png 0108 +-- ui_skin_dark e=png 0109 +-- Background e=png p=assets/images 0110 0111 MapsGroupLayer p=assets/images/interface/maps 0112 +-- map01 e=png 0113 +-- map02 e=png 0114 0115 MobsGroupLayer p=assets/images/mobs m=10 0116 +-- mob01 e=png,jpg s=75 0117 +-- mob02 e=png,jpg s=25</code></pre>