When I run this code it creates a key at the proper frame. But when I create a second key it changes the value of the first key....?
(
fn fnAddVisKey Obj Val =
(
VisTrack = obj.visibility.controller
with animate on
(
newKey = addNewKey VisTrack currentTime #select
newKey.value = Val
)
)
rollout rlVisibilityTrack "Visibility Track"
(
button btnVisOff "On" width:70 height:30 pos:[5,5]
button btnVisOn "Off" width:70 height:30 pos:[75,5]
button btnDelVisKey "Delete Visibility Key" width:140 height:30 pos:[5,40]
on btnVisOff pressed do
(
if selection.count >= 1 then
(
undo on
(
for obj in selection do
(
if (obj.visibility != bezier_float()) then --Add Visibility Track
(
obj.visibility = bezier_float()
)
fnAddVisKey obj 0.0
)
)
print ("Keys" + " " + sliderTime as string)
)
)
)
createDialog rlVisibilityTrack 150 75
)
By JokerMartini · 2011-03-31
Anubis · 2011-03-31