Run script when octane viewport open

Forums: 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 viewforum.php?f=18

Run script when octane viewport open

Postby HHbomb » Thu Sep 29, 2022 2:36 pm

HHbomb Thu Sep 29, 2022 2:36 pm
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 |
HHbomb
Licensed Customer
Licensed Customer
 
Posts: 1307
Joined: Wed Jun 30, 2010 8:45 pm

Re: Run script when octane viewport open

Postby neonZorglub » Thu Sep 29, 2022 8:39 pm

neonZorglub Thu Sep 29, 2022 8:39 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
neonZorglub
OctaneRender Team
OctaneRender Team
 
Posts: 899
Joined: Sun Jul 31, 2016 10:08 pm

Re: Run script when octane viewport open

Postby HHbomb » Fri Sep 30, 2022 8:30 am

HHbomb Fri Sep 30, 2022 8:30 am
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 |
HHbomb
Licensed Customer
Licensed Customer
 
Posts: 1307
Joined: Wed Jun 30, 2010 8:45 pm

Return to Autodesk 3Ds Max


Who is online

Users browsing this forum: No registered users and 1 guest

Wed Apr 24, 2024 2:01 am [ UTC ]