Panda3d, OSX, maya2009 and egg building.

Hello everyone, I’m struggling to get assets from maya2009 on a mac, into the egg format. I would love advice from anyone who has done this successfully, without being a rocket surgeon.

I downloaded Panda3d a couple of days ago and started to play. I use a bit of python in may daily work, (in the form of Maya and Houdini) writing lots of little tools to make my life easier, and I guess I naively thought that I could easily jump into a bit of game dev with Panda3d.

Everything was up and running fairly quickly - the latest sdk 1.7 from the downloads page, a bit of python trickery to get t working against the 2.5 build from Apple - and I was away. I ran through the tuts and got some samples running and was fairly impressed. So I immediately wanted to get my own assets into a scene. This has been a nightmare :\

So far as I can see, my best bet is to learn Blender 2.49 and use the exporter there. And while I’d entertain that idea for models, I don’t want to learn all the animation and rigging stuff in here too.

I would like to use Maya, but the maya2egg2009 scripts on the mac are giving me missing ‘site’ modules for a start, and if I use the wrapper version I am missing a bunch of dylibs. I tried copying them from my maya directory but that seemed like a never ending chase for files. Plus I was only guessing at what I had to do.

SO far as I can see from searches, I may have to build my own version from source … but argh. I’m so far out of my depth with this stuff. I tired. Failed. I can probably get it after many many hours, but it’s all getting too hard.

I just want to take simple models from Maya2009, and put them, and maybe textures, into an Egg. On a mac. Am I missing something, or is this level of knowledge what is needed to get it up and running?

I would really appreciate any help.
Thanks!
Campbell.

Maybe I was hasty, and the main build is not the best one. I have since run the latest snapshot build and that has fixed some lib issues I was having with punzip, similar errors to what I was having with the maya2egg2009.

SO I though I should try this out again, but I now only have maya2egg2010 programs in my Development/Tools/ folder. This wont run as it can tell that I don not have 2010 installed on this computer. Is there a way around this?

Thanks.
Campbell.

No takers?
Are there many people out there using Maya on OSX, to get data into Panda3d?

Apparently not. :frowning:

I’ve seen another thread by a similarly frustrated Mac user. I’d love to get Maya working on a Mac for everyone. We’ll need to get copies of the Maya libraries for Mac for all relevant versions of Maya. I’m not sure which versions we already have; from what you say it sounds like it’s just 2010 at the moment.

David

My mistake. I simply didn’t copy the Maya2009 SDK to the right directory for the buildbot.

I’ve just fixed that, and issued a rebuild for the OSX SDK. Could you try the latest build?

Thanks David and rdb, I am downloading the new snapshot and I’ll have a play this evening.

I know it can be annoying and hard to track all the different versions of Maya, on different platforms, so I started thinking about writing an new exporter. One that was completely in python, in Maya. That way you shouldn’t need to recompile it with each new version.

So I started reading through the egg syntax page, and I have a basic version working quite well already. Simply dumping out several txt files, and combining them into an egg. I’m currently working through translating the geo properly, but it looks promising so far. Though I imagine the animation support will become a lot trickier for me. It may be a bit slower to process the files, but it might mean more people pick it up quicker.

All going well, I’ll post my progress in a couple of days. It should be fairly cross platform; I’ll be able to test it on maya2009 OSX, and several linux versions too. I don’t have access to windows.

Okay thanks, the new snapshot has the maya2egg2009.
But when I run it, I get No module site errors:

> /Developer/Tools/Panda3D/maya2egg2009 -o toPanda.egg fromMaya.mb 

Initializing Maya.
ImportError: No module named site

Any ideas?

Try clearing your PYTHONPATH and any other python-specific environment variables before running it. Maybe something in Panda’s python configuration is getting confused with Maya’s python configuration.

David

Thanks David.

I’m not all over this PYTHONPATH stuff, and I have things a bit confusing here on OSX. I have at least 3 versions of python running: the apple one, maya’s one, and 2.7 which I maybe installed a few months back. I think there is a 2.6 from Houdini in here too.

Everything seems to run on their own fine, like the panda one, and the mayapy one. But I think this maya2egg script is trying to get my maya to run the 2.7 one instead.

I added the site path to my PYTHON path in .bash_profile, but I need to work out how to get the other maya modules in there. But is it odd how it seems to be trying to run maya with 2.7?
Campbell

