From 856077618a9dfe33a6fb25c86effdfd2b3098419 Mon Sep 17 00:00:00 2001 From: Luca Rood Date: Wed, 1 Mar 2017 17:56:10 -0300 Subject: Fix T50830: Wrong context when calling surfacedeform_bind The custom poll function for surfacedeform_bind seems to have caused issues when calling it from Python. Fixed by using the generic modifier poll function, and setting the button to be active or not in the Python UI code instead. (there might be a better way, but for now this works fine) --- source/blender/editors/object/object_modifier.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 38df1116cd3..d601f5c3b14 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -2299,14 +2299,7 @@ void OBJECT_OT_laplaciandeform_bind(wmOperatorType *ot) static int surfacedeform_bind_poll(bContext *C) { - if (edit_modifier_poll_generic(C, &RNA_SurfaceDeformModifier, 0)) { - PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_SurfaceDeformModifier); - SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)ptr.data; - - return ((smd != NULL) && (smd->target != NULL)); - } - - return 0; + return edit_modifier_poll_generic(C, &RNA_SurfaceDeformModifier, 0); } static int surfacedeform_bind_exec(bContext *C, wmOperator *op) -- cgit v1.2.3