View Full Version : LW/LScript: Completion of RenderFrame() is being skipped

Don Willits
12-31-2007, 07:36 PM

When I run this script, frame #2 renders, but frame #1 does not. Is there some kind of eventing going on that I need to use to ensure that the first RenderFrame() completes (and the rendering idalog auto-magically closes) before GotoFrame(2) is called?

I'm trying to wade through docs / step thorugh tutorials and the like--but I think I'm missing something basic. I'm not clear, for example, how an agent would fit into something simple like this. I think I'm missing some fundamental paradigm about how all this fits together.

Don Willits

01-01-2008, 03:33 AM
Yup, fun fun fun those GN scripts.
Render() and RenderSelected() get evaluated after your script is done running. So, you won't be able to run those commands during the run of the script.

I ran in the same problem this week.

Here's Jarno's answer to the problem taken from : http://newtek.com/forums/showthread.php?t=77677

This problem sounds familiar. They get executed after the script has finished and control returned to LW. And no, it's not easy to change that behaviour.

What you can do is temporarily install a plugin which gets notified of render starts and ends (e.g. a master plugin) which does the post-rendering cleanup.


01-01-2008, 06:18 PM
i havent tried this, but is it possible to create a separate script that renders only, and the other script to move the frame.

also, a master-class archi will enable you to identify the event when a frame has finished rendering using:

if(event == RENDER_DONE)

please check release notes / docs for exact constant used because i'm not sure if the above is completely correct.

Don Willits
01-02-2008, 09:16 AM
Thanks guys, that gives me something to investigate further. (Although additional suggestions won't be turned down :) )