Page 1 of 1

[solved] Maxscript to close OctaneRender Viewport ?

Posted: Tue Nov 27, 2018 9:24 am
by wildpeaks
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 :)

Re: Maxscript to close OctaneRender Viewport ?

Posted: Tue Nov 27, 2018 12:50 pm
by wildpeaks
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
		)
	)
)

Re: [solved] Maxscript to close OctaneRender Viewport ?

Posted: Tue Nov 27, 2018 1:27 pm
by HHbomb
Cool. will you show us your bake tool ?

Re: [solved] Maxscript to close OctaneRender Viewport ?

Posted: Tue Nov 27, 2018 4:00 pm
by wildpeaks
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.

Re: [solved] Maxscript to close OctaneRender Viewport ?

Posted: Wed Nov 28, 2018 8:03 am
by HHbomb
cool