Hi Jason,
That's a bug in the script (I fixed it in the yaw, pitch and roll script). The easiest way to fix this is to just get fresh copies of the scene, render target and camera. Creating copies is cheap. I wouldn't bother trying to restore the original state, just get a fresh copy. You would need to do this just before you start rendering:
- Code: Select all
elseif component == renderButton then
-- Get the render target and camera in global variables
-- NOTE: here we create a fresh copy just before we start rendering.
SCENE_GRAPH, RT_NODE, CAM_NODE = getSceneCopy()
-- Start the actual rendering.
startRender(SCENE_GRAPH, RT_NODE, CAM_NODE, OUT_PATH)
elseif component == cancelButton then
cancelRender()
elseif component == window then
Saving the variables doesn't work because the value of the variable isn't the node itself, it's a reference to the node. So the saved variable just points to the same node (similar to pointer in C).
Clearing the animator doesn't work either. An animator is only like a "wrapper" around an attribute, modifying the attribute value for each time frame (and interpolating between values). So if you clear the animator, the attribute retains the last set value. The last value may or may not be the original value (depending on whether you changed the time in the scene).
I hope this clears things up a bit.
regards,
Thomas