View Full Version : Toggle display topology-dependence warning on / off


Opifex
04 April 2012, 01:39 PM
How do we turn off/on the display topology-dependence warning via maxscript, or is it not possible?

I'm making a script that does alot of modifications under the top modifier in the stack, and wondering how i can disable this warning while the script is doing its thing then enable it when its done.

I know how to disable and enable it manually, but how can i do this via maxscript, or ok it automatically via maxscript?

lo
04 April 2012, 02:58 PM
This setting is stored in the 3dsmax.ini. You can change the .ini values at runtime, but I don't think they will be in effect until next time you start 3dsmax.

About handling the dialog programatically, see help file or search this forum for DialogMonitorOps

denisT
04 April 2012, 04:26 PM
fn toggleDisplayTopologyDependenceWarning =
(
fn PreferenceCallback =
(
-- http://forums.cgsociety.org/showpost.php?p=6973531&postcount=13
fn setCheckBoxState hwnd state =
(
local BN_CLICKED = 0
local BM_SETCHECK = 241
local WM_COMMAND = 273

local parent = UIAccessor.getParentWindow hwnd
local id = UIAccessor.getWindowResourceID hwnd

windows.sendMessage hwnd BM_SETCHECK (if state then 1 else 0) 0
windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) hwnd
ok
)
hWND = DialogMonitorOPS.GetWindowHandle()

if (UIAccessor.GetWindowText hWND) != "Preference Settings" do return true
bt = windows.getchildhwnd hWND "Display Topology-Dependence Warning"

act = (getIniSetting (getMAXIniFile()) #performance #TopoMessage) as integer
setCheckBoxState bt[1] (act == 0)

UIAccessor.SendMessageID hWND #IDOK
true
)

DialogMonitorOPS.RegisterNotification PreferenceCallback id:#preferencesConfigure
DialogMonitorOPS.Enabled = true
max file preferences
DialogMonitorOPS.unRegisterNotification id:#preferencesConfigure
DialogMonitorOPS.Enabled = false
(getIniSetting (getMAXIniFile()) #performance #TopoMessage) as integer
)
/*
toggleDisplayTopologyDependenceWarning()
*/

Opifex
04 April 2012, 04:44 PM
Thanks you both, I'm not too sure how to do either of these, brand new to scripting, but i have tried your script dennis, and thank you very much, but i get this error:

-- Error occurred in anonymous codeblock; filename:
-- Compile error: No outer local variable references permitted here: setCheckBoxState
-- In line: setCheckBoxState b

denisT
04 April 2012, 05:03 PM
check the fixed version...

Opifex
04 April 2012, 05:11 PM
Perfect!! Thanks very much!!! :thumbsup: :beer:

SIL3D
08 August 2012, 06:29 PM
Not work with 3ds max 2012, but 2010 max is OK.

CGTalk Moderation
08 August 2012, 06:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


1