What bones are animated in an action?

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Sheppy
Posts: 0
Joined: Fri Jan 12, 2007 6:03 pm
Location: California

What bones are animated in an action?

Post by Sheppy »

I'm trying to export data for only those bones actually animated in a particular animation. How do I track these down?

Thanks for any help and apologies if this is a totally dumb question - I spent some time searching for the info but came up with nowt (obviously!).

Sheppy
Posts: 0
Joined: Fri Jan 12, 2007 6:03 pm
Location: California

What bones are animated in an action? More info

Post by Sheppy »

I've done some more digging around into this problem (and it is a problem that needs solving to export flexible animations). Looking through the python API I could find no way to see which bones are active during an action, through in the UI they are clearly highlighted so the information is obviously available somewhere!

Looking through the C code (at the HEAD revision) it looks like the information may be available in the pose channel information. How do we make feature requests to the C coders to get this exposed to python (it would map to a flag in the PoseBone I think, something similar to the new .sel flag)?

In the meantime, incase others hit the same problem, I simply removed bones with no real variation in their pose during an animation. This is not ideal but gets me moving while I track down a real solution.

LetterRip
Posts: 0
Joined: Thu Mar 25, 2004 7:03 am

Post by LetterRip »

You might want to check at blenderartists python forum and check other scripts.

Sometimes questions here do get overlooked :)

My guess would be to get the ipo channel of each bone and the for all keys of that bone see if the keys are the same.

LetterRip

ascotan
Posts: 0
Joined: Thu May 29, 2003 10:32 pm
Location: Maryland, U.S.

Post by ascotan »

The only bones animated in an Action can be obtained by looking at the Actionchannels in the Action.

Only those bones with actionchannels in the Action are animated.

Once we go back to b-con1 i have some code that will allow you to get the actionchannels from the Actions. Then you can loop them by name...


for animated_bone in Action.channels.keys():
....print animated_bone

Post Reply