RobertMayer
12-10-2006, 03:02 AM
Hey guys, im looking to create a spinner that controls the maximum value of a slider. I've got it all working except for one thing: the Slider will not Update when you enter a new value. You have to deselect the item and reselect it for it to work. I cannot figure out how to update it as you go.
Here is the script as it stands.
-- FoaS 3-Point Lighting Rig
-- v: 0.1a
plugin modifier ThreePointControls
name: "FoaS 3-point Rig v0.1a"
classID:#(0x492d55d4, 0x363e8221)
(
parameters main rollout:controls
(
'KeyInt' ui:key_sld type:#float default:0
'FilInt' ui:fil_sld type:#float default:0
'BakInt' ui:bak_sld type:#float default:0
'KeyCol' ui:key_pkr type:#color default:(color 255 255 255)
'FilCol' ui:fil_pkr type:#color default:(color 255 255 255)
'BakCol' ui:bak_pkr type:#color default:(color 255 255 255)
'Keymax' ui:key_spn type:#float default:1
)
rollout Controls "Light Console" width:160 height:300
(
slider key_sld "Key" range:[0,Keymax,0] orient:#vertical ticks:0 pos:[10,50] width:40 height:100 enabled:true
slider fil_sld "Filler" range:[0,1,0] orient:#vertical ticks:0 pos:[60,50] width:40 height:100 enabled:true
slider bak_sld "Kicker" range:[0,1,0] orient:#vertical ticks:0 pos:[110,50] width:40 height:100 enabled:true
spinner key_spn "" range:[0,100,keymax] pos: [10,160] width:40
colorpicker key_pkr "" pos:[10,10] width:40 height:40 color:((color 255 255 255))
colorpicker fil_pkr "" pos:[60,10] width:40 height:40 color:((color 255 255 255))
colorpicker bak_pkr "" pos:[110,10] width:40 height:40 color:((color 255 255 255))
)
on key_spn changed val do
(
key_sld.range.y = val
if (val > keyint.value) then (keyint.value = value))
)
Once again, the problem is the slider will not update automatically until you descelect the item and reselect it. Furthermore the actual light will not change to suit until you move the slider.
Here is the script as it stands.
-- FoaS 3-Point Lighting Rig
-- v: 0.1a
plugin modifier ThreePointControls
name: "FoaS 3-point Rig v0.1a"
classID:#(0x492d55d4, 0x363e8221)
(
parameters main rollout:controls
(
'KeyInt' ui:key_sld type:#float default:0
'FilInt' ui:fil_sld type:#float default:0
'BakInt' ui:bak_sld type:#float default:0
'KeyCol' ui:key_pkr type:#color default:(color 255 255 255)
'FilCol' ui:fil_pkr type:#color default:(color 255 255 255)
'BakCol' ui:bak_pkr type:#color default:(color 255 255 255)
'Keymax' ui:key_spn type:#float default:1
)
rollout Controls "Light Console" width:160 height:300
(
slider key_sld "Key" range:[0,Keymax,0] orient:#vertical ticks:0 pos:[10,50] width:40 height:100 enabled:true
slider fil_sld "Filler" range:[0,1,0] orient:#vertical ticks:0 pos:[60,50] width:40 height:100 enabled:true
slider bak_sld "Kicker" range:[0,1,0] orient:#vertical ticks:0 pos:[110,50] width:40 height:100 enabled:true
spinner key_spn "" range:[0,100,keymax] pos: [10,160] width:40
colorpicker key_pkr "" pos:[10,10] width:40 height:40 color:((color 255 255 255))
colorpicker fil_pkr "" pos:[60,10] width:40 height:40 color:((color 255 255 255))
colorpicker bak_pkr "" pos:[110,10] width:40 height:40 color:((color 255 255 255))
)
on key_spn changed val do
(
key_sld.range.y = val
if (val > keyint.value) then (keyint.value = value))
)
Once again, the problem is the slider will not update automatically until you descelect the item and reselect it. Furthermore the actual light will not change to suit until you move the slider.
