XSI Exporter problem
- Spiderman
- Gnoblar
- Posts: 11
- Joined: Fri Oct 07, 2005 9:10 am
XSI Exporter problem
Hi,
I have problems when I export a mesh with a skeleton from XSI. If I don't have any animation (the skeleton is ignored) everything works fine, but when I export any animation some of the vertexs don't move in the correct way, making big triangles. All of the vertices are assigned to a minimum of 1 bone and a maximum of 4.
I coulnd't fine the solution in the forums. Any idea? Thank you.
I have problems when I export a mesh with a skeleton from XSI. If I don't have any animation (the skeleton is ignored) everything works fine, but when I export any animation some of the vertexs don't move in the correct way, making big triangles. All of the vertices are assigned to a minimum of 1 bone and a maximum of 4.
I coulnd't fine the solution in the forums. Any idea? Thank you.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
- Spiderman
- Gnoblar
- Posts: 11
- Joined: Fri Oct 07, 2005 9:10 am
Hi again,
You can find the model downloading the zip file from this link.
http://personales.ya.com/spiderman/
Thanks for your help!
You can find the model downloading the zip file from this link.
http://personales.ya.com/spiderman/
Thanks for your help!
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
- Spiderman
- Gnoblar
- Posts: 11
- Joined: Fri Oct 07, 2005 9:10 am
Hello again,
I've been working on the models and I've realized that only the models that don't have clusters (I use clusters to have many materials in one mesh) are working.
When I export a model with clusters, the exporter creates a submesh for each one. I have seen that some vertices (probably those that doesn't work) have strange bone weights. They are assigned four times to the same bone with 0.25% weight for each. Those vertex should have only one bone assignement with 1.0 weight.
As you can see the vertexindex 0 is assigned four times to the bone 38. I think the four first lines should be only one line:
Probably, the vertex 0 is not really assigned to the bone 38, but the exporter can't find it's bone and make this mistake. I'm pretty sure about that, because those vertex are a part of the arm and should be assigned only to the arm bones (16 and 17).
Have anybody tried to export a model with different clusters? Does anybody had this problem?
I've been working on the models and I've realized that only the models that don't have clusters (I use clusters to have many materials in one mesh) are working.
When I export a model with clusters, the exporter creates a submesh for each one. I have seen that some vertices (probably those that doesn't work) have strange bone weights. They are assigned four times to the same bone with 0.25% weight for each. Those vertex should have only one bone assignement with 1.0 weight.
Code: Select all
<vertexboneassignment vertexindex="0" boneindex="38" weight="0.25" />
<vertexboneassignment vertexindex="0" boneindex="38" weight="0.25" />
<vertexboneassignment vertexindex="0" boneindex="38" weight="0.25" />
<vertexboneassignment vertexindex="0" boneindex="38" weight="0.25" />
<vertexboneassignment vertexindex="1" boneindex="16" weight="1" />
<vertexboneassignment vertexindex="2" boneindex="17" weight="1" />
<vertexboneassignment vertexindex="3" boneindex="16" weight="0.9" />
<vertexboneassignment vertexindex="3" boneindex="17" weight="0.1" />
<vertexboneassignment vertexindex="4" boneindex="16" weight="1" />
...
Code: Select all
<vertexboneassignment vertexindex="0" boneindex="38" weight="1" />Have anybody tried to export a model with different clusters? Does anybody had this problem?
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Aha, thanks for the tip. I definitely intend to look at this tomorrow, but it certainly sounds like you're onto something.
I have tested clusters before but I can't remember if I ever used them with animated models - I'm generally reliant on other people's models for testing animations since I'm such a poor artist
I think what's happened there is that the re-normalisation process performed to deal with > 4 bone assignments per vertex has kicked in incorrectly.
Thanks again for elaborating, this really saves me time when looking into this and is very appreciated
I have tested clusters before but I can't remember if I ever used them with animated models - I'm generally reliant on other people's models for testing animations since I'm such a poor artist
I think what's happened there is that the re-normalisation process performed to deal with > 4 bone assignments per vertex has kicked in incorrectly.
Thanks again for elaborating, this really saves me time when looking into this and is very appreciated
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
Ok, it's fixed. Just give anonymous a few hours to sync and the code update will be in the ogrenew/Tools/XSIExport area.
Unfortunately it wasn't anything like what I thought it was. Basically what I have to do is for each cluster, grab the envelope and from the deformer/weights pair, remap the indexes used back to original geometry (XSI uses a pretty complex set of re-indexing lists which get very confusing sometimes). It seems that the envelope can be shared across multiple clusters and in this case some of the vertices may in fact be in other clusters, and given that the exporter also merges clusters / XSI meshes with the same material for efficiency the whole reindexing thing got terribly out of hand.
Anyway, after several hours of hair-pulling I figured out that something I assumed should always return a match, may safely not return one, and that the fix was in fact quite simple
Ignoring it and skipping the vertex ends up picking the vertex up properly in another cluster and it all works fine, with your model and all my other tests. What was happening before was that in release mode my assert was not kicking in (obviously) and the code just crashed on accessing incorrect data and stuffing rubbish into the assignments (which subsequently got normalised out and thus doesn't look as bonkers as it would have done if that hadn't happened).
Enjoy
Unfortunately it wasn't anything like what I thought it was. Basically what I have to do is for each cluster, grab the envelope and from the deformer/weights pair, remap the indexes used back to original geometry (XSI uses a pretty complex set of re-indexing lists which get very confusing sometimes). It seems that the envelope can be shared across multiple clusters and in this case some of the vertices may in fact be in other clusters, and given that the exporter also merges clusters / XSI meshes with the same material for efficiency the whole reindexing thing got terribly out of hand.
Anyway, after several hours of hair-pulling I figured out that something I assumed should always return a match, may safely not return one, and that the fix was in fact quite simple
Enjoy
- Spiderman
- Gnoblar
- Posts: 11
- Joined: Fri Oct 07, 2005 9:10 am
Hallo again,
It's great that you could fix the problem. Thank you!
But I've found another problem (I'm sorry
).
I had found this error message many times importing the models.

The ogre log always finished without giving an error. This is an example of the end of the file
I have been trying to find the problem and I think that it comes from the materials. When I create an object with many materials I use one for each cluster. But then the base scene_material is not assigned to any triangle. If I delete it or I change it for one of the materials that I use in one of the clusters it works, but if not, the scene_material have no triangles assigned and I get the error message. By now I just make sure that all the materials have at least one polygon assigned, but it's easy to forget it, and then you have to export all the scene again.
I have uploaded an scene with this problem:
http://personales.ya.com/spiderman/
I hope it will help you to improve this great and useful tool. Thank you for everything!!!
It's great that you could fix the problem. Thank you!
But I've found another problem (I'm sorry
I had found this error message many times importing the models.

The ogre log always finished without giving an error. This is an example of the end of the file
Code: Select all
09:43:30: Parsing scripts for resource group General
09:43:30: Parsing script Dojo.material
09:43:30: Parsing script golden.material
09:43:30: Parsing script materialProblems.material
09:43:30: Finished parsing scripts for resource group General
09:43:31: Win32Input8: DirectInput Activation Starts
09:43:31: Win32Input8: Establishing keyboard input.
09:43:31: Win32Input8: Keyboard input established.
09:43:31: Win32Input8: Initializing mouse input in immediate mode.
09:43:31: Win32Input8: Mouse input in immediate mode initialized.
09:43:31: Win32Input8: DirectInput OK.
09:43:31: Texture: spot_shadow_fade.png: Loading 1 faces(PF_B8G8R8,128x128x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
09:43:40: Mesh: Loading C:\Src\Animation\Data\materialProblems.mesh.
I have uploaded an scene with this problem:
http://personales.ya.com/spiderman/
I hope it will help you to improve this great and useful tool. Thank you for everything!!!
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact: