remember if rollout elements is enabled

If there a better way to remember if rollout elements are enabled, then assign it like this:

on rolloutRot open do
(
	theState = boolRotationEnabled.state
	if boolRotationEnabled.state then
	(
		floatRotationXYZ.enabled = boolRotationLink1D.state
	)
)

I got loads of elements and was hoping there was a faster and automatic way for it to remember the elements enabled status, like the value in element is in parameter.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
McGreed's picture

Shame, was hoping that I

Shame, was hoping that I could make UI update a bit more smooth.
Thanks anyway.

Nysuatro's picture

An other option would be to

An other option would be to write some data to the rootnode of your maxfile.

setappdata rootnode 1 "test"
getappdata rootnode 1

Anubis's picture

Whatever is method to use to

Whatever is method to use to store the settings, No other way to update this w/o on rollout open do event. The param block elements control (and auto update) only the main feature of the binded ui-element, like .value for spinners, .checked for checkbox and so on. The rest ui-element's properties like .with, .enabled and so on are not updated.

my recent MAXScripts RSS (archive here)

br0t's picture

well I think there are

well I think there are several ways, but none of them is very easy. You could use persistent globals (though the help files generally says that doing so is evil), you could save the state of the UI elements as a string into an animation track or as values to an INI file. I dont have much experience in that, I used handwritten INI save/load commands from time to time.
I think Graph has an example on his website how to save/load UI values to registry keys (hope you dont mind if I post it here), and thats automated, so that might be what ure searching for:
http://graph.net84.net/index.php?p=maxscript -> scroll down to: "Save/Load UIItem's values struct/functions "

Cheers

Never get low & slow & out of ideas

br0t's picture

I dont understand this... do

I dont understand this... do you want your rollout elements to remember if they are enabled when closing and reopening your script/rollout?

Never get low & slow & out of ideas

McGreed's picture

Yes. I got a modifier, where

Yes. I got a modifier, where in the rollout, depending on which options you select, some other fields and checkboxes will be enabled/disabled, and I would like the rollout to remember those, without having to manually set them to enabled/disabled with on rollout open. I was wondering if that would be possible.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.