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 / Saving Only Bones of a Take
  RSS 2.0 ATOM  

Saving Only Bones of a Take
Rate this thread
 
50547
 
Permlink of this thread  
avatar
  • steebu
  • Posted: 16 December 2010 09:53 AM
  • Total Posts: 45
  • Joined: 09 January 2007 01:40 PM

Using MB 2010 on Windows 7x64.

I can’t seem to save just the selected bones of a take using python (I used to do this in 2009 but that code isn’t working now).

I constrained some markers to a mesh with bones.  As I scrub the scene the markers move about, which in turn, drive the bones and mesh.  I am not using the Actor | Character tool.

I manually plot TR keys on the bones.

The FCurve editor shows data on the bones.  All’s well.

I manually select the hierarchy of bones only (no mesh, no cameras, no optical root, etc.) and do a Save Selection (not Save or Save As).  I give it a filename and hit OK.  If I load that file back into MB, I ONLY see keyed bones moving around - no geo, no cameras, no markers, etc.

I need to replicate that functionality using python, but, I can’t seem to get it to work.

This used to work for me, I think, but I don’t know if something changed:

LM FBFbxManager()
LM.UseASCIIFormat False
LM
.Selected True  # should only save selected models
LM.SaveBeginfbxfile )   # fbxfile defined elsewhere
LM.Save()
LM.SaveEnd()

This generates an FBX file as expected, but it also contains markers, the geo, cameras, and everything else in the scene.  I’ve played around with the other options to no avail:

LM.Cameras FBElementAction.kFBElementActionDiscard
LM
.BaseCameras True # also tried False

All I want to do is save the selected bones and nothing else ... what am I missing?



Replies: 0
avatar
  • steebu
  • Posted: 16 December 2010 10:02 AM

Ah, quick update (I always seem to figure it out a minute after posting).

You must set your options BEFORE calling SaveBegin().

There is, however, a different weird side effect now.  I save the file and see just keyed bones in the new scene, but none of the hierarchy of the bones is maintained:

root
   big_bone
      little_bone

becomes

root
big_bone
little_bone

Maybe I’ll figure this out a minute after I hit the “Submit” button.



Replies: 0