Notifications
Clear all

[Closed] Object Evaluation #postRenderFrame Callback

Hi all,

Are there any limitations with creating new objects by callbacks between render frames? I’m trying to get this script to work, and then I realized max/vray might not be evaluating new objects while rendering;

I wrote a script that on each frame collects particles from a pFlow system, adds a new SplineShape() and a line between the particle positions, it also deletes the previous shape. This works fine in the viewport with a TimeCallback, but when rendering it only renders the object at the current or first frame. I’m also just rendering locally on this one. Am I missing something, any way to make it work, or do I just have to solve this differently?

1 Reply

Guess I found the answer myself.

WARNING: You cannot change an object’s mesh in a #preRenderFrame , #postRenderFrame or any of the #beginRendering* callbacks, particularly if the mesh isn’t animated. The renderer has already evaluated the original mesh and holds a pointer to that mesh. Changing the object’s mesh will delete the old mesh, but the renderer doesn’t know this, and when trying to render the now deleted mesh will crash.

Now to figure out another way to do this…