Fix modifier operators not working from Python API as before.

The poll function required the modifier to be in the context, but these
operators also accept a "modifier" string property as well.
This commit is contained in:
2018-08-14 12:39:52 +02:00
parent 5e696fdcd6
commit 1f78e86070

View File

@@ -827,11 +827,6 @@ bool edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_fla
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type);
Object *ob = (ptr.id.data) ? ptr.id.data : ED_object_active_context(C);
if (!ptr.data) {
CTX_wm_operator_poll_msg_set(C, "Context missing 'modifier'");
return 0;
}
if (!ob || ID_IS_LINKED(ob)) return 0;
if (obtype_flag && ((1 << ob->type) & obtype_flag) == 0) return 0;
if (ptr.id.data && ID_IS_LINKED(ptr.id.data)) return 0;