mayapath.cxx needs to be changed for OSX.
Need to do this in an #ifdef
// Look for OpenMaya.dll as a sanity check.
/*
Filename openMaya = Filename::dso_filename(Filename(maya_location, "bin/OpenMaya.so"));
if (!openMaya.is_regular_file()) {
cerr << "Could not find $MAYA_LOCATION/bin/" << Filename(openMaya.get_basename()).to_os_specific() << "!\n";
exit(1);
}
*/
Filename openMaya = Filename::dso_filename(Filename(maya_location, "MacOS/libOpenMayaAnim.dylib"));
if (!openMaya.is_regular_file()) {
cerr << "Could not find $MAYA_LOCATION/MacOS/" << Filename(openMaya.get_basename()).to_os_specific() << "!\n";
exit(1);
}
Then I had to change this environment variable
DYLD_LIBRARY_PATH=/usr/local/panda/lib:/Applications/Autodesk/maya2008/Maya.app/Contents/MacOS/
However, now I get this error:
$ maya2egg
MAYA_LOCATION: /Applications/Autodesk/maya2008/Maya.app/Contents
dyld: Symbol not found: __ZTV12MFnAnimCurve
Referenced from: /usr/local/panda/lib/libmayabase.dylib
Expected in: dynamic lookup
Trace/BPT trap
It looks like it’s not liking in libOpenMayaAnim.dylib
I confirmed this using with:
otool -L /usr/local/panda/lib/libmayabase.dylib
Which showed it not being linked in.
So I had to link it in manually.
cd src/maya/
/Applications/Autodesk/maya2008/devkit/bin/mayald -undefined dynamic_lookup -dynamic -dynamiclib -o Opt3-OSX/libmayabase.dylib -install_name libmayabase.dylib Opt3-OSX/mayabase_config_maya.o Opt3-OSX/mayabase_mayaApi.o Opt3-OSX/mayabase_mayaShader.o Opt3-OSX/mayabase_mayaShaderColorDef.o Opt3-OSX/mayabase_mayaShaders.o Opt3-OSX/mayabase_maya_funcs.o -L../converter/Opt3-OSX -L../pandatoolbase/Opt3-OSX -L/usr/local/panda/lib -L/usr/local/panda/lib -L/usr/local/panda/lib -L/usr/lib/python2.5 -L/Applications/Autodesk/maya2008/devkit//lib -lconverter -lpandatoolbase -lputil -lexpress -ldtoolutil -ldtoolbase -lprc -ldconfig -lpipeline -linterrogatedb -lOpenMayaAnim -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/
How would I add this in the Config.pp?
This seems similar to a windows problem it has not including the OpenMayaAnim.
After all that… it seems to run!
$ maya2egg
MAYA_LOCATION: /Applications/Autodesk/maya2008/Maya.app/Contents
You must specify the Maya file to read on the command line.
Usage:
maya2egg [opts] input.mb output.egg
maya2egg [opts] -o output.egg input.mb
maya2egg [opts] input.mb >output.egg