Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ofn-tiles & ofn-export-layers
#15
1) Thanks for the script. 


2) For my own uses I made a modification that may help someone else. 

(adding detailed description to aid in search indexing, this is a sorta niche case)

Details:

I'm wanting to slice a bunch of images into tiles for a Minecraft repeating texture (connected texture, method=repeat). The format for this is numbering each tile starting at 0 and incrementing (height and width of the completed tile are defined in the .properties file) with nothing else in the filename. 

Ie, if slicing an image into 4 tiles (2 x ), the files would be: 0.png, 1.png, 2.png, 3.png

To do that I added a formatValue for "current". 

In the version of 'ofn-tiles' dated 2020-08-16, go to line 88, which (in case future updates change the line this occurs on) will look like:
 

Code:
            formatValues['tileRC1']=tileRC+1,


Add a new line below it that says:


Code:
            formatValues['current']=((row*columns)+(column+1))-1

Then when exporting tiles, change the filename to be only:

{current}.png

This addition won't change any other functionality of the script. 

(first time messing with Python, so if I've goofed post a correction Smile

...

Note: if you're here for this and you're ONLY going to be using the plugin for this purposed, you can also change:


Code:
        (PF_STRING,     'namePattern',  'Tile name',   '{imageName}-{column1:02d}-{row1:02d}.png'),


to:

Code:
#        (PF_STRING,     'namePattern',  'Tile name',   '{imageName}-{column1:02d}-{row1:02d}.png'),
        (PF_STRING,     'namePattern',  'Tile name',   '{current}.png'),

and it will default to this as the export filename (for the rows and columns method, changing the width and height default is equally as easy).
Reply


Messages In This Thread
ofn-tiles & ofn-export-layers - by Ofnuts - 08-09-2017, 09:15 PM
RE: ofn-tiles - by rich2005 - 08-10-2017, 08:25 AM
RE: ofn-tiles - by Ofnuts - 08-10-2017, 12:30 PM
RE: ofn-tiles - by Ofnuts - 08-10-2017, 01:27 PM
RE: ofn-tiles - by rich2005 - 08-10-2017, 05:02 PM
RE: ofn-tiles - by Ofnuts - 08-10-2017, 05:03 PM
RE: ofn-tiles - by RayArdia - 08-11-2017, 03:10 PM
RE: ofn-tiles - by Ofnuts - 08-11-2017, 04:55 PM
RE: ofn-tiles - by rich2005 - 08-11-2017, 06:33 PM
RE: ofn-tiles - by Ofnuts - 08-21-2017, 07:12 PM
RE: ofn-tiles - by jahf - 12-15-2021, 04:34 AM
RE: ofn-tiles - by Ofnuts - 12-15-2021, 07:43 AM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 12-12-2017, 11:28 PM
RE: ofn-tiles & ofn-export-layers - by meetdilip - 12-07-2021, 08:37 AM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 12-07-2021, 11:31 AM
RE: ofn-tiles & ofn-export-layers - by meetdilip - 12-07-2021, 01:06 PM
RE: ofn-tiles & ofn-export-layers - by Krikor - 12-15-2021, 01:27 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 12-16-2021, 09:56 AM
RE: ofn-tiles & ofn-export-layers - by Krikor - 12-16-2021, 06:00 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 01-17-2022, 06:27 PM
RE: ofn-tiles & ofn-export-layers - by tilesUser - 01-19-2022, 07:31 PM
RE: ofn-tiles & ofn-export-layers - by layolayo - 03-17-2022, 02:15 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 03-17-2022, 08:42 PM
RE: ofn-tiles & ofn-export-layers - by layolayo - 03-18-2022, 12:50 PM
RE: ofn-tiles & ofn-export-layers - by rich2005 - 03-18-2022, 04:30 PM
RE: ofn-tiles & ofn-export-layers - by layolayo - 03-18-2022, 05:03 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 01-08-2023, 12:26 PM
RE: ofn-tiles & ofn-export-layers - by Murxel - 02-21-2023, 01:13 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 02-21-2023, 04:44 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 10-18-2023, 07:57 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 10-19-2023, 07:23 AM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 10-20-2023, 07:18 AM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 10-24-2023, 03:27 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 12-19-2023, 08:36 AM
RE: ofn-tiles & ofn-export-layers - by Katuend - 11-02-2024, 11:31 PM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 11-03-2024, 12:58 AM
RE: ofn-tiles & ofn-export-layers - by Katuend - 11-03-2024, 10:10 AM
RE: ofn-tiles & ofn-export-layers - by Ofnuts - 11-08-2024, 05:33 PM

Forum Jump: