This is more a bug report with its workaround than anything else. But this one seems serious enough for me to bring it here. On MotionBuilder 2012 -> 2013 (and on the current PR release), if you attempt to query an animation layer from the current take, an FBBox object will be returned.
But on new scenes (yet to be saved), FBAnimationLayer objects will be returned for the two default animation layers. But for any new layer you add, only FBBox objects will be returned for those. If you then save the scene file, reopen it, FBBox objects are return for ALL of the animation layers. You'll get this issue whenever you try to iterate through the FBScene::Components object list property, or use the FBFindObjectByFullName() method.
To workaround that problem till the issue is fixed, you can instead use the FBAnimationLayer object like this:
from pyfbsdk import * FBApplication().FileNew() lTake = FBSystem().Scene.Take[0] lTake.CreateNewLayer() lTake.CreateNewLayer() for i in range (0, lTake.GetLayerCount()): print lTake.GetLayer(i) FBApplication().FileSave(r"myscene.fbx") FBApplication().FileNew() FBApplication().FileOpen(r"myscene.fbx") lTake = FBSystem().Scene.Take[0] for i in range (0, lTake.GetLayerCount()): print lTake.GetLayer(i)
Comments
You can follow this conversation by subscribing to the comment feed for this post.