Blendshape export float & same # verts
Previously it was possible that the number of vertices between the mesh and morph mesh varied. This may have caused problems in tools like Blender, and this ensures there's a 1-1 correspondence between vertices. In addition, exporting doubles broke meshlab on import, so now it exports floats.pull/5775/head
parent
4024726eca
commit
b49d30865d
|
@ -1770,12 +1770,11 @@ void FBXExporter::WriteObjects ()
|
|||
indent++;
|
||||
if (pAnimMesh->HasPositions()) {
|
||||
std::vector<int32_t>shape_indices;
|
||||
std::vector<double>pPositionDiff;
|
||||
std::vector<double>pNormalDiff;
|
||||
std::vector<float>pPositionDiff;
|
||||
std::vector<float>pNormalDiff;
|
||||
|
||||
for (unsigned int vt = 0; vt < vertex_indices.size(); ++vt) {
|
||||
aiVector3D pDiff = (pAnimMesh->mVertices[vertex_indices[vt]] - m->mVertices[vertex_indices[vt]]);
|
||||
if(pDiff.Length()>1e-8){
|
||||
shape_indices.push_back(vertex_indices[vt]);
|
||||
pPositionDiff.push_back(pDiff[0]);
|
||||
pPositionDiff.push_back(pDiff[1]);
|
||||
|
@ -1786,7 +1785,10 @@ void FBXExporter::WriteObjects ()
|
|||
pNormalDiff.push_back(nDiff[0]);
|
||||
pNormalDiff.push_back(nDiff[1]);
|
||||
pNormalDiff.push_back(nDiff[2]);
|
||||
}
|
||||
} else {
|
||||
pNormalDiff.push_back(0.0);
|
||||
pNormalDiff.push_back(0.0);
|
||||
pNormalDiff.push_back(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue