[solved] Maxscript to close OctaneRender Viewport ?

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
wildpeaks
Licensed Customer
Posts: 4
Joined: Mon May 11, 2015 1:21 am

This can open it:

Code: Select all

actionMan.executeAction 982383860 "2642"
but haven't been able to guess a way to close it programmatically (and I've been searching in actions, properties, interfaces and globals, just can't guess it).

I'm writing a tool to bake textures and was able to automate everything else, except this one step :)
Last edited by wildpeaks on Tue Nov 27, 2018 12:50 pm, edited 1 time in total.
wildpeaks
Licensed Customer
Posts: 4
Joined: Mon May 11, 2015 1:21 am

Nevermind, I managed to force it to close using UIAccessor :)

Code: Select all

fn closeOctaneViewport = (
	local hwnd = dialogMonitorOps.GetWindowHandle()
	local children = UIAccessor.GetChildWindows hwnd
	for child in children do (
		local windowTitle = (UIAccessor.GetWindowText child)
		if matchPattern windowTitle pattern:"OctaneRender Viewport *" ignoreCase:false do (
			UIAccessor.CloseDialog child
			exit
		)
	)
)
HHbomb
Licensed Customer
Posts: 1375
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

Cool. will you show us your bake tool ?
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
wildpeaks
Licensed Customer
Posts: 4
Joined: Mon May 11, 2015 1:21 am

Now I feel silly: despite searching the forums quite a few times, I seem to have missed a post that had an even simpler solution :D

Code: Select all

OctaneMaxFPI.ViewportSetWindowState(0)
As for showing the tool, it's just an internal tool so I'd have to clean it up first, but sure I'll eventually post it.
HHbomb
Licensed Customer
Posts: 1375
Joined: Wed Jun 30, 2010 8:45 pm
Contact:

cool
YOKO Studio | win 10 64 | i7 5930K GTX 3090 | 3dsmax 2022.3 |
Post Reply

Return to “Autodesk 3Ds Max”