Hi,
I’m trying to write an ascii file out of MotionBuilder 2016 without any luck. The below code works just fine in MotionBuilder 2014. But when I execute it in MoBu 2016, It gives me binary. Anyone know any tricks to get MoBu 2016 to write ascii?
Much Thanks!
from pyfbsdk import *
import os
import tempfile
# Create a cube
lCube = FBModelCube( 'MyCubeWillNotBeSaved' )
lCube.Show = True
# Create and select a plane
lPlane = FBModelPlane( 'MyPlaneWillBeSaved' )
lPlane.Show = True
lPlane.Selected = True
lOptions = FBFbxOptions(False)
# Save only the selected models, in ASCII format so we can have a look at the file.
lOptions.SaveSelectedModelsOnly = True
lOptions.UseASCIIFormat = True
# Not saving system information; only focus on the selected models.
lOptions.BaseCameras = False
lOptions.CameraSwitcherSettings = False
lOptions.CurrentCameraSettings = False
lOptions.GlobalLightingSettings = False
lOptions.TransportSettings = False
# Save the selected models to file.
lFilePath = os.path.join( tempfile.gettempdir(), "SaveSelected.fbx" )
if FBApplication().FileSave(lFilePath, lOptions):
print "File successfully saved to %s" % lFilePath
else:
print "Failed to save file: %s" % lFilePath
[QUOTE=tonthebone;29040]Hi,
I’m trying to write an ascii file out of MotionBuilder 2016 without any luck. The below code works just fine in MotionBuilder 2014. But when I execute it in MoBu 2016, It gives me binary. Anyone know any tricks to get MoBu 2016 to write ascii?
Much Thanks!
from pyfbsdk import *
import os
import tempfile
# Create a cube
lCube = FBModelCube( 'MyCubeWillNotBeSaved' )
lCube.Show = True
# Create and select a plane
lPlane = FBModelPlane( 'MyPlaneWillBeSaved' )
lPlane.Show = True
lPlane.Selected = True
lOptions = FBFbxOptions(False)
# Save only the selected models, in ASCII format so we can have a look at the file.
lOptions.SaveSelectedModelsOnly = True
lOptions.UseASCIIFormat = True
# Not saving system information; only focus on the selected models.
lOptions.BaseCameras = False
lOptions.CameraSwitcherSettings = False
lOptions.CurrentCameraSettings = False
lOptions.GlobalLightingSettings = False
lOptions.TransportSettings = False
# Save the selected models to file.
lFilePath = os.path.join( tempfile.gettempdir(), "SaveSelected.fbx" )
if FBApplication().FileSave(lFilePath, lOptions):
print "File successfully saved to %s" % lFilePath
else:
print "Failed to save file: %s" % lFilePath
[/QUOTE]
*** Replying to my own post.
I heard back from Autodesk and this is a known issue. They are sending me a patch but I assume that fix will show up in a subsequent service pack.