HI guys,
Most like a simple one for most of you but this is giving me a little bit of a headache.
I am trying to grey out (make unclickable) all my buttons in my rollout unless a condition (a box exists in the scene) is met but I cant get it to work. The "bounding box" button creates the box I want in the scene.
Should this be done through .enabled? Should I make the conditional check on the box a loop?
rollout threepointlight "3 Point Lighting"
(
group "Bounding Box"
(
button But_info "Usage Guide" enabled:true
button But_BoundingBox "Build Bounding Box" enabled:true
button but_BoundingBoxToggle "Hide Bounding Box"
button but_BoundingBoxToggle2 "Show Bounding Box"
on But_BoundingBox pressed do
box height:150 width:150 length:150 pos:[0,0,0]
on But_info pressed do messagebox "Place and Scale your object inside the Bounding box for this script to work"
on but_BoundingBoxToggle pressed do hide $Box001
on but_BoundingBoxToggle2 pressed do unhide $Box001
)
-- Lighting section
group "Lights"
(
button but_buildlights1 "Build Omni one" enabled:false
on but_buildlights1 pressed do
(
l1=MiAreaLightomni pos:[0,0,370] $.castShadows = on $.useGlobalShadowSettings = on $.multiplier = 0.70 $.rgb = color 178 178 178
)
button but_buildlights2 "Build Omni Two" enabled:false
on but_buildlights2 pressed do
l2=MiAreaLightomni pos:[0,370,-150] intensity:1.0 shadows:false
button but_buildlights3 "Build Omni Three" enabled:false
on but_buildlights3 pressed do
l3=MiAreaLightomni pos:[370,45,150] intensity:1.0 shadows:true
colorpicker L1_d "Light one Color"
color:[255,255,255] align:#right offset:[-20,0] fieldwidth: 20 enabled:false
colorpicker L2_d "Light two Color"
color:[0,0,255] align:#right offset:[-20,0] fieldwidth: 20 enabled:false
colorpicker l3_d "Light three Color"
color:[255,0,0] align:#right offset:[-20,0] fieldwidth: 20 enabled:false
button But_AddSky "Add SkyLight" enabled:true
spinner spn_skyIntense "Skylight Intensity" enabled:false
range:[0.0,1.0,1.0]
on But_AddSky pressed do
skylight pos:[0,0,0]
)
)
createDialog threepointlight height:700 width:300
Sorry if this has been covered a lot, Ive just stepped into the world of maxscripting.


Anubis · 2012-12-06
miauu · 2012-12-06