@capraMambica,

let me know if you’d like some help working on an alternate maya egger. the two problems with the current system seem to be frequent conflicts between python versions and sometimes other libraries that come from having to link all of panda with all of maya and autodesk’s excessive release schedule. so I’m up for working on this if you want to pursue it, for sure.

Hey Benchang, thanks for you interest.
I got a good way through writing some stuff last week, but it became clear that I needed to step into the API to get exactly what I’m after. It’s a bit of a learning curve for me, but I’m getting there. Give me a couple more days, and I’ll hopefully have something running :slight_smile: But I’d appreciate any help I can get.

Running the latest snapshot build for osx, and I think I have my PYTHONPATH correct. I can import those modules fine from the shell (2.5.4 which I think is the apple one). Maya and Panda3d seem to be working fine with python, but when I run the maya2egg script it seems to get all confused:

/Developer/Tools/Panda3D/maya2egg2009 -o output.egg testBox.mb 

Initializing Maya.
ImportError: No module named maya.app.python
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME = /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current
  System modules located at: /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
  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 = /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current
  System modules located at: /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
  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 = /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current
  System modules located at: /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
  Search path (sys.path):
    /Developer/Tools/Panda3D
    /python
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
    /Developer/Panda3D/lib
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python26.zip
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/plat-darwin
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/plat-mac
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/plat-mac/lib-scriptpackages
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/Extras/lib/python
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-tk
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-old
    /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.6/lib-dynload
ImportError: No module named maya.app.startup.batch
testBox.mb: (kFailure): Unexpected Internal Failure
:maya:mayaegg(error): Unable to read testBox.mb
Errors in conversion.

I’m not sure how it is even calling 2.6, which looks like what it’s trying to do. Any clues? Thanks!

Can you get into a Python shell where importing Maya does work (maybe Maya has an interactive Python console?) and print out sys.path ?

Yep, if I run ‘mayapy’ from the shell, I get Maya’s interactive python shell thing. From there I can ‘import maya’ happily. I can also ‘import maya’ from the regular python shell, and naturally from within Maya as well.

Can you print out sys.path from there, then?

from mayapy in the shell:

Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
...
/python
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
/Developer/Panda3D/lib
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python25.zip
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-darwin
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac/lib-scriptpackages
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-tk
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages
>>> 

from ppython (the one I use for panda):

Python 2.5.4 (r254:67916, Feb 11 2010, 15:47:06) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
... 
/python
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
/Developer/Panda3D/lib
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python25.zip
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-darwin
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac/lib-scriptpackages
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/Extras/lib/python
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-tk
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages
>>> 

And finally from inside maya itself:

/Applications/Autodesk/maya2009/Maya.app/Contents/MacOS
/python
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5
/Developer/Panda3D/lib
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python25.zip
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-darwin
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/plat-mac/lib-scriptpackages
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-tk
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/lib-dynload
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages
/users/campbell/Library/Preferences/Autodesk/maya/2009/prefs/scripts
/users/campbell/Library/Preferences/Autodesk/maya/2009/scripts
/users/campbell/Library/Preferences/Autodesk/maya/scripts

They all look similar, and in all I can import the panda3d modules. mayapy in the shell, and the python interpreter that runs within the Maya GUI, run 2.5.1.

OK, can you try three things for me?

>>> import maya
>>> print maya.__file__

And also:

$ export PYTHONPATH=
$ /Developer/Tools/Panda3D/maya2egg2009 -o output.egg testBox.mb 

Does the latter command give the same result as before, or does it not include the python2.6 stuff this time?

And also:

$ readlink /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current

Sure thing.

Python 2.5.4 (r254:67916, Feb 11 2010, 15:47:06) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import maya
>>> print maya.__file__
/Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python2.5/site-packages/maya/__init__.pyc
>>> 
readlink /Applications/Autodesk/maya2009/Maya.app/Contents/Frameworks/Python.framework/Versions/Current
2.5

And I did the ‘export PYTHONPATH=’, but it gave the same result. With all the 2.6 stuff.

Thanks for your help so far :slight_smile:

Wow, I’m really baffled. I have no idea where the 2.6 stuff is coming from.

Yea, it makes no sense to me either. It seems to only be in the instance where the maya2egg2009 is called. Thanks for trying :slight_smile: