Question about getSubEntity()

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Imperil

Question about getSubEntity()

Post by Imperil » Thu Apr 21, 2005 3:49 pm

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!
0 x

Imperil

Post by Imperil » Thu Apr 21, 2005 4:17 pm

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!
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Post by sinbad » Thu Apr 21, 2005 9:11 pm

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>
0 x

Imperil

Post by Imperil » Thu Apr 21, 2005 9:16 pm

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!
0 x

Post Reply