Grimm's take on the turntable anim script

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Thanks Thomas,

Yes, if he could explain them, that would be great! :)
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
abstrax
OctaneRender Team
Posts: 5510
Joined: Tue May 18, 2010 11:01 am
Location: Auckland, New Zealand

grimm wrote:Thanks Thomas,

Yes, if he could explain them, that would be great! :)
Since Octane is a progressive renderer and continues rendering even if the maximum samples specified in octane.render.start() have been reached, we just pause it. You can make it continue rendering after octane.render.start() returned by calling octane.render.continue().

Pausing means, the render threads are not getting any work to continues sampling the scene, but all resources are kept on the GPU and imager changes are still fed through to the render threads while all other changes that would require a restart are not passed to the render threads. They are idle, but the render loop is still running. This allows us to quickly continue rendering, via octane.render.continue(), but if you have made some changes to the scene that would require a restart, rendering will start with 0 s/px again. The pause and continue behave exactly the same way as you can observe in the standalone user interface.

octane.render.clear() sets NULL as render target node, i.e. the render target will reset all sub-systems and release most of the data on the GPUs. The render threads are kept around and with that the CUDA contexts, which are fairly expensive to close. So setting a different render target and starting a new render can still be done fairly quickly. One side effect of octane.render.clear() is that the render target will be unpaused.

octane.render.reset() stops the render threads, closes the CUDA contexts, destroys the render target and goes back to square one. After this call, all GPU resources have been released and there is nothing rendering anymore, i.e. all CPU resources used for rendering are released, too. This call is fairly invasive and slow, but allows you to start from scratch. This function is equivalent to the stop button in the UI.

Cheers,
Marcus
In theory there is no difference between theory and practice. In practice there is. - Yogi Berra
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Thanks Marcus! :D I have added octane.render.clear() to my script and it appears to be behaving better.
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

bepeg4d wrote:hi jason,
another little issue is that, after the exit of the script, you need to click "stop render" and clean all the gpu in order to reload a new render target.
i have prepared a little scene and packaged with the new .ocp format:
Hi Beppe,

Please try the script again, I have updated it to version 0.9 and added some fixes that should fix you problem. Note, this version only works with Octane 1.28.

Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
bepeg4d
Octane Guru
Posts: 10360
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi grimm,
thanks for the new version of your fantastic script and for thinking about at my suggestions ;)
a quick report:
-the "alt+t" shortcut works very well on mac but doesn't work on win7.
-now the "Load", "Save","Reset" buttons works perfectly on both mac and win, great :D
nice to have the "Save Setting- Completed!" window, well done ;)
- the octane.render.clear() works great ;)
-unfortunately the rt choice menu doesn't work as i expected :roll:
if i run a preview for the selected rt and then i chose another rt and run another preview, the rt doesn't change.
if i chose the "old mesh rt" only the distance from the object or the fov changes, but the view is the same.
-if a render target is grouped, the script doesn't work with the error message: "no render target selected 1" followed by another error window with the path of the turntableG_helpers.lua:144:error...
-it doesn't work even if you set a render-target-output port for the group, maybe via output port is possible to reach the rt inside the grouped node :roll:
in complex scenes, it could be necessary to grouping the rt, so if your script could work in this condition it would be useful ;)

note: i have just realized that now the render target node has an output port
what is the feature?
ciao beppe
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Hi Beppe,
bepeg4d wrote: -the "alt+t" shortcut works very well on mac but doesn't work on win7.
It works fine on Linux too, but I don't have a windows box to test on. :( It could be that you have that shortcut already defined (in Windows maybe) so it's getting stomped on?
bepeg4d wrote: -unfortunately the rt choice menu doesn't work as i expected :roll:
if i run a preview for the selected rt and then i chose another rt and run another preview, the rt doesn't change.
if i chose the "old mesh rt" only the distance from the object or the fov changes, but the view is the same.
I'm not getting that behaviour in my tests, I'm probably not doing the same type of node grouping as you are? Can you put together a small ocs file that I could test with?
bepeg4d wrote: -if a render target is grouped, the script doesn't work with the error message: "no render target selected 1" followed by another error window with the path of the turntableG_helpers.lua:144:error...
-it doesn't work even if you set a render-target-output port for the group, maybe via output port is possible to reach the rt inside the grouped node :roll:
in complex scenes, it could be necessary to grouping the rt, so if your script could work in this condition it would be useful ;)
I have attached an update, please give it a try and see if it works better for you. You still need to select the graph(group node) before calling the script. For instance, to test this I select two render target nodes and grouped them, selected the group graph and ran the script.
turntableG-V09test.zip
(14.84 KiB) Downloaded 273 times
Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
bepeg4d
Octane Guru
Posts: 10360
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi jason,
thanks for the update, i'll test and give you back my report soon ;)
ciao beppe
User avatar
bepeg4d
Octane Guru
Posts: 10360
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi,
i have prepared a simple file:
grimm09-02.rar
(4.41 KiB) Downloaded 275 times
if i select the rt3 node and run the script, it gives me this error message:
Capture-st128-01.JPG
Capture-st128-01.JPG (12.59 KiB) Viewed 4878 times
Capture-st128-01b.JPG
if i select a different rt and after, in the script menu i select the rt3, it gives this error:
Capture-st128-02.JPG
ciao beppe
Tugpsx
Licensed Customer
Posts: 1151
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL
Contact:

I think that would be correct since rt3 is an imported project with its own mesh and target. @Jason were you intending to allow the script to find any render target in the project and process that target.
If you d-click and expand the project then select the render target not its output then the script works.
Win 11 64GB | NVIDIA RTX3060 12GB
User avatar
bepeg4d
Octane Guru
Posts: 10360
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

hi,
just to clarify, rt3 is not imported, it's just an rt grouped, infact, it doesn't have his mesh node but an input-mesh-node.
anyway, this is not a big deal, as tupax said, just expand the node and select the rt ;)
maybe i misunderstood the function of the rt-pop-up, in my idea, it gives the opportunity to change the rt without leaving the script window :roll:
ciao beppe
Post Reply

Return to “Lua Scripting”