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:
parent
df3116b326
commit
3aedb3aed7
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue