PDA

View Full Version : activate visibility track


loran
10-06-2009, 11:11 AM
I am creating a tool to animate several object visibility. My problem is I can't activate the visibility track by script... anyone can do that?

BTW here is my script

-- loran 2009 - - loran.cg@laposte.net
-- visibility animator-
rollout visibility "::visibility::"
(

button addviztrack "Add visibility track to selection"
label blabla1 "---------------------------------"
spinner fr1 "frame:" type:#integer range:[0,10000,1]
spinner viz1 "visibility:" type:#integer range:[0,1,0]
label blabla2 "---------------------------------"
spinner fr2 "frame:" type:#integer range:[0,10000,10]
spinner viz2 "visibility:" type:#integer range:[0,1,1]

button btndoit"DO IT"width:100 height:35
button btnreset "Reset animation" width:100 height:15

--add visibility track for selected objects
on addviztrack pressed do
(for o in selection do
(
actionMan.executeAction 1 "640" -- Doesn't work :/ please help!
)
)

--apply animation for selected objects
on btndoit pressed do
(
for o in selection do
(
with animate on
(
at time 0 o.visibility.controller.value = viz1.value
at time fr1.value o.visibility.controller.value = viz1.value
at time fr2.value o.visibility.controller.value = viz2.value
selectKeys o.visibility.controller 0 0f
deleteKeys o.visibility.controller #selection
)
)
)

-- clear all visibility frame for selected objects
on btnreset pressed do
(
for o in selection do
(
selectKeys o.visibility.controller 0 10000f
deleteKeys o.visibility.controller #selection
o.visibility.controller.value = 1
)
)
label blabla3 "---------------------------------"
label blabla4 "::loran::"
)

createDialog visibility

loran
10-06-2009, 12:20 PM
Goy it! here is the answer
$.visibility = bezier_float()

CGTalk Moderation
10-06-2009, 12:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.