|
Answer» I have got an image sequence that I NEED convert to another format. It's very important that I keep the original name prefix and the first sequental NUMBER.
The script is SUPPOSE to work like this : I drag 'n drop a folder containing a sequence. It reads the content and generates a playlist file. Then a render program uses this playlist file to identify the order of the sequence and the format.
Then it converts it to another format with the same name prefix and start frame.
example of playlist:
201_02_C1_01_01_0000333.tif 201_02_C1_01_01_0000334.tif 201_02_C1_01_01_0000335.tif 201_02_C1_01_01_0000336.tif 201_02_C1_01_01_0000337.tif 201_02_C1_01_01_0000338.tif 201_02_C1_01_01_0000339.tif 201_02_C1_01_01_0000340.tif 201_02_C1_01_01_0000341.tif 201_02_C1_01_01_0000342.tif
Code: [Select]@echo off
--create sequence playlist (this I was able to do :))
dir %1\*.tif /b /o > %1\playlist.txt
--autmatically get sequence name prefix code ??? - help
201_02_C1_01_01 = %prefix%
--autmatically get sequence first sequential number code (which is 0000333) ??? - help
0000333 = %number%
c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%prefix%_%number%.dpx
exit
The custom convert render works like this :
[.exe] [playlist] [new fileformat]
I hope you can understand this, can you help me out to fill in the HUGE gaps ? 8-)
PeZiKI'm not sure I understand. Does not %prefix%_%number% resolve back to the original file name without the extension? In any case you can use the FOR statement to rip apart the file name and rearrange it as you like.
Code: [Select]for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do ( c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i.dpx )
You can rip the file name apart further by adding _ as a delimiter:
Code: [Select]for /f "tokens=1-7 delims=_." %%i in (dir %1\*.tif /b /o) do ( c:\render\custom_convert_render.exe %1\playlist.txt c:\test\%%i_%%j_%%k_%%l_%%m_%%n.dpx )
prefix = %%i_%%j_%%k_%%l_%%m number = %%n
Hope this helps. 8-)Thank you very much for your help. You are spot on what I'm actually asking for
I tried it and it didn't work. I'm really bad at this but here's what I did with your code :
Code: [Select]@echo off
for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o > %1\playlist.ifl) do ( C:\DPX_UTILS\FC\bin\SpeedGradeRender.exe %1\playlist.ifl c:\TEMP\%%i.dpx )
pause
del 1%\playlist.ifl
PeZiKYou don't need the DIR command to output to a file:
Code: [Select]@echo off for /f "tokens=1-2 delims=." %%i in (dir %1\*.tif /b /o) do ( c:\render\custom_convert_render.exe %1\%%i.%%j c:\test\%%i.dpx ) pause
Hope this works.
|