vertex parents to a mesh that no verts would crash blender

This commit is contained in:
Campbell Barton
2008-04-28 17:14:56 +00:00
parent a9ab9f4bde
commit d6400179d2

View File

@@ -1629,9 +1629,12 @@ static void give_parvert(Object *par, int nr, float *vec)
}
}
if(count > 0) {
if (count==0) {
/* keep as 0,0,0 */
} else if(count > 0) {
VecMulf(vec, 1.0f / count);
} else {
/* use first index if its out of range */
dm->getVertCo(dm, 0, vec);
}
}