diff options
author | Luca Rood <dev@lucarood.com> | 2017-03-01 23:56:10 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-03-01 23:56:10 +0300 |
commit | 856077618a9dfe33a6fb25c86effdfd2b3098419 (patch) | |
tree | 57a5c57aa978302ba24850ec2174012d1bfa2a75 /source/blender/editors/object/object_modifier.c | |
parent | 193827e59bd45f9e5818551cf605e9645c78e14c (diff) |
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)
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 9 |
1 files changed, 1 insertions, 8 deletions
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) |