Notifications
Clear all
[Closed] Saving and loading check box selection
Mar 27, 2018 1:03 pm
Hi everyone I am new in maxscript and I have a Batch export tool to make and I have to be able to save and load last use settings on it but I have no clue on how to do it settings are 3 check box that translate and rotate to 0,0,0 and a reset xform.
1 Reply
Mar 27, 2018 1:03 pm
Modify those functions to fit your needs.
-- load configuration data
function LoadControlsValues subRol iniFile =
(
for aControl in subRol.controls do
(
try
(
case classof aControl of
(
SpinnerControl: aControl.value = (readValue ((getIniSetting iniFile "Spinner" aControl.name) as stringStream))
CheckBoxControl: aControl.state = (readValue ((getIniSetting iniFile "Checkbox" aControl.name) as stringStream))
CheckButtonControl: aControl.state = (readValue ((getIniSetting iniFile "Checkbutton" aControl.name) as stringStream))
RadioControl: aControl.state = (readValue ((getIniSetting iniFile "RadioButton" aControl.name) as stringStream))
SliderControl: aControl.value = (readValue ((getIniSetting iniFile "Sliders" aControl.name) as stringStream))
ComboBoxControl: aControl.selection = (readValue ((getIniSetting iniFile "Dropdownlist" aControl.name) as stringStream))
EditTextControl: aControl.text = ((getIniSetting iniFile "EditText" aControl.name) as string)
ColorPickerControl: aControl.color = (readValue ((getIniSetting iniFile "Color" aControl.name) as stringStream))
)
)catch()
)
)
-- write configuration data
function WriteControlsValues subRol iniFile =
(
for aControl in subRol.controls do
(
case classof aControl of
(
SpinnerControl: setIniSetting iniFile "Spinner" aControl.name (aControl.value as string)
CheckBoxControl: setIniSetting iniFile "Checkbox" aControl.name (aControl.state as string)
CheckButtonControl: setIniSetting iniFile "Checkbutton" aControl.name (aControl.state as string)
RadioControl: setIniSetting iniFile "RadioButton" aControl.name (aControl.state as string)
SliderControl: setIniSetting iniFile "Sliders" aControl.name (aControl.value as string)
ComboBoxControl: setIniSetting iniFile "Dropdownlist" aControl.name (aControl.selection as string)
EditTextControl: setIniSetting iniFile "EditText" aControl.name (aControl.text as string)
ColorPickerControl: setIniSetting iniFile "Color" aControl.name (aControl.color as string)
)
)
setIniSetting miauuPolytownReaLIGHTiniFile "SubRollState" subRol.name (subRol.open as string)
)