Page 1 of 1

Question about getSubEntity()

Posted: Thu Apr 21, 2005 3:49 pm
by Imperil
Basically I have an entity that is built of many subentities.. this is so that we can turn on/off selected parts of the model that are viewable.

I can use getSubEntity(7) with an integer index to the subEntity perfectly fine and from there I can set the visibility.

My problem comes from getSubEntity(const string &name) and getting the subEntity by name. I am wondering how this works as I checked the mesh.xml file and the sub meshes are not named.

Do I have to name subEntities manually?
Do I have to add a name attribute in the mesh.xml?
If a submesh has a name as I asked above, will a subentity use that name?

Sorry to ask such a basic question, I've just been playing around with this for a couple of days and can't figure out how to call by name such as:

getSubEntity("head") OR getSubEntity("left_leg")

Thanks so much!

Posted: Thu Apr 21, 2005 4:17 pm
by Imperil
Ok I have realized that I do not get the SubMeshNameTable exported with the indexes and names from the Maya exporter I am using.

Does anybody have some XML from a mesh file showing the structure of the SubMeshNameTable? That way I can test it out by manually adding and than hopefully build it into the Maya exporter.

Thanks!

Posted: Thu Apr 21, 2005 9:11 pm
by sinbad
I think you may have got the naming section from bisco's updated Maya exporter, but incase you didn't, here's a c/p from XML converted from my XSI exporter which supports submesh naming:

Code: Select all

...
    </submeshes>
    <submeshnames>
        <submeshname name="head" index="0" />
        <submeshname name="main" index="1" />
        <submeshname name="detail" index="2" />
    </submeshnames>
</mesh>

Posted: Thu Apr 21, 2005 9:16 pm
by Imperil
Amazing thank you so much sinbad :)

I'll have to check with the art team to see if they were using the most updated version of bisco's exporter.. I thought they were but maybe not.

We didn't get the submesh names exported so I'll talk to bisco about this and see if he wants to implement that or if I should try my hand with the MEL API. Currently he exports joint names, etc but no submesh names.. unless of course they didn't use the most recent exporter and they already left work until tomorrow :evil:

I implemented the XML by hand on a test model and works perfect though, so thanks very much!