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:
parent
5e696fdcd6
commit
1f78e86070
Notes:
blender-bot
2023-02-14 19:23:13 +01:00
Referenced by commit 2ee95e91f7
, Remove context check from constraint and shaderfx edit poll
Referenced by issue blender/blender-addons#59921, RuntimeError: bpy.ops.object.gpencil_modifier_apply()
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue