Look at the eggObjectFlags.mel script, which is provided with Panda. This assigns the “eggObjectTypes” (or “eggObjectTypes1”, etc.) node attribute to the string you specified; and the maya2egg converter copies that string into the flag within the egg file.
So you can use any of the pre-defined ObjectType flags, or you can define your own with the egg-object-type syntax in your Config.prc file, e.g. “egg-object-type-myflag { egg syntax }”.
Thanks for the reply, but I was kind of referring to making it such that I add the attribute to the objects in Maya, and when I export it into an egg file, it will have a tag in it.
E.g
I add the XPos attribute with the value 5.00 to the object in Maya.
I then export it into an egg file.
In the egg file, there will be a part in the object:
XPos {5.00}
I don’t believe maya2egg supports the attribute. It only supports .
Thus, you would have to do this by predefining the kinds of tags you might want to enter, e.g. you could add to your Config.prc:
egg-object-type-xpos500 <Tag> XPos {5.00}
And then add “xpos500” to the list of tags offered by eggObjectFlags.mel. Then you can add that tag in Maya with the selection box created by eggObjectFlags.mel.
'cuz basically, what I’m doing is that I’m actually creating a level, and then tagging objects in the level, so that I can replace those objects with panda scripted objects.
HOWEVER, I need to tag values on them as well, mainly their orientation (HPR) and their scale, 'cuz I have no idea how to get their maya scale and orientation from the egg files. So I created a melscript which actually automatically takes their orientations and their scale, and tags it onto them as new attributes.
Any suggestions? And if anyone knows, can someone teach me how to modify the maya2egg file?
The Maya transform, including HPR and scale, will be part of the egg node’s entry. Easy to access directly from the egg file. Reading this transform makes more sense than trying to copy all this data into a set of redundant tags.
If you’re loading an egg file via loader.loadModel(), the easiest way to get the transform is just to put a Maya locator there. It will be translated as a node with the correct HPR and scale already loaded on it.
Thanks! I found it under Create menu, polygon menu set, by the way.
Anywho, I made a locator, parented the cube TO the locator, and played around with the locator.
And it produced a transform, which had the correct translate values. However, that was the only thing it had. It didn’t have the Hpr values or the scale values. Am I doing something wrong?
Hmm, maybe Maya locators don’t preserve rotation and scale.
In that case, your best bet is to create an ordinary node, and tag it with the “DCS” eggObjectType. This tells maya2egg that the transform on the node is important to preserve all the way through the system.
Maya locators do preserve rotation and scales.
But once the transformation is frozen, you can’t reset it for locators.
Or you can use implicitSpheres with which you can reset transformation even after it’s frozen.
The only problem for implicitSpheres are there is no menu to create them in Maya besides using following MEL command:
What I did was create a locator locator1, parent pCube1 to locator1, and then moved, rotated, and scaled locator1 around, and then used the Maya Panda Exporter melscript to export it out into an egg file.
I also tried transforming pCube1 itself, and reparenting the locator1 to pCube1 instead, to no avail.
Could you post section at the top of your egg file, so I can see which maya2egg arguments were used during the conversion?
[EDIT]
It seems like when you select “Actor”, “Both” or “Animation” at the Export Type of Maya Panda Exporter mel UI it will export locator’s position only. So Select “Mesh” or “Pose” there.
… Wait… What does the matrix4 mean again? And how do I interpret it? 'cuz I was just experimenting a while back with actually using constrains to reparent the thing, and I got what you have now as well… I was thinking it had something to do with the angles and the scale…
… I was just about to ask, got confused over the link…
THANK YOU VERY MUCH GYEDO! I appreciate you helping me so much.
And thanks drwr and ynjh_jo!
I’ll just use the search function to get access to the transform bits of each object in the scene, and setMat() to the object that i am using to replace it.
Now, I’ll just take a break, and add this in tomorrow (its 2.05 am over here). The rest I should be able to handle via debugging.