griusfux / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Crash on animated meshes with multiple materials #293

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. replace logo_text.blend in GuiDemo with attached file
2. run app
3. crash

This is caused by the fact that the multiple material causes the mesh to be 
broken down into multiple submeshes and Ogre assumes that each submesh for 
meshes with skeletons should have Vertex Elements of VES_BLEND_INDICES and 
VES_BLEND_WEIGHTS (see OgreMesh.cpp line 1625). 

However the submesh for the secondary material ends up not having those vertex 
elements because they are initialized/added to the submesh only when calling 
submesh->addBoneAssignment(vba) which gamekit only calls for submeshes that are 
in specific vertex groups named the same as a bone in the armature of the main 
mesh (see gkOgreMeshLoader.cpp line 248 and below).

The "fix" is to add vertex groups and bones with the same name for each submesh 
using a different material. I'm not sure what the best way to properly fix this 
would be, I'm thinking Ogre should skip trying to perform animation blending on 
submeshes not having a BoneAssignment.

Original issue reported on code.google.com by vek...@gmail.com on 30 Dec 2012 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@googlemail.com on 2 Jan 2013 at 4:09