Workaround for crash drawing face-maps after undo

This commit is contained in:
Campbell Barton 2017-07-26 05:10:20 +10:00
parent 2b1cd24c6e
commit 8c3ecc9651
1 changed files with 5 additions and 0 deletions

View File

@ -9809,6 +9809,11 @@ void ED_draw_object_facemap(const bContext *C, Scene *scene, Object *ob, const f
if (ob->type != OB_MESH || !ob->data)
return;
/* Temporary, happens on undo, would resolve but will eventually move away from DM. */
if (ob->derivedFinal == NULL) {
return;
}
dm = mesh_get_derived_final(&eval_ctx, scene, ob, CD_MASK_BAREMESH);
if (!dm || !CustomData_has_layer(&dm->polyData, CD_FACEMAP))
return;