0

I have a Maya scene with and animated character in it. I'm trying to export this animation to an alembic file without opening Maya. For that, i chose to use the Maya Standalone.

The command line that i'm using to export is this:

import maya.standalone
maya.standalone.initialize()
cmds.file('C:\tmp\fred_scene.ma', open=True, force=True)
cmds.AbcExport(jobArg=r'-frameRange 0 30 -stripNamespaces -uvWrite -worldSpace -writeVisibility -wholeFrameGeo -worldSpace -dataFormat ogawa -root fred:geo_fred -file C:\tmp\animated_fred.abc')

If I enter in an interactive session with the mayapy.exe interpreter this works fine.

But i'm trying to use the Maya Standalone from another python interpreter and that isn't working. In this python interpreter i'm doing the following before the previous code to initialize correctly the interpreter:

maya_location = os.path.normpath('C:/Program Files/Autodesk/Maya2018')
python_maya_location = os.path.normpath("C:/Program Files/Autodesk/Maya2018/Python")
maya_bin_location = os.path.normpath('C:/Program Files/Autodesk/Maya2018/bin')

os.environ['MAYA_LOCATION'] = maya_location  # add maya location as a environment variable
os.environ["PYTHONHOME"] = python_maya_location
os.environ["PATH"] = maya_bin_location + ';' + os.environ["PATH"]

# Others
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\setuptools-0.6c9-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\pymel-1.0.0-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\ipython-0.10.1-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\ply-3.3-py2.6.egg")
sys.path.append("C:\Program Files\Autodesk\Maya2018\\bin\python26.zip")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\DLLs")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\plat-win")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\lib-tk")
sys.path.append("C:\Program Files\Autodesk\Maya2018\\bin")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python")
sys.path.append("C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages")

The result in the mayapy.exe is this: Correct Result

And the result in the other python interpreter is this: Incorrect Result

In the two alembic files the animation seems correct but the geometry is broken. Anyone can help me with this problem?

0 Answers0