[linux] maya2egg 2008, 2009, 64 bit, wrapping

A few issues with building maya2egg2008 and maya2egg2009 on linux; some old, some new.

os: kubuntu 9.04 64 bit
maya: maya 2008 x64, maya 2009 x64
panda version: from cvs

makepanda built everything smoothly. The only thing I had to do was ‘hide’ Maya’s libgcc and libstdc++, as before.

Running:

  1. the wrapper doesn’t know to look for 64 bit installs, so it things there’s no Maya installed - it looks for /usr/autodesk/maya2008, but on a 64 bit system the path is /usr/autodesk/maya2008-x64. that’s easily patched, or temporarily fixed by symlinking, so no big deal.

  2. however, I do get the familiar “import site failed” error. I think I know why, it looks like it’s using Darwin search paths. So that should be pretty easy to fix, too…

maya2egg2008 house.mb -o house_2008.egg
'import site' failed; use -v for traceback
ImportError: No module named maya.app.python
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME = /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current
ImportError: No module named site
  Python cannot find site module!
  Python cannot find sys module!
ImportError: No module named maya.app.python
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME = /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current
ImportError: No module named site
  Python cannot find site module!
  Python cannot find sys module!
ImportError: No module named maya
ImportError: No module named maya.cmds
ImportError: No module named maya.utils
ImportError: No module named maya.mel
ImportError: No module named maya.app
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME = /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current
ImportError: No module named site
  Python cannot find site module!
  Search path (sys.path):
    /home2/badzmaru/panda/src/cvs/panda3d/built/bin
    /home2/badzmaru/lib/python

    /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current/lib/python25.zip
    /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current/lib/python2.5/
    /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-linux2
    /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-tk
    /usr/autodesk/maya2008/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload
ImportError: No module named maya.app.startup.batch
  1. running the “-wrapped” executable and setting the paths correctly by hand works, for maya2egg2008:
export MAYA_LOCATION=/usr/autodesk/maya2008-x64
export LD_LIBRARY_PATH=$MAYA_LOCATION/lib
export PYTHONHOME=$MAYA_LOCATION
../src/cvs/panda3d/built/bin/maya2egg2008-wrapped house.mb -o house_2008.egg
  1. but, that fails for maya2egg2009:
export MAYA_LOCATION=/usr/autodesk/maya2009-x64
export PYTHONHOME=$MAYA_LOCATION
export LD_LIBRARY_PATH=$MAYA_LOCATION/lib
../src/cvs/panda3d/built/bin/maya2egg2009-wrapped house.mb -o house_2009.egg

Initializing Maya.
house.mb: (kFailure): Unexpected Internal Failure
:maya:mayaegg(error): Unable to read house.mb
Errors in conversion.

That’s a new error to me, so I’ll investigate it further and see if I can figure out what’s going on.

I just recently found out that starting with Maya 2009, Autodesk will apparently only be supporting 64 bit versions of Linux. Interesting.

Last thought: since the linux maya exporter seems to be such a weird anomaly case in the build process anyway, what would you say to replacing the C++ wrapper for the linux version with just a shell script, similar to what Maya does anyway? It just needs to set the path variables up correctly, it seems, and as a script it’d be easier to edit and customize as needed without having to recompile.

Ah, darn. That’s my mistake, when I fixed the OSX version, I broke the Linux version. Sorry about that - I don’t have a copy of Maya myself to test this.

I think I’ll have time to look at it this week - but it will only be some guessing.
You’ll need to uncomment the line in pandatool/src/mayaprogs/mayaWrapper.cxx that says _putenv(env3); and make it set the correct MAYA_LOCATION path. When adding OSX support to mayaWrapper, I also ran into the exact same problems, but I think in the end it was caused by a bad MAYA_LOCATION.

Here’s a patch, no idea if it will work.
panda3d.cvs.sourceforge.net/view … view=patch

great, thanks. I updated from CVS, rebuilt, works now.

maya2egg2009 still fails, in an interesting way:

maya2egg2009 cloud.mb -o cloud.egg
Initializing Maya.
cloud.mb: (kFailure): Unexpected Internal Failure
:maya:mayaegg(error): Unable to read cloud.mb
Errors in conversion.

But, if you give the full path to the .mb file, it works:

maya2egg2009 /home/ben/panda/exportTest/cloud.mb -o cloud.egg

interesting …