I am trying to debug an exporter application that I am working on. It looks like the vertex bone assignments are exporting -- but when I try to convert the binary file back to .xml, I don't see them. Is there some reason why the .xml file would not have them, but the .mesh would?
Here is the code where I'm setting the bone assignments.
for (int h = 0; h < env->GetVertexWeightCount(); ++h)
{
VertexBoneAssignment vertAssign;
vertAssign.boneIndex = boneIdx;
vertAssign.vertexIndex = (int) wtList[h].m_fVertexIndex;
vertAssign.weight = (Real) wtList[h].m_fWeight;
sm->addBoneAssignment(vertAssign);
}
Getting a .mesh file size of 75K without the bone assignments, and approximately 112K with.... but the .xml files coming from the xml converter are identical... no vertex assignments. Is there anything else I need to give Ogre other than running the 'addBoneAssignment' function to tell it that I have bone assignments?
Haven't got to serializing the .skeleton yet... but I'd like to get one piece working at a time.
Thanks in advance for anyone's help.
Vertex Bone Assignments in Ogre
-
utgames
- Gnoblar
- Posts: 19
- Joined: Thu Feb 24, 2005 7:05 pm
- Location: Austin, Texas
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
-
utgames
- Gnoblar
- Posts: 19
- Joined: Thu Feb 24, 2005 7:05 pm
- Location: Austin, Texas
Vertex Bone Assignments
Thanks sinbad for replying to my message.
I was able to get the assignments to serialize with the mesh. It turns out that I had neglected to run the "setSkeletonName" function.
Yes, I am using dedicated submesh geometry. Nothing shared.
However... and there is always a however in any programming work... my mesh crashes when I try to load it. It causes a failed assertion.
I am thinking -- it must be because when I created those additional vertices to account for multiple normals at a vertex, I have to also make additional vertex bone assignments for those additional vertices? Presumably copying over the same assignment and weights as the collocated original vertex?
Sorry if that sounds confusing. But say for example I had 300 vertices before expanding all the normals -- and I had 411 afterward. Then I should have 411 vertex bone assignments? Or do I just need the 300?
Thanks so much in advance for anyone's help.
I was able to get the assignments to serialize with the mesh. It turns out that I had neglected to run the "setSkeletonName" function.
Yes, I am using dedicated submesh geometry. Nothing shared.
However... and there is always a however in any programming work... my mesh crashes when I try to load it. It causes a failed assertion.
I am thinking -- it must be because when I created those additional vertices to account for multiple normals at a vertex, I have to also make additional vertex bone assignments for those additional vertices? Presumably copying over the same assignment and weights as the collocated original vertex?
Sorry if that sounds confusing. But say for example I had 300 vertices before expanding all the normals -- and I had 411 afterward. Then I should have 411 vertex bone assignments? Or do I just need the 300?
Thanks so much in advance for anyone's help.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Re: Vertex Bone Assignments
Sounds perfectly normal, and yes you do need 411 vertex bone assignments, not 300; copying the assignments when you copy everything else is indeed the way to do it.utgames wrote: I am thinking -- it must be because when I created those additional vertices to account for multiple normals at a vertex, I have to also make additional vertex bone assignments for those additional vertices? Presumably copying over the same assignment and weights as the collocated original vertex?
Sorry if that sounds confusing. But say for example I had 300 vertices before expanding all the normals -- and I had 411 afterward. Then I should have 411 vertex bone assignments? Or do I just need the 300?