have an error while creatin a key on 0frame and while there is no another key.
otherwise it runs well if there is minimum one key while you are on frame 0 or you are creatin the first speed key.
(
global zztTool
rollout zzTool "super spray"
(
group"Set Speed" --across: 2
(
spinner spSpeed "Speed" range:[0,1000,30]-- animatable
button btn_deleteKeys "Delete All Existing Keys" width:120 height:20 setColor:red
)
/*
group
(
)*/
on btn_deleteKeys pressed do
(
(
getST=slidertime
sliderTime = 0f
obj = getCurrentSelection ()
deleteKeys obj #allKeys
sliderTime = getST
)
)
on spSpeed changed val do
(
for obj in (selection as array) do
if classof obj == superspray then
(
s=slidertime
hiz=spSpeed.value
at time s animate on
obj.speed = (hiz/2.54)
a = getKeyIndex obj.speed.controller s
obj.speed.controller.keys[a].inTangentType = #linear
obj.speed.controller.keys[a].outTangentType = #fast
)
)
)
try
(
closeRolloutFloater zztTool
) catch ()
zztTool=newRolloutFloater "fountain floater" 300 100
addRollout zzTool zztTool
)
Anubis · 2010-11-28