UserMade ObjectTypes

Hi!
I try to give my models in Maya some Special Material attributes which I can use in the Physik Engine. I can export them from an maya model into an egg format. But how can I get it in my Programcode? I cant find the command to extract them…

example:

Ball {
{ 1 }
{ Material1 }
{ Sound3 }

i dunno how to do that in maya.but in blender and in the egg file itself you can add “tags”. which sounds like the thing you are looking for.
maybe you can find something in the maya-exporter documentation. if not, i’m sure someone else on the forum knows more about it than me.

I already added Tags in my Maya Model and i also exported them into the egg - Format. But I didnt find how to extract this information from my model in the game code.

Are you talking about the ObjectType values “Material1” and “Sound3”? These ObjectTypes get turned into any arbitrary egg syntax that you specify. For instance, you can add the following into your Config.prc file:

egg-object-type-Material1 <tag> material { 1 }
egg-object-type-Sounds3 <tag> sound { 3 }

which adds the syntax " material { 1 }" into the egg file wherever it says “ObjectType < Material1 >”. This syntax means to tag the node with the “material” keyword, value “1”. (And similarly for “sound” keyword, value “3”.)

Then, at runtime, you can extract these codes with:

ball = model.find('**/Ball')
material = ball.getTag('material')
sound = ball.getTag('sound')

David

Kind of…
In Maya I can add Extra Attrubutes to my models, by a script. There are some predefined Values that work fine. I tried to add some other Values. I Export my maya Model to an egg-file and get this:

...
<Group>Ball{
<Model>{1}
<ObjectType>{Material1}
<ObjectType>{Sound3}
...

I tried what you said and it returns

:egg2pg(error) : Unknown ObjectType Material1
:egg2pg(error) : Unknown ObjectType Sound3

Now Its working… be careful lower case only in egg-syntax

thx for the fast help