Run script when octane viewport open

3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here http://render.otoy.com/forum/viewforum.php?f=18
Post Reply
HHbomb
Licensed Customer
Posts: 1373
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

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 :-)
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
neonZorglub
OctaneRender Team
Posts: 1009
Joined: Sun Jul 31, 2016 10:08 pm

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
HHbomb
Licensed Customer
Posts: 1373
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

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 !!
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
Post Reply

Return to “Autodesk 3Ds Max”