Converting from, well, anything really into egg format

Hi all,

I’m trying to get my legs under me here, and seem to be stuck at step 1. I need to write a graphical simulation of a robotic arm. The kinematics of the robot arm are not known before hand, so building a model of the arm outside the program is not an option here. The most straightforward way to do this is to ingest a kinematic description of the arm and generate, on the fly, a simple scene graph that represents them. In the past, using other graphics engines, I’ve done this with primitive cylinders drawn to represent each link. Since Panda3D doesn’t include primitive graphical objects (?!!) it seems like the way to do this is to generate the a cylinder in a modeling application, export it in a format than can be converted to egg, do the egg conversion, and load the model; then I can attach the right scaling and transformation nodes int he scenegraph to make it represent the various parts of the robotic arm.

I’m finding this to be surprisingly difficult, because I can’t seem to find a format that any of the supplied egg conversion command line utilities can properly ingest, and therefore I can’t even generate a cylinder in an egg file that I can start to play with. To date, I’ve tried the following:

  • used existing, know good but fairly old VRML 1.0 models of a robot arm. vrml2egg chokes with the following error:
Error: Nodes of type Switch do not have fields/eventIn/eventOut named whichChoice
  • used a simple cylinder that a friend made up for me in Maya. Model exported in VRML 1.0, VRML 2.0, OpenFlight, and Maya binary formats. on the VRML 1.0 model, vrml2egg chokes with the same error as above. On the VRML 2.0 model, vrml2egg returns:
Reading cylinder.x3d

Error in cylinder.x3d at line 1:
<?xml version="1.0" encoding="utf-8"?>

Error in cylinder.x3d at line 1:
<?xml version="1.0" encoding="utf-8"?>
Errors in conversion.

The OpenFlight conversion, flt2egg returns:

Reading Cylinder-Y-OpenFlight.flt
Unable to read: unexpected end of file

The Maya converter does not, in fact, appear to exist in my installation. No maya2egg anywhere on my system.

So… then I decided to try a different modeling program. This one is little-known, but one that I actually know and understand (I’m not, and do not intend to become, a graphical modeling expert): ShapeOnYou, a simple app that nevertheless lets me build simple shapes and exports them in a variety of formats including both VRML 1.0 and VRML 2.0.

vrml2egg chokes on the VRML 2.0 export in identical fashion to that described above. However, it (apparently) works on the VRML 1.0 file, producing an egg file with no errors. Great, right?

But. But but but. The egg file doesn’t actually contain any vertex data. It is filled with descriptions such as the following:

      <Group> {
        <Group> {
          <VertexPool> vpool1 {
          }
        }
        <Group> {
          <VertexPool> vpool2 {
          }
        }
        <Group> {
          <VertexPool> vpool3 {
          }
        }
        <Group> {
          <VertexPool> vpool4 {
          }
        }

and so on. Not a single numeric vertex description anywhere. Needless to say, the file loads just fine into pview, but nothing gets rendered.

I’m close to the point of giving up. Is there a secret I’m missing here? Is there a file format the the converters actually work with that I can easily access? e.g. not Maya and hopefully not Blender, both of which require far too steep a learning curve for this to be worthwhile for me. Or is there another way to display a simple geometric primitive that I’m missing?

There are only a few Panda converters that are really reliable, and the Maya converter is one of them. I presume that the vrml converter hasn’t been used in ages. We should investigate why the Maya converter is not present on your system. Where did you get this build of Panda3D from? From the download page? If you compiled it from source, you will have to explicitly compile it with Maya support.

However, if you don’t wish to use the Maya converter, you can also export to the COLLADA format and then use dae2egg. At present, this path does not support animations, although it should in theory export joints just fine.

If that doesn’t work, then I suppose there’s always .x, which seems to work for most people as well.

The install I’m using is the experimental OSX 64 bit one that somebody (you?) posted to the Installation forum a few days ago. It has worked very well except that it does seem to be missing the maya converter.

Unfortunately, my graphics guy’s Maya doesn’t seem to have a Collada export option. Is there a plugin for Maya I should tell him about?

Yeah, I do not own Maya, so I did not build with Maya support. You can use the builds from the downloads page, they do include Maya converters.

There are two choices, I believe, ColladaMaya and OpenCOLLADA.