Question

I've run across another issue using the dynamic rollouts. I'd like to add a handler for when a radio button group's selection is changed. Here is what I have:

--Instantiate a new dynamic rollout object
dro = rolloutCreator "CustomParamsRollout" "Edit Custom Parameters"
--Begin building rollout
dro.begin()

--Create an array to hold the names of the radio button options
dro.addLocal "RadioOptions" init: #("Predefined", "Custom")
--add control  --type        --label --displayed name   --labels             --alignment
dro.addControl #radiobuttons #rdo_1 "radio_1" paramStr: "labels:RadioOptions align:#left"
--Add a handler for the first radio button
dro.addHandler #rdo_1 #changed filter:on paramStr:"1" codeStr:"MessageBox @Hey@"

createDialog (dro.end())

The error I keep getting is:

Compile error: Bad number or time syntax

In line: on rdo_1 changed 1do

Whenever I click on a radio button. I'm most certain that my syntax is poorly written, as that has been the biggest hangup in this project so far. Any helpful hints would be appreciated. Thank you.

Was it helpful?

Solution

Since 3ds Max 2012 you need to add an extra space to the parameter string (in Max 2011 and earlier version it works without glitches. So instead of paramStr:"state" it would have to be paramStr:"state " – note that using integer for a name of variable will not work, rollout handlers don't in any way work like pattern matching, you need to handle different parameters inside the handler scope.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top