Fix bug reported by kopias on irc, crash when attempting to set canvas

with a non-mesh object selected
This commit is contained in:
Antony Riakiotakis
2014-12-09 14:36:24 +01:00
parent 59f1585d02
commit ebee593f26

View File

@@ -343,9 +343,11 @@ static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA *UN
}
}
GPU_drawobject_free(ob->derivedFinal);
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
if (ob && ob->type == OB_MESH) {
GPU_drawobject_free(ob->derivedFinal);
BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL);
WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL);
}
}
static int rna_ImaPaint_detect_data(ImagePaintSettings *imapaint)