Hi,I am a c++ game programmer,I am new to panda3d. This is my first post ever. I will get straight to the problem. My Mesh is loading properly from 3ds Max complete with animation and everything however parts of the character like the eyeballs,shoes,patch of hair,boxing gloves are being left behind on animation.What i want to do is find these individual pieces of geometry and transpose them wrt to the main body and make them children nodes.
I am at a loss how to do so. Please help.
Well, you will have to process the egg file with egg-optchar, and use the -flag option to identify the pieces that you need to reparent. This will make these pieces appear as separate nodes that you can then locate in-game with the actor.find(â**/nodenameâ) command (use actor.ls() to list all of the nodes).
By reparent them to the main body, I assume you mean you want them to inherit the animation of the main body (or head, or whatever node you want). To do this, you need to expose the particular joint you want to parent them to, either via actor.exposeJoint() at runtime, or via the -expose option to egg-optchar, and then you can reparent the newly-flagged pieces (above) to this joint.
But it would probably be better just to fix the animation in Max so that it converts correctly; and then you wonât have to deal with any of these issues. I donât know what specifically the problem is, but it shouldnât be too hard to find it. Probably the way these pieces are assigned to the skeleton isnât supported by max2egg, so you should just use a different way to assign them.
David
If you want to fix this in max, then you need to use the skin modyfier to attach all the parts to the bones, and they need to be bones or parts of a biped system, dummies, helpers, geometry, lines donât get exported as joins.
Thanks David and Wezu for the quick reply.
i was fiddling with egg-optchar before posting but i could not get the command to work properly and the program kept crashing at the
âegg-optchar -d outputDir -flag Sphere01=theHead modelFile.egg anim1.egg anim2.eggâ line.
I substituted âoutputDirâ with my directory name that contains the model and instead of âSphere01â i put the geom name from 3ds max and named the proper model and animation file in the required order.
Moreover the Actor.ls() function doesnât seem to list the names of the Geometry. It displays the follow lines
PandaNode Character
Character __Actor_modelRoot
GeomNode <5 geoms: S:>
How do i get the names of these 5 geometries?
@wezu :the reason i canât combine the the separate geometries together in 3ds max is because then the materials/textures get all messed up. This is because i believe multiple materials/textures are not supported on a single mesh in Panda3d.
P.s: i think you are right i bought this model off the web and i noticed it has helpers to attach these parts to the skeleton.
If you tell me the output from egg-optchar, I might be able to provide a clue why itâs crashing. But simply the fact that itâs âcrashingâ gives me nothing to go on.
The output of ls() is correct. That is the geometry under the model. It doesnât have anything interesting yet because you havenât yet flagged anything.
David
You donât need to make it one mesh. Add a skin mod to the gloves and add just one bone to that skin.
If optchar wonât work you can hand edit the egg file. Itâs a bit of work but not that hard. Youâd need to add a name to all the polygons of a mesh, but they all should be in one .