collision+ maya+ panda

can anyone tell me how to made collision object in maya that can read by panda3D?

This is actually described in the Panda3D manual. See the “Converting from Maya” page, about halfway down, “Flagging objects from Maya”.

David

the object need to set as rigid body in maya? or anything need done in maya before export using flag?

Do you need your collision solids to be attached to an animated rig? That’s a more difficult problem, but in general, yes–you need to make the object a rigid body, and then you have to run the resulting egg file through egg-optchar with the “-dart structured” flag (or hand-edit the egg file to change the dart tag to “structured”), in order to support loading animated collision polygons.

But if all you want is static collision geometry, then you don’t need to deal with that; just make sure you use the “-a none” flag to maya2egg so that the model is not animated.

David

i am doing a maze game now.
but my maze do not have collision.
my hero, is an animated model.
is it i need to do collision at maze and hero?
or just the wall of maze?
in order to prevent the hero penetrate the wall.

You need to mark the walls of your maze as static collision walls, and then export your maze with the “-a none” option.

Your hero will not have collisions built into the model. You can add a collision sphere around the model using Python code.

There are examples of this sort of thing in the manual, in the sample programs, and in the forums.

David

@kc, if you mean Maya’s rigid body dynamics by ‘rigid body’ you don’t need to set them as the rigid body.

Maya Dynamic’s collision feature has nothing with Panda’s collision feature.

Just add right flag to the object in Maya then collision node will be added during conversion.

i try the manual Flag …but it shows error
“// Error: Cannot find procedure “eggObjectFlag””
i am so sorry. i really first time doing 3D game…
maybe i ask stupid question…
but i cant figure out the solution.
anyone?

that error means you didn’t load the mel script eggObjectFlags. Did you get the script and load/execute it in the script editor?

the script means?
panda3d.cvs.sourceforge.net/*che … tFlags.mel
this one?
or?

Yes, that one.

what i done is like this:

i copy the script as in the link,
and i run the script.
after that i try create a box and press mel icon at shelf.
but the error still the same…
is anything wrong?

As you can read, the definition line is :

global proc eggObjectFlags()

sorry…i need update my post…
now…it can find the mel script.
but another problem arise,
the model export into .egg still do not have collision.
is there anything that i might be done wrong?
is it need to modify the mel code?

sorry if i ask stupid question…^^

How did you do it ?
What flag did you set ?
How do you know there is no collision ? Do you inspect the .egg ?
Have you set the collision mask by code ?

sorry…can anyone teach me how to do collision mask?

the flag…i just copy the mel n export model to .egg?
ya…i got compare the code with sample code.
my code just have vertex and polygon…
sorry, can anyone teach me?
it is also welcome anyone wish teach me to add my msn at christina5463@hotmail.com
i really appreciate your help

Hmm, have you set any flag at all ?

After that procedure is executed, you have to set the flag to the available ones, otherwise it’s set to NONE.
Node’s extra attributes is located in the attribute editor, under object’s tab.

It’s not your fault if it’s hard to find, it’s the script’s fault, because after adding the extra attribute, it doesn’t open that node’s attributes tab.
To fix it, insert this line after every “addAttr …” lines :

showEditorExact $i;

sorry ya…
how come there is no extra attribute for my object?
i am using maya2009…
or is it need to add the line in script before the extra attribute appear?

Once you have loaded/executed that script, then select your object and execute eggObjectFlag() in the script editor then new attribute will be added to your object.

yeah~~
new attribute is loaded…
is it i set all to barrier? then export in?
-a none?
-a model?