Fix for [#21822] Unusual material slot behaviour, edit v object mode, cascade, SVN 27833

* Disabled removing material slots in edit mode and added back error message from 2.49.
This commit is contained in:
2010-10-15 08:11:26 +00:00
parent bb11d6337e
commit 4cfecdd06a

View File

@@ -289,6 +289,12 @@ static int material_slot_remove_exec(bContext *C, wmOperator *UNUSED(op))
if(!ob)
return OPERATOR_CANCELLED;
/* Removing material slots in edit mode screws things up, see bug #21822.*/
if(ob == CTX_data_edit_object(C)) {
BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode.");
return OPERATOR_CANCELLED;
}
object_remove_material_slot(ob);
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
WM_event_add_notifier(C, NC_OBJECT|ND_OB_SHADING, ob);