i hava created a animated character in maya, and everything is ok in maya, so i export the charater to ogre's .mesh, .skeleton and .material files. but when i open these files using the OgreCEGuiMeshViewer(1.0.6p1), i got a a very strange scence. the scenes is below
There are a few things you could do to try and catch your error. Look at the XML's files for some clue on whats wrong, also, try to export other models, check your model geometry and look at the ogre log... I had no problems like this and it sure looks strange enough to be the exporter error or bug.
I seem to be having the same problem with Maya 7/1.0.6 exporter/1.0.6 viewer.. has anyone any input on this topic?
As a programmer, I am not a Maya-guru so while I have gotten this far, my understanding of what in the model would cause this is limited. I really don't want to drive my artists crazy so if anyone has already tackled this issue, help would be much appreciated.
While I cannot just post a link to this diver maya source because it is company property, if any individual would like to look at it I will glady turn it over for inspection. PM or post a reply.
*Any* input on this would be unbelievably helpful. Thanks in advance.
It looks like a problem with wrong skin weight values. We did experienced such result with wrongly converted models.
This problem can be due to several reasons but the most probable is that the model was modified within Maya (i.e. adding or removing vertices) after being skinned. This can result in totally incoherent numbers not adding to 1 as it should be. Check the values in the xml file to see if it the case.
If you can't manage to trace the problem, I can have a look at your file, as I'm using the same Maya and Ogre versions. Send me a PM for my email address.
Hi,
have a look in the mesh.xml (if you don't have the original xml file, you can use the OgreXMLconverter to recreate it from the binary .mesh).
You should see a list of "boneassignments" on the bottom of the file looking like :
<vertexboneassignment vertexindex="0" boneindex="1" weight="0.3"/>
<vertexboneassignment vertexindex="0" boneindex="2" weight="0.5"/>
<vertexboneassignment vertexindex="0" boneindex="3" weight="0.2"/>
the numbers I'm taking about are the last ones : for a given vertex the weight should add to 1 or you may have unpredictable results ...
After your last response I wrote a quick app in C# to parse the mesh and spotlight any vertex ids whose weights do not add up to 1.0.
Upon seeing the results, I have two further questions, if you don't mind. I apologize if the answers are obvious.
1. Was there any signifigance to you using three boneassignments for a vertexindex? Or can this be assigned to <> 3 times?
2. Is there a such thing as good enough when summing the weights? Everything that was spotlighted was .9999 or .9998 - are these off enough to cause the distortions or do these assignments need to be reworked?
Again thanks for you help - I think I almost have a handle on this.
1. Was there any signifigance to you using three boneassignments for a vertexindex? Or can this be assigned to <> 3 times?
It can be assigned more than 3 times but you may encounter problem when using more than 4 influencing bones per vertex with some graphic card using hardware acceleration.
2. Is there a such thing as good enough when summing the weights? Everything that was spotlighted was .9999 or .9998 - are these off enough to cause the distortions or do these assignments need to be reworked?
It should be okay with values a bit under 1 in most of the cases.
I had the problem recently with Maya returning such values, and we had a bug in 1 specific machine using a Geforce. Be sure to check the model in more than 1 machine (if possible testing Nvidia & ATI GPU)
Value of more than 1 is definitly a cause of problem.
I got it to work!!! I have to say I feel pretty dumb (as I always do when these things finally start working). It was simply one check box that needed to be turned on on the exporter. It is the very last check box under the Mesh section. It is called "reorgnaize vertex buffers". I had tried to turn that on before but I must have had some other error to screw it up then.
FYI : I'm using Maya 7.0 with the exporter from 6th March 2006 (don't know exactly which version number it is) and did export several models with skeletons without any problem ...
Looking at your screenshot I would advise to check on the xml of the animation that the "scale" values of the bone animations are corrects (meaning No scale).
Guyb.
PS : I just realized : is your model placed like seen on the first screenshot as the neutral pose ? Because it looks like you exported the neutral pose with the skeleton being already modified (meaning with joints rotated), when the neutral pose should be a static one with the joints rotation at 0, 0, 0 , or you may end up adding rotation values value to misplaced joints. You follow ... ?
Not necesseraly a T pose but the "bind pose" (which you select in the Maya Ogre exporter in the menu "animation") at the time of the export should correspond to the original mesh, (as it it before skinning) placed on a skeleton where joints are at 0 in rotation :
For example, if you exported your mesh like it is a the first screenshot, the vertices coordinates exported will correspond to the positions they have at the time, the same for the joints positions. But if you exported the .mesh in a different pose and try to apply animation, of course you'll have very strange results.
I now keep the bind pose as a T pose at frame -1 in maya, and select this frame as "frame for neutral pose" in the exporter, and so I don't have such problem
guy_iti, thanks for all you replys , i have set the "frame for neutral pose" to be the "skin bind pose", but the animation still be strange,i have no idea , and very very depressed.
can i email my maya file to you? so you can help me to find what is the error come from?
if you have time to help me ,please tell me you email address,i email my humanoid.ma file to you.
Hey sorry for the late reply....
Try the new exporter, you'll have to use the new version of OGRE though.... ( at least I believe so, since the mesh format has changed with the new version of the engine )
Tell me if you keep having troubles with the new exporter
thanks for the new exporter, I'll try as soon as I check the programers are using the latest version ...
FYI : wxpy2001's problem above had nothing to do with the exporter but with the model and skeleton being in a totally different pose (original skeleton all bended as you see above, with an original mesh as T pose .. ).
guy_iti and bisco , thanks .the problem have been sloved with help of guy_iti, the error came from " model and skeleton being in a totally different pose ".
so now i could export the skeleton animation very well .
bisco, thank you very much for the exportor.
guy_iti ,thank you very much for help me modify the humoid maya model