Fix for invalid custom data checks in armature and lattice functions.

Testing for custom data availability with getVertData and index 0 fails
on assert for empty meshes (the index must be in valid range). Better
use getVertDataArray which has no requirement for specific index.
This commit is contained in:
Lukas Tönne 2014-03-05 15:11:36 +01:00
parent df3116b326
commit 3aedb3aed7
2 changed files with 2 additions and 2 deletions

View File

@ -888,7 +888,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
if (ELEM(target->type, OB_MESH, OB_LATTICE)) {
/* if we have a DerivedMesh, only use dverts if it has them */
if (dm) {
use_dverts = (dm->getVertData(dm, 0, CD_MDEFORMVERT) != NULL);
use_dverts = (dm->getVertDataArray(dm, CD_MDEFORMVERT) != NULL);
}
else if (dverts) {
use_dverts = TRUE;

View File

@ -894,7 +894,7 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
if (target && target->type == OB_MESH) {
/* if there's derived data without deformverts, don't use vgroups */
if (dm) {
use_vgroups = (dm->getVertData(dm, 0, CD_MDEFORMVERT) != NULL);
use_vgroups = (dm->getVertDataArray(dm, CD_MDEFORMVERT) != NULL);
}
else {
Mesh *me = target->data;