Hi guys!
I was trying to figure out how to retrieve information from 3ds max animation keys using maxplus, maxscript or the c++ sdk, doesn't matter too much. But I'd like to know which are the specific functions I'd need to use to achieve the goal.
I've tried some of the methods listed in the docs but I haven't had any luck so far.
Let's say I've got a very simple animation of a box:
Where I've created 4 animation keys animating the box position, how would I iterate through these 4 keys and get the info attached to them?
So far I've created this snippet:
n = MaxPlus.SelectionManager.GetNodes()[0]
print("n.GetNumKeys()={} n.GetNumSubAnims()={}".format(
n.GetNumKeys(),
n.GetNumSubAnims()
))
for index in range(n.GetNumSubAnims()):
animatable = n.GetSubAnim(index)
animatable_name = n.GetSubAnim(index)
if animatable:
num_keys = animatable.GetNumKeys()
print("GetSubAnim({})={} num_keys={}".format(index, animatable, num_keys))
else:
print("GetSubAnim({})={}".format(index, animatable))
but I don't understand very well the information is giving me:
n.GetNumKeys()=-1 n.GetNumSubAnims()=7
GetSubAnim(0)=None
GetSubAnim(1)=None
GetSubAnim(2)=Animatable(Position/Rotation/Scale) num_keys=-1
GetSubAnim(3)=Animatable(Box) num_keys=-1
GetSubAnim(4)=None
GetSubAnim(5)=None
GetSubAnim(6)=None
So, how can I retrieve the information of these 4 keys?
Thanks in advance.
miauu · 2018-12-27