Page 1 of 1
XSI Exporter problem
Posted: Wed Oct 26, 2005 4:59 pm
by Spiderman
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.
Posted: Wed Oct 26, 2005 9:03 pm
by sinbad
Please post your model, all the ones I've tried work perfectly.
Posted: Thu Oct 27, 2005 11:06 am
by Spiderman
Hi again,
You can find the model downloading the zip file from this link.
http://personales.ya.com/spiderman/
Thanks for your help!
Posted: Thu Oct 27, 2005 2:07 pm
by sinbad
Ta - give me until the weekend, I may not get time before then.
Posted: Thu Oct 27, 2005 2:59 pm
by Spiderman
Many thanks for your help Sinbad!!! I have exported some more models and I have found the same problem in most of them. Maybe is the way I model or animate in XSI.
Posted: Thu Oct 27, 2005 5:58 pm
by sinbad
Yes, I think it must be something specific you're doing, I've heard of no problems from any other XSI users.
Posted: Fri Oct 28, 2005 12:17 pm
by Spiderman
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.
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" />
...
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:
Code: Select all
<vertexboneassignment vertexindex="0" boneindex="38" weight="1" />
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?
Posted: Fri Oct 28, 2005 2:16 pm
by sinbad
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

Posted: Sat Oct 29, 2005 6:08 pm
by sinbad
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

Posted: Mon Oct 31, 2005 10:12 am
by Spiderman
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
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 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!!!
Posted: Mon Oct 31, 2005 6:19 pm
by sinbad
Hmm, I thought I was only writing out entries for materials that were actually being used, but maybe I missed something. I'll take a look. I'm glad your other problem is fixed anyway.
Posted: Tue Nov 01, 2005 10:08 pm
by sinbad
Ok, this one was much easier, it's fixed

Posted: Wed Nov 02, 2005 8:54 am
by Spiderman
Hi,
I've tested the 'new' exporter and everything worked fine! Tank you very much for your really fast help.