Saving out ticks instead of frames?
Hi, i am trying to save out particles with krakatoa for my Bachelor Project.
Many times I have a particle simulation, that I need to timebend the animation, but i cannot animate it like this. Krakatoa has a built in time editor for the particles, so its easy to bend time, but it starts to stutter when it has to interpolate particles.
For a 2000 framerange animation, i would like to save out 8000 "frames".
Bobo has given me the following help
"MAXScript can render at sub-frames, so it would be possible to call the renderer at smaller steps, but the saving code does not handle sub-frames. So the script would have to:
*Loop from 1 to 2000 with a step of 0.25
*Call the renderer for the current frame to save a PRT
*Move that PRT file to a new directory and rename it based on a counter incremented once per sub-step so when you reach 2000, it would be at 8000
*Repeat
"
I am not sure where to begin. This script could be useful not just for saving particles, for rendering out other animations, which later need to be edited for slowmotion.
I guess the script hast two parts, incrementing ticks by 0.25 and saving that frame. And a renaming counter.
Any help is appreciated!
Comments
but thanks for you script as
but thanks for you script as well..
bobos script i can only use to save out particles--
can i use your script to save out subframes now?
// www.v-motion.co //
RE: "can i use your script to
RE: "can i use your script to save out subframes now?"
- Yes, you can ;-)
my recent MAXScripts RSS (archive here)
hi anubis, bobo had time to
hi anubis, bobo had time to do it, this is what he came up with
(
local start = 0.0 --this is the first frame
local end = 100.0 --this is the last frame
local step = 4 --this is the number of samples per frame
local cnt = start as integer --this is the counter for the current frame number
local theParticleFileName = (FranticParticles.GetProperty "ParticleFiles") --get the output PRT file name
FranticParticles.SetProperty "Presets:SaveRenderHistory" "false" --disable history saving
for t = start to end by (1.0/step) do --loop from start frame to end frame with the given step
(
local theFileName = FranticParticles.ReplaceSequenceNumber theParticleFileName ((floor t) as integer) --figure out what the saved file will be called
deleteFile theFileName --make sure it does not exist yet
render frame:t vfb:off --call the renderer at a sub-frame to save a PRT with full frame
if doesFileExist theFileName do --if it was found,
(
local theBaseFile = (getFileNameFile theFileName) --grab the base file name, then build the new file name with suffix SubFrame_
local targetFilename = getFileNamePath theFileName + substring theBaseFile 1 (theBaseFile.count-4) + "SubFrame_" + getFileNameType theFileName
targetFilename = FranticParticles.ReplaceSequenceNumber targetFilename cnt --set the target frame number based on the integer counter stored in cnt
deleteFile targetFilename --make sure it does not exist before saving over it
renameFile theFileName targetFilename --rename the saved file to the new file name
)
cnt+=1 --increment the integer frame counter by one
)--end t loop
)--end script
// www.v-motion.co //
Well, I found solution
Well, I found solution ;-)
And because I not catch the Bobo's idea, I was try this and it works:
Enjoy!
my recent MAXScripts RSS (archive here)
"MAXScript can render at
"MAXScript can render at sub-frames, so it would be possible to call the renderer at smaller steps" - this is sound strange to me. You can tell by MAXScript to render 5.75 (for example) but the Max itself will render the frame 5.0, i.e. all numbers after the comma are ignored, so never mind is it 5.25 or 5.99, for Max and both are 5f, that's all. In conclusion -- no way.
[edit] If you set your time display to FRAME:TICKS or MM:SS:TICKS, then Max will accept float frame values. but still this last step that Bobo suggest (moving/renaming) it's not clear to me.
my recent MAXScripts RSS (archive here)