I'm wanting to make a batch file that can do two conversions on an input file, one after the other.
I need to convert image files to a special image format called 'tiled & mipmapped EXR'. The problem is I dont have a program
that can do both the EXR conversion and the tiling/mipmapping EXR optimization in one go.
But I do have a seperate program for each, one that can convert to EXR, and then a second that can optimize EXR files so they are tiled & mipmapped.
I'm wanting to create a bat file that can run both these seperate programs in sequence on a single input file.
So it would essentially do something like this in the end:
1) Run 'image to EXR' conversion on the input file
add '_tmp' to the name of the conversion output (so it would end up being $inputFileName_tmp.exr)
2) run the mipmap conversion on all files that end in '_tmp.exr'
make the mipmap conversion output its file as just $inputFileName.exr
delete all _tmp.exr files in the folder.
I just cant for the life of me figure out how to link these two seperate operations together in a single bat file.
I wouldn't mind having to delete the '_tmp.exr' files manually afterward but it would be great if I could get the bat to delete all '_tmp.exr' files automatically
as a bonus extra step.
All I have at the moment is just two seperate bat files for each operation.
This is the bat file for the initial .exr conversion
Code: Select all
for %%i in (%*) do \\TXSERVER\Textures\img2tiledexr %%i %%i_tmp.exr -32bit -compression zip -tileSize 32x32 -linear auto
And this is the bat file I have for the optimization which creates the final mipmap/tiled EXR output I require.
Code: Select all
@for %%i in (%*) do \\TXSERVER\Textures\exrmaketiled -m -u -v %%i %%i
So I basically need to join those two operations together to give me a single output EXR file.
Is this possible ?
Sorry for my noob-ness , I would really really appreciate some help on this.
Thanks,
Christopher.