krita-batch-exporter icon indicating copy to clipboard operation
krita-batch-exporter copied to clipboard

Add a switch to avoid file renaming.

Open Ziflin opened this issue 2 years ago • 2 comments

I'm trying to used the "s" scale parameter to export at a reduced resolution, but it appears that the batch exporter generates a new filename with "[email protected]" appended to the layer name. Is there any way that a switch could be added for it not to do this and simply used the name of the layer as the filename? The modified name breaks some import scripts that I'm using in Unity.

Ziflin avatar Mar 02 '22 23:03 Ziflin

The way my complementary plugin handles it is it makes copies of the batch exporter's images where the suffix is removed and puts them in a folder with the scale as the name (e.g. 0.5x), so that it still stays organized/functional if you use multiple scale sizes. That's how I'd want it to be done.

SeanHRN avatar Mar 03 '22 00:03 SeanHRN

If somebody is running into the same problem, one option would be to first rename the file inside Unity, so it already has the name, the exporter would create with the new scaling option. That will make sure all your references are still kept. After that, changing the s parameter to the layer and running export.

Not sure how that works with other engines, but might also work too.

To fix this we could also change the options for s a little, I would propose the following syntax:

s=<scaling>[:suffix], ..., <scaling>[:suffix]

So for example, one could have:

  • aLayer s=0.5: e=png rescales the layer by 0.5, but keeps the original name aLayer.pngsince the a space follows immediately after the :.
  • aLayer s=0.5:_half e=png rescales by 0.5 and exports to aLayer_half.png
  • aLayer s=0.5 e=png keeps the original behavior and exports to [email protected]
  • aLayer s=0.5:-half,0.25:-quarter e=png would export both aLayer_half.png and aLayer_quarter.png

If that seems reasonable, I could also look into making that work. Not sure how much time I will have though

OliverGrack avatar Feb 09 '23 21:02 OliverGrack