[Bf-blender-cvs] [1f78e860703] blender2.8: Fix modifier operators not working from Python API as before.

Brecht Van Lommel noreply at git.blender.org
Tue Aug 14 13:26:03 CEST 2018


Commit: 1f78e8607033f64d2c9633517d3b921c61ff431c
Author: Brecht Van Lommel
Date:   Tue Aug 14 12:39:52 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB1f78e8607033f64d2c9633517d3b921c61ff431c

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.

===================================================================

M	source/blender/editors/object/object_modifier.c

===================================================================

diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index dcc2ce63a83..d16ba47b464 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -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;



More information about the Bf-blender-cvs mailing list