[Closed] radiobuttons change following rooloutsettigns?
how can I affect my rollout with radiobuttons?
f.e. if i want to have three states:
rollout create "create Objects"
(
group "what shape do you want to create?"
(
radiobuttons rbShape labels:#("box","sphere","cylinder")
--now here i would like to have a new group with some settings for the specific object.
--but this settings should change when the user selects a different radiobutton.
)
)
creator = newRolloutFloater "ObjectCreator" 218 400
addRollout create creator
I hope you guys understand and can help me
Try this. It must works.
rollout create "create Objects"
(
group "what shape do you want to create?"
(
radiobuttons rbShape labels:#("box","sphere","cylinder")
spinner SphereRadiusSpinner "SphereRadius" visible:FALSE
spinner CylinderRadiusSpinner "CylinderRadius" visible:FALSE
spinner BoxHeightSpinner "BoxHeight" visible:True
)
on rbShape changed state do (
If rbShape.state == 1 then (
SphereRadiusSpinner.visible = false
CylinderRadiusSpinner.visible = false
BoxHeightSpinner.visible = true )
If rbShape.state == 2 then (
SphereRadiusSpinner.visible = true
CylinderRadiusSpinner.visible = false
BoxHeightSpinner.visible = false )
If rbShape.state == 3 then (
SphereRadiusSpinner.visible = false
CylinderRadiusSpinner.visible = true
BoxHeightSpinner.visible = false )
)
)
creator = newRolloutFloater "ObjectCreator" 218 400
addRollout create creator
that does work… i have a similar issue but with checkboxes…
i want checkboxes that have the name of each scenematerial and then i want to be able to read the total checkboxes i.e materials selected so i can perform my action but dont know how to do it… if i try to put the scenematerial variable for the checkbox values, it gives me an error.
The checkbox captions hold strings, not material values.
Try this:
material.name
-Dave
thats exactly what i am doing… its a multisub material so the name of the sub-material “name” slot is different than the name of the actual sub-material
i am using the multimaterial.names[i] for the slot name and it works throughout the script i am using but not with checkboxes… works with radiobuttons…
hey vadim, thanx a lot. I allways tried to add a new rollout now i’m using the enabled property instead of .visible to avoid tool settings jumping.
funny, last time it didn’t work, now it does for some reason
rollout create "create Objects"
(
group "what shape do you want to create?"
(
radiobuttons rbShape labels:#("box","sphere","cylinder")
)
on rbShape changed state do
(
if rbShape.state == 1 do
(
addRollout cBox creator
removeRollout cSphere creator
removeRollout cCylinder creator
)
if rbShape.state == 2 do
(
removeRollout cBox creator
addRollout cSphere creator
removeRollout cCylinder creator
)
if rbShape.state == 3 do
(
removeRollout cBox creator
removeRollout cSphere creator
addRollout cCylinder creator
)
)
)
rollout cBox "createBox"
(
spinner bLength "Length" range:[0,9999,10]
)
rollout cSphere "createSphere"
(
spinner sRadius "radius" range:[0,9999,10]
)
rollout cCylinder "createCylinder"
(
spinner cHeigth "height" range:[0,9999,10]
)
creator = newRolloutFloater "ObjectCreator" 218 400
addRollout create creator
addRollout cbox creator
If You want to use a lots of rollouts in one floater You must define them as global.
Otherwise maxscript will return error every time when You restart max.
global creator
global cBox
global cSphere
global cCylinder
global create
rollout create "create Objects"
(
group "what shape do you want to create?"
(
radiobuttons rbShape labels:#("box","sphere","cylinder")
)
on rbShape changed state do
(
if rbShape.state == 1 do
(
addRollout cBox creator
removeRollout cSphere creator
removeRollout cCylinder creator
)
if rbShape.state == 2 do
(
removeRollout cBox creator
addRollout cSphere creator
removeRollout cCylinder creator
)
if rbShape.state == 3 do
(
removeRollout cBox creator
removeRollout cSphere creator
addRollout cCylinder creator
)
)
)
rollout cBox "createBox"
(
spinner bLength "Length" range:[0,9999,10]
)
rollout cSphere "createSphere"
(
spinner sRadius "radius" range:[0,9999,10]
)
rollout cCylinder "createCylinder"
(
spinner cHeigth "height" range:[0,9999,10]
)
creator = newRolloutFloater "ObjectCreator" 218 400
addRollout create creator
addRollout cbox creator