Notifications
Clear all

[Closed] Script that repeat itself every frame of a render

sorry there was an error on my part: the #preRenderFrame callback takes effect after the render evaluates objects/your glu3d geometry, you have to use #preRenderEval instead

hope you get it to work this way

no it crash on second frame

the best is to go with preframe but I’m a frame late

ok well ain’t perfect but I solved the out of memory after like 20 frames of render

undo off
(
callbacks.removescripts id:#fRGlu
txt = “liq = $glu3D_01

txt += “snapshot liq
” –snapshot my Glu mesh
callbacks.addScript #preRenderframe txt id:#fRGlu
txt = “delete $glu3d_02

callbacks.addScript #postRenderFrame txt id:#fRGlu
)

now all I need is to tell my snapshot to snapshot not the present state of the mesh but the one at the next key (frame)

my guess is that preRenderEval doesn’t work with finalrender, had the same problem with vray

it’s sort of a hack, but you could try using the “at time” context for making your snapshots

Actually it works but I have to do it this way

gc
(
callbacks.removescripts id:#fRGlu
txt = “delete $glu3D_02

txt += “liq = $glu3D_01

txt += “snapshot liq
” –snapshot my Glu mesh
callbacks.addScript #preRendereval txt id:#fRGlu

)

the only problem is that I need a glu3D_02 mesh before I start the render or it doesn’t render the first frame and gives me the following error message
>> MAXScript Callback script Exception: – No “delete” function for undefined <<

thats the kind of stuff I would be able to script if I actually knew how to script, I just need this script to work before i start learning script hehehe makes no sense but to me

well you can add an error check to solve that problem:

if $glu3d_02 != undefined then delete $glu3d_02

or a great simple way to avoid errors being reported:

try(delete $glu3d_02)catch()

Thanx Aaron you are of great help, especially cause I barely know maxscript

Now my question to you is

is it possible to have a window appear that lets me select the object (that I know how to do) or more (that I don’t know how to do) then ask a range for frames (example I could ask to render from frame 4 to 45) that I know how to do to but what I don’t know is how to tell my callbacks that I only want that frame range to execute my snapshots but been able to render all the animation (in other words lets my animation goes from 0 to 150 but I only want the script to execute during the frame range I previously chose and render the rest without the script)

one last thing is it possible to tell my script to set the keyframer at the first frame I choose in my keyrange cause otherwise the first frame will render the wrong shape

Hi Aaron

problem

txt = “if $glu3d_02 != undefined then delete $glu3d_02

if I do this it doesn’t do my error but it doesn’t do my delete if the mesh exist

Page 2 / 2