PDA

View Full Version : How to find all animation keys


baotd86
03-13-2012, 12:56 PM
I have many object, class of each object are difference and type of controller each object are difference too: transform controller, visibility track, materials, sound....
I want to find all keys of all object, so, what do i should ?
Thank you ! :)

martinez
03-14-2012, 05:39 AM
I'm not at my computer, but you can access the sub anim controllers using the numsubs property in a recursive function. The test the controller with supportsKeys.

martinez
03-15-2012, 12:36 AM
I took a stab at it. I hope it help you out.


(

--CREATE A FUNCTION TO FIND CONTROLLERS THAT SUPPORT KEYS
mapped fn getKeys obj theKeys =
(
for i = 1 to obj.numsubs do
(
if obj[i] != undefined do
(
for v = 1 to obj[i].numsubs do
(
getKeys obj[i][v] theKeys
)

if obj[i].controller != undefined do
(
if obj[i].controller.supportsKeys do
(
try
(
if obj[i].controller.keys.count > 0 do
(
append theKeys obj[i].controller.keys
)
)
catch()
)
)
)
)

return theKeys
)

--CREATE AN EMPTY ARRAY
KeyArray = #()

getKeys objects KeyArray

print KeyArray
)

denisT
03-15-2012, 06:06 AM
I have many object, class of each object are difference and type of controller each object are difference too: transform controller, visibility track, materials, sound....
I want to find all keys of all object, so, what do i should ?
Thank you ! :)
to find keys you have to find animated subanims... follow the discussion http://forums.cgsociety.org/showthread.php?f=98&t=1020938&highlight=keys

baotd86
03-15-2012, 12:11 PM
thank you Martinez, your script is useful for me :)

CGTalk Moderation
03-15-2012, 12:11 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.