[Closed] Frame Numbering
Hi everybody,
it´s me again with a new(bie ;)) question. I´d like to create a script that renders a sequence of images out of a scene and is supposed to save them to two different locations. So far so good, that works quite well as shown with this sample code snippet:
tOutput1=@"C: est1\"+"test1"+"_"+".png"
tOutput2=@"C: est2\"+"test2"+"_"+".png"
render camera:$Camera01 fromframe: 1 toframe: 5 outputwidth: 200 outputheight: 200 outputfile:toutput1 quiet: true
render camera:$Camera01 fromframe: 6 toframe: 10 outputwidth: 200 outputheight: 200 outputfile: tOutput2 quiet: true
Buuuuuut...here´s the hanger. I´d like to renumber the frames so that it´s not [i]"test2_0006"[/i] to [i]"test2_0010" [/i]but [i]"test2_0001"[/i] to [i]"test2_0005".
[/i]
I know I could fix the script by rendering each frame seperately and just hammering out the complete file name line by line. I had a look around and stumbled on the <bitmap>.frame command. Is this the right direction to go? Something like for i = 1 to 5 do bitmap.frame blablabla... so that each frame once it has finished rendering gets the complete file name.
But there must be a more elegant way to do this. Any clues or ideas?
Cheers
Chris
There only way I can think of doing this is to write a script that loops through every frame and renders it, and changes the renderpath each time…
in puesdo code.
loop i = 10 to framenum
(
r = 1
renderpath = “c: est\Render_” + r + “.tga”
render outputpath: renderpath
)
or something like that.
Or you could use a PostRender script to save the file again, get it to just knock 5 off the framecount and rename the output path, but not done that so not sure…
Hey matte, try this, I didn’t evaluate it but I think it’s ok
(
fstart1=0
fend1=5
fstart2=6
fend2=10
fnumber=0
for fcurrent=fstart1 to fend1 do
(
foutput=@"C: est1 est1_" + fnumber+ ".png"
render camera:$Camera01 frame:fcurrent outputwidth: 200 outputheight: 200 outputfile:foutput quiet: true
fnumber+=1
)
fnumber=0
for fcurrent=fstart2 to fend2 do
(
foutput=@"C: est2 est2_" + fnumber + ".png"
render camera:$Camera01 frame:fcurrent outputwidth: 200 outputheight: 200 outputfile:foutput quiet: true
fnumber+=1
)
)
Hey Artur,
cheers for the cool script.
Will definetly give it a try tomorrow, got a crunch night just coming up, so I haven´t been able to test it. Apart from that, I think I´m starting to gain a grasp on Maxscript because I read the script and understood what it was going to do
Anyway, will give you feedback tomorrow
Thanks anyway and have a nice evening
Chris
Wouldn’t this be a LOT more efficient as a post-render script?
Renderout. Rename files. Copy/Paste. Rename pasted files.
Hello everybody,
sorry for the late feedback, Captain Crunch time kept me a bit occupied during the last days.
Anyway, Kameleon, you are the man again :). Really smooth construction you scripted there. Made great fun to implement into the final script. Short, sweet and simple, just the right thing for a newcomer like me.
@thatoneguy: I don´t know whether it makes more sense to implement a Post-render script. You may be right…However as this part of renumbering the frames is more or less part of a much bigger production script that will do things such as create render paths depending on the file name, merge files together, load animations etc, I´m not sure whether this may work?
Do you have any infos on Post-Render script (Apart fromthe Max Script reference ;)), I´m really interested in looking into this for future scripts.
Anyway, thanks to everybody for helping me out of this problem here
Cheers
Chris