Fix T47170: Sculpt w/ constructive modifier crash

Regression in 4d33c37c9

Only copy normal arrays from sculpt to the DerivedMesh when the mesh is deformed.

Constructive modifiers calculate their own normals.
This commit is contained in:
Campbell Barton
2016-01-14 10:04:24 +11:00
parent 30971199ac
commit 3e0f117ef5

View File

@@ -343,6 +343,11 @@ static void cdDM_update_normals_from_pbvh(DerivedMesh *dm)
CDDerivedMesh *cddm = (CDDerivedMesh *) dm;
float (*face_nors)[3];
/* constructive modifiers handle their own normals */
if (!dm->deformedOnly) {
return;
}
face_nors = CustomData_get_layer(&dm->polyData, CD_NORMAL);
BKE_pbvh_update(cddm->pbvh, PBVH_UpdateNormals, face_nors);