[Closed] Animated Properties on an object
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.
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 "% -> %
" 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
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
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).
[left]
fn getSubKeyInfo sub spaces:"" = (
for i = 1 to sub.numsubs do (
subSub = sub[i]
format "%%
" 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 "%% -> %
" spaces k kVal
)
)
getSubKeyInfo subSub spaces:(spaces + " ")
)
)
getSubKeyInfo $
[/left]