[Closed] Creating rendertime geometry on sequences
I’m trying to create some geometry at render time, but have run into some problems when trying to do this with sequences.
Using a ‘prerender’ call back is called once on a sequence, so only the first frame would be created. Using ‘prerenderframe’ is called before each frame but after the geometry calculations are done, so thats a no no. I can’t see any other way apart from making a render sequence script, but I want to send the jobs over backburner to a farm.
Any ideas?
In the render dialog (Render Scene Dialog > Common Parameters > Scripts) you can assign a pre render script… maybe that will work for you?
-Johan
That was my port of call, but like the callback method it is only called once before rendering a sequence.
I think this might be what you’re looking for…
[left]#preRenderEval: time
[/left]
[left]Sent just before the renderer starts evaluating objects.
[/left]
[left]Returns the time being rendered[/left]
[left]
I was trying to do something similar to what you’re doing, from the sounds of it, and was using #preRenderFrame. I had to compensate for it being calculated after the frame is rendered by looking ahead one frame. Found this callback and it did exactly what I was looking for.
[/left]
Unless I misunderstood this still doesn’t work on sequences… try this example.
fn randombox=(Box lengthsegs:1 widthsegs:1 heightsegs:1 length:10 width:10 height:10 pos:[random -100 100,random -100 100,random -100 100] )
callbacks.addScript #preRenderEval "randombox()" id:#boxRender
Render 100 frames. First box is created on frame 1, next 99 frames look the same, then at end of render all 100 boxes appear in viewport…?
Hmm… interesting! I haven’t actually been using it for object creation, but rather toggling visibility of objects.
It does get called for every frame in the sequence, and it also does get called before the scene geometry is cached for that frame of the render (you can throw a format call into the function to check it).
I think there is a problem with creating geometry during the rendering process. That is my only guess right now. I remember hiding/unhiding objects during rendering also wouldn’t work for me, had to change the visibility values.
Yeah, I just dont think the rendering framework allows it. Shame, I’ll have to rethink.