View Full Version : Animated Properties on an object

12 December 2008, 07: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.

01 January 2009, 01:09 AM
a la...

c = $.position.controller.percent.controller
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


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

01 January 2009, 05: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 :)


01 January 2009, 07: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 January 2009, 07: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.