diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-02-06 07:57:50 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-02-07 03:32:13 +0300 |
commit | 76eac1ae70001f5b2b0fe1d064f260db8509b246 (patch) | |
tree | f1d2e6e63c6602cef09126dbd5628d0e93b7a33e /source/blender/editors/armature | |
parent | 7320df2e61cbf7abd652a7a4790a5e595a8c2a1a (diff) |
Motion Paths: Use custom poll functions for "Update" operator
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 9e8028b6cd8..ad0532bec38 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -262,6 +262,16 @@ void POSE_OT_paths_calculate(wmOperatorType *ot) /* --------- */ +static int pose_update_paths_poll(bContext *C) +{ + if (ED_operator_posemode_exclusive(C)) { + bPoseChannel *pchan = CTX_data_active_pose_bone(C); + return (pchan && pchan->mpath); + } + + return false; +} + static int pose_update_paths_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); @@ -289,7 +299,7 @@ void POSE_OT_paths_update(wmOperatorType *ot) /* api callbakcs */ ot->exec = pose_update_paths_exec; - ot->poll = ED_operator_posemode_exclusive; /* TODO: this should probably check for active bone and/or existing paths */ + ot->poll = pose_update_paths_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |