Page 1 of 1

Run script when octane viewport open

Posted: Thu Sep 29, 2022 2:36 pm
by HHbomb
Hi,
I never use it but in max we can run script at pre-render and post-render.
I would like to know if it is possible to run a script when we open octane render viewport.
For exemple "(getClassInstances Substitute).enabled=false"
Thanks :-)

Re: Run script when octane viewport open

Posted: Thu Sep 29, 2022 8:39 pm
by neonZorglub
Hi HHbomb,

Not directly from Octane plugin yet, but opening the Octane viewport will send pre and post render notification, if you have the 'Broadcast Render mode' set to the default value ("Normal (pre and post render)").
So you should be able to run your script from those notifications.
Something like that:
callbacks.addScript #preRender "setUpRenderGeom()" id:#jbwRender
see https://help.autodesk.com/view/3DSMAX/2 ... 2EAE36_htm


Alternatively, you could have a script / new command, button that would call both your pre open function and the open viewport command
myScript()
actionMan.executeAction 982383860 "2642" -- open Octane viewport

(I'll add some options in the next release to call scripts without those notifications, in preferences, similar to the existing pre / post export script)

Thanks

Re: Run script when octane viewport open

Posted: Fri Sep 30, 2022 8:30 am
by HHbomb
Many thanks NZ ! so kind ! :-)

a rapid patch-up job ( from autodesk help ) :

(
callbacks.removescripts id:#sphere_segs
txt ="(getClassInstances Substitute).enabled=false \n"

callbacks.addscript #preRender txt id:#sphere_segs
txt ="(getClassInstances Substitute).enabled=true \n"

callbacks.addscript #postRender txt id:#sphere_segs
)

cool it works !!