PDA

View Full Version : Animated Properties on an object


MoonDoggie
12-31-2008, 06:16 PM
Hello all,
I just need pointed to the animated keys of an object.
I have been looking through the help and I can't seem to find the correct methods.

I want to have a camera, which has a path_constraint assigned to it's pos controller, with it's percent value keyed (although I need it to return all keyed values).

If I have a Camera, I want to return all the keyed values of it, whether it's on the position, rotation, or scale controller.

something like


c = Camera()
props = (getpropnames c)
for p in props do (
print getproperty c p
-- .isAnimated?
)



thank you.

ZeBoxx2
01-01-2009, 12:09 AM
a la...

c = $.position.controller.percent.controller
Controller:Linear_Float
ks = c.keys
#keys(0f, 33f, 53f, 83f, 100f)
for k in ks do ( format "% -> %\n" k k.value )
#Linear Float key(1 @ 0f) -> 0.0
#Linear Float key(2 @ 33f) -> 44.8763
#Linear Float key(3 @ 53f) -> 44.7711
#Linear Float key(4 @ 83f) -> 103.0
#Linear Float key(5 @ 100f) -> 100.0
OK

?

Do the same for any other track that you'd want to check, of course

MoonDoggie
01-05-2009, 04:24 PM
Thanks ZeBoxx2. Always helpful.

I am curious if there is a way to do it for all tracks instead of just knowing that percent is keyed?

Looping through GetPropNames or something? Thanks a ton :)

-Colin

ZeBoxx2
01-05-2009, 06:54 PM
I'd loop / recurse over the subanims, actually - much simpler, although there's a (very slim) chance you'll have an animated property that does not appear as a subanim (hidden on purpose by the developer, say).

fn getSubKeyInfo sub spaces:"" = (
for i = 1 to sub.numsubs do (
subSub = sub[i]
format "%%\n" spaces subSub
if ((subSub.keys != undefined) AND (subSub.keys.count > 0)) then (
for k in subSub.keys do (
local kVal
try ( kVal = k.value )
catch ( kVal = "-- inaccessible - master controller? --" )
format "%% -> %\n" spaces k kVal
)
)
getSubKeyInfo subSub spaces:(spaces + " ")
)
)
getSubKeyInfo $

CGTalk Moderation
01-05-2009, 06:54 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.