maya2egg28 not found - trying to export with mel script

Hello,

I’m having difficulty getting any successful egg export from Maya. We have Autodesk Maya 2008.

When we use the MayaPandaTool.mel script, it says it successfully runs, but upon looking at the console, we see that really it can’t find “maya2egg28.exe” and run it. What is the 28 for? Shouldn’t it just be “8”?

When running the maya2egg.exe directly, we get that it can’t find the registry key.

When running the _wrapped version, it can never find the source .mb file no matter where it is.

Any ideas?

Thanks

I’m not sure if the maya2egg’s included in 1.4.2 have support for 2008. I know Disney or CMU uses Maya though so there might be a version for 2008 already compiled, try asking Josh Yelon or dwrw if there is.

As for the mel script exporter, the 28 is an effect of how the arguments are built in the script. Easy enough to work around but you have to know which maya2egg works with your version of maya. Open up the .mel script and search for:

global proc string argsBuilder()
{
	string $args = "maya2egg";

	//get the version of maya and append it to the maya2egg call
	string $mayaVersionLong = `getApplicationVersionAsFloat`;
	string $mayaVersionShort = substituteAllString($mayaVersionLong, ".", "");
	string $mayaVersionShort = substituteAllString($mayaVersionShort, "0", "");

	$args += $mayaVersionShort;

	$args += " ";

after the lines that start with “string” insert:

if ($mayaVersionShort == 28)
	{
		$mayaVersionShort = <insert_maya2egg_ver_number_here>
	}

Probably best to save it to another .mel file

I think he’s right - to get maya 2008 support, you need the latest daily build.

Also, the ‘MayaPandaTool.mel’ script must be getting confused because maya changed its version numbering system. It should be trying to run ‘maya2egg2008’, not ‘maya2egg28’. I’m guessing the problem has to do with the fact that in the past, maya version numbers were 2 digits, not 4.

If I were you, I’d use ‘maya2egg’ directly. Don’t use MayaPandaTool.

Ok great, thanks for the info.

I’ll try looking at the latest automated build and see if it has 2008 maya support in it…

Im just getting started with Panda and saw this problem as well. Not sure if i got a ‘daily build’ but I found an automated build at panda3d.org/download.php?version=2008.02.12.

To test things out i went into maya 2008; made a NURBS sphere, and added the phong shader to it, and colored it blue. Saved it as a .mb file then proceeded to the conversion.

When i ran the maya2egg2008 in cmd prompt, i get a large number of errors (being new to python, not sure how to debug them :frowning: ) hoping someone could help me out.


(put … in file path has my full name in it)

C:\Documents and Settings…\Desktop\parabellum>maya2egg2008 ball.mb
ball.egg

Initializing Maya.
‘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 not set!
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 not set!
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 not set!
ImportError: No module named site
Python cannot find site module!
Search path (sys.path):
C:\Program Files\Autodesk\Maya2008\scripts\fur
C:\Panda3D-2008.02.12\bin\python25.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
C:\Panda3D-2008.02.12\bin
ImportError: No module named maya.app.startup.batch
:maya(warning): This program was compiled using Maya version 2008.0, but
you are now running it with Maya version 2008. The program may crash or
produce incorrect results.

Writing /c/Documents and Settings/…/Desktop/parabellum/ball.egg

Then i look into the egg file it made

{ Y-Up }

{
“maya2egg2008 ball.mb ball.egg”
}
groundPlane_transform {
}
nurbsSphere1 {
}


After this i went through the steps outlined in the manual to use the script converter inside of Maya itself - it tells me that it finished the export, but no file will exist in the path i direct it to.

I am guessing this is somehow related to my paths set up within python - Thanks in advance for helping me out, really excited to get a project rolling inside of Panda3d! (without the panda being the only animation that is :laughing: )

*edit - I did have a problem in the past with two versions of python being installed, but i think i resolved it. It is possible that they could be related?

It sure does seem like a Maya configuration issue. It’s complaining about not being able to load any of Maya’s python files.

The thing is, this should be completely unrelated to Panda’s python files. The program maya2egg doesn’t use any python. So any python loading going on in there is entirely due to Maya.

Maybe somehow the version of python that ships with Panda is getting in the way of the version that Maya uses?

David

Hmm perhaps - Im gonna try it out on my PC in a bit. Well see what happens :slight_smile:.

Thanks for your response, hopefully we can figure this one out.

I have bad news, then some good news, then some bad news.

Bad news number one: Maya contains an entire python distribution, which has been customized to maya’s needs. Unfortunately, when you load maya, it uses some not-very-smart method to find the python distribution. At the slightest provocation, it will find the wrong python distribution, which screws everything up.

When I say “slightest provocation,” I mean merely the act of putting a copy of python24.dll somewhere in your path can screw things up. That’s all it takes. I believe that setting PYTHONPATH will do it too.

Using maya2egg counts as “loading maya.”

I don’t know of any workaround for this.

Now the good news: after failing to load python, maya still works fine. So does maya2egg. I see that flood of error messages every time I try to export something, and it’s annoying as heck, but the egg files still come out fine.

Now for bad news number two: obviously, your egg file is empty. So something didn’t work right. But I’m guessing it has nothing to do with python. David: can maya2egg handle nurbs?

Try creating a polygon mesh instead of nurbs, and see what happens.

maya2egg does normally handle nurbs without difficulty. It can either leave the nurbs intact, or automatically triangulate, according to command-line options (I forget which is the default behavior). It’s true that it’s been a while since I’ve tested it with nurbs, though, so it’s possible that support has been broken recently.

David

Did it with a polygon sphere and the same shader. Exact same error - so it must be the pythons fighting each other :angry:. Haven’t had a chance to try it on my desktop just yet. Will try to do it with the script see if something pops out.

Well, I’ll test it tomorrow when I get to work and see how it does for me.

I thought I could get access to a copy of Maya 2008, but I was wrong. I just can’t test it.

I’m afraid that until Carnegie-Mellon purchases a copy of Maya 2008, the support is going to be pretty thin. And I’m not sure they’re even planning to buy a copy - I think they buy every other version.

Allrighty - Well i found myself a copy of maya 8.5 (bye bye 200$, but oh well). After installing - i did the same process of making a nurbs sphere putting a phong shader (green this time :slight_smile: ). I thought i would start with the command line editor (made sure uninstall the new version of panda first), and now i got this slew of errors

C:\Documents and Settings\...\Desktop\parabellum>maya2egg85  ball.mb
ball3.egg

Initializing Maya.
'import site' failed; use -v for traceback
ImportError: No module named maya.app.python
ImportError: No module named maya.app.python
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
ImportError: No module named maya.app.startup.batch
Writing /c/Documents and Settings/.../Desktop/parabellum/ball3.egg

Poking around on the forum, i saw a prior post - and it seemed to be attributed to conflicting version of maya - (sounds like a case that could work here) - but i made sure to purge my system of maya 2008 (documentation and all) before. Also - i made sure to delete all of the old scenes created im maya 08 before i started this one (envisioning possible problems).

Either way - then i went to Maya itself and put in the script for the conversion process - Export actually seems to take some time now - but when i go and stare at the .egg file it spits out - still looks like an empty egg file.

<CoordinateSystem> { Y-Up }

<Comment> {
  "maya2egg85 -a model -o 'C:/Documents and Settings/.../My Documents/maya/projects/default/scenes/ball3.egg' 'C:/Documents and Settings/.../My Documents/maya/projects/default/scenes/ball3_temp.mb'"
}
<Group> ball3_temp {
  <Dart> { 1 }
  <Group> groundPlane_transform {
  }
  <Group> nurbsSphere1 {
  }
}

Im gonna try to do an Egg to maya or something on the panda then see if i can convert it back - perhaps im doing something wrong with maya itself.

Thanks for your help guys - really want to get this working.

I have maya 8.5, I can assure you that the exporter for that does work.

The slew of errors is the same one I was talking about before: maya’s python getting confused. Same result: a slew of errors, but the export still works.

In the latest automated build, there is an mb file in the normal mapping sample program. See what happens if you run maya2egg with that.

Allrighty - I wonder what i am doing wrong in my little ball creation.

I did the script inside of maya for the abstractroom.mb - and it looks like it actually exported it (heres a snippet)

<CoordinateSystem> { Y-Up }

<Comment> {
  "maya2egg85 -a model -o C:/Panda3D-2008.02.28/samples/Normal-Mapping/models/s.egg C:/Panda3D-2008.02.28/samples/Normal-Mapping/models/abstractroom_temp.mb"
}
<Texture> phong3SG {
  layingrock-c.jpg
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }
}
<Texture> phong2SG {
  brick-c.jpg
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }
}
<Texture> phong1SG {
  fieldstone-c.jpg
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> minfilter { linear_mipmap_linear }
  <Scalar> magfilter { linear }
}
<Group> abstractroom_temp {
  <Dart> { 1 }
  <Group> groundPlane_transform {
  }
  <Group> polySurface2 {
    <VertexPool> polySurfaceShape2.verts {
      <Vertex> 0 {
        5 10 -45
        <UV> { 1.5 0.166667 }
        <Normal> { 0 0.707107 -0.707107 }
        <RGBA> { 1 1 1 1 }
      }
      <Vertex> 1 {
        25 30 -25
        <UV> { 0.5 1.5 }
        <Normal> { 0 0.707107 -0.707107 }
        <RGBA> { 1 1 1 1 }
      }
      <Vertex> 2 {
        45 10 -45
        <UV> { -0.5 0.166667 }
        <Normal> { 0 0.707107 -0.707107 }
        <RGBA> { 1 1 1 1 }
      }
      <Vertex> 3 {
        5 10 -5
        <UV> { -0.5 0.166667 }
        <Normal> { -0.707107 0.707107 0 }
        <RGBA> { 1 1 1 1 }

      }

So i think it works… (having written my own obj loader id prolly arrange things like this)

Being a noob at Maya - any ideas what im doing wrong to simply make a model? Ive been making a NURBS sphere, setting smoothness to 3, then using hypershader to apply a blue colored phong shader to it and then exporting… (perhaps the maya 2008 may work if im doing something wrong)

The books i bought to teach me maya, dont really address exporting and stuff, or things you need to do to make sure it will export, :frowning: hopefully i can figure it out :slight_smile:

Thanks alot for your help - I really do appreciate it.

“Smoothness”? Is this Maya’s way of saying the order of the NURBS?

NURBS with order other than 4, while not technically nonstandard, are a bit unusual. I’m pretty sure the Panda tools support them, but I wouldn’t be completely surprised if maya2egg choked on it.

You might try passing the -p parameter to maya2egg to force polygon conversion. You might also try explicitly converting it to triangles within Maya.

David

hehe Excuse my noobness, when i say ‘smoothness’ i mean when you select an object then hit 1, 2, or 3, to adjust the quality (smoothness) of the selection

*edit - Allrighty - If i don’t use NURBS, it exports fine, the second i use any NURBS stuff, export will spit out an empty egg file. Both the command line exporter - and the script in maya, both work. Dont need to use -p to get it to work. Also, when i used -p on the NURBS object, it didnt work, blank egg file.

*edit#2 - if i make a nurbs object, i can just convert it and its no big deal. So problem solved - but may want to look into why nurbs breaks it.

drwr wrote: “The program maya2egg doesn’t use any python.”

here is what I get when I try to run it. I have Maya 2008, Panda 2008.03.04 and Python 2.5 (testcube.mb is just a maya polygon cube)

X:\My Documents\My 3D\Panda>maya2egg2008.exe testcube.mb box.egg

Initializing Maya.
ImportError: No module named maya.app.python
Invalid Python Environment: Python is unable to find Maya's Python modules
Python Evironment:
  PYTHONHOME not set!
  System modules located at: C:\Python25\Lib
  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 not set!
  System modules located at: .
  Python cannot find sys module!
ImportError

As explained earlier that is the fault of how Maya searches for Python. Instead of using its own Python install where the Maya modules reside it is using whatever Python installation it can find, in your case the base 2.5 installation.

Not sure if the fix has been covered, but I suppose you could try looking under Maya’s python install for the Maya modules and creating a .pth file in your 2.5 Lib\site-packages folder.

I was trying to get it working as well and getting the same error. I tried a bunch of stuff and couldnt get it to convert for 2008, so i found a copy of 8.5. If you havent, try using the script that exports from inside maya itself(maybe it will work :slight_smile: ).