Fix addon stk mercuy crash

Please avoid using 2nd uv layer on animated mesh
This commit is contained in:
Benau 2017-01-11 14:29:37 +08:00
parent ffedf637de
commit 40fe84ddbd
2 changed files with 11 additions and 1 deletions

View File

@ -254,7 +254,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
Vertices_SkinnedMesh.push_back(Vertex);
}
}
if (VertexType==video::EVT_TANGENTS)
else if (VertexType==video::EVT_TANGENTS)
{
for(u32 n=0;n<Vertices_Tangents.size();++n)
{

View File

@ -338,6 +338,16 @@ void STKAnimatedMesh::resetSkinningState(scene::IAnimatedMesh* mesh)
{
if (!CVS->supportsHardwareSkinning()) return;
m_skinning_offset = -1;
m_skinned_mesh = NULL;
if (mesh == NULL) return;
for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i)
{
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
if (!mb)
continue;
if (mb->getVertexType() == video::EVT_2TCOORDS)
return;
}
setHardwareSkinning(true);
if (m_skinned_mesh)
m_skinned_mesh->convertForSkinning();