Hi
I have scripted a camera rig interface using custom attributes. Now when I select a lens from a dropdown list it sets the focal length and disables some spinners. Howether when I deselect and then reselect the object the values have changed but the dropdown list reverts to position 1 and the spinners re-enable themselfs. How do I get them to remember there settings?
Thanks
My Code:-
rollout ro_lensControls "Lens Controls" width:162 height:77
(
label lab_fp "Focus:" pos:[20,8] width:99 height:16
spinner spn_dist "Dist:" pos:[35,31] width:99 height:16 range:[1,9999999,0]
label lab_lens "Lens Type:" pos:[20,54] width:99 height:16
dropdownlist ddl_lens items:#
(
"Free",
"14mm Prime f2.8",
"24mm Prime f1.4",
"35mm Prime f1.4",
"50mm Prime f1.2",
"85mm Prime f1.2",
"100mm Prime f2.8",
"200mm Prime f2.8",
"300mm Prime f2.8"
) pos:[20,70] width:120 height:16
on ddl_lens selected i do
(
if ddl_lens.selection == 1 then
(
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = true
)
if ddl_lens.selection == 2 then
(
ffmm = 14
ffnum = 2.8
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 3 then
(
ffmm = 24
ffnum = 1.4
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 4 then
(
ffmm = 35
ffnum = 1.4
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 5 then
(
ffmm = 50
ffnum = 1.2
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 6 then
(
ffmm = 85
ffnum = 1.2
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 7 then
(
ffmm = 100
ffnum = 2.8
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 8 then
(
ffmm = 200
ffnum = 2.8
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
if ddl_lens.selection == 9 then
(
ffmm = 300
ffnum = 2.8
$.modifiers[#Camera_Rig].ro_lensControls.spn_ffmm.enabled = false
)
)
label lab_foc "Focal Length:" pos:[20,100] width:99 height:16
spinner spn_ffmm "mm :" pos:[35,123] width:99 height:16 range:[1,999,0]
label lab_ap "Aperture:" pos:[20,146] width:99 height:16
spinner spn_fnum "F-stop" pos:[35,169] width:99 height:16 range:[0,999,0]
)
)
custAttributes.add $.modifiers[1] ca2
Graph · 2010-12-22
Anubis · 2010-12-22