Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / how to remove keys from a bone?
  RSS 2.0 ATOM  

how to remove keys from a bone?
Rate this thread
 
22752
 
Permlink of this thread  
avatar
  • steebu
  • Posted: 13 February 2009 05:44 PM
  • Total Posts: 44
  • Joined: 09 January 2007 01:40 PM

So I’m trying to remove all translation keys from a bone.  I can iterate frame-by-frame, but there’s a better way in python, right?

I did this using the orsdk, but am not sure how to implement it here.

I imagine it’s similar, but there’s no AnimationNode.Find property.  How does the FindByLabel function work?

#pseudocode

get bone name
get the lcl translation node from bone.AnimationNode # not sure how to do this part in python
get the X node
FCurve.EditClear()
get the Y node
FCurve.EditClear()
get the Z node
FCurve.EditClear()

something like that, right?  I see the FCurve.EditClear() function, but don’t see how I can go about grabbing the Lcl Translation node without manually iterating through the list and stopping when I find it, e.g.

lmodel = FBFindModelByName( “elbow” )

for bone in lmodel.AnimationNode.Nodes:
if( bone.UserName == “Lcl Translation” )
# clear the T keys off it



Replies: 0
avatar
  • steebu
  • Posted: 19 February 2009 03:31 PM

So per the post above, I’m trying to clear the T keys off of a series of joints that have T and R keys.  I saw KxL’s post regarding EditClear here;

http://area.autodesk.com/for...ile-iterating-over-takes/

But, regardless of what method I use (I’m still using FBCurve.EditClear() I’m getting some VERY weird side effects.

If I select the joint in question and clear the T keys it will clear the keys AND (sometimes) set the local translate values of the bone to 0,0,0.  The result is that the bone translates to its parent!  It’s very inconsistent.  Sometimes it will do the right thing and remove the translate keys, sometimes it will remove the translate keys AND set the lcl translate value to 0,0,0.

Anyone else have similar side effects?



Replies: 0