Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-01 20:27:05 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-02 17:03:39 +0300
commitffaf91b5fc03f91e1fc90bd2f1d5dc5aa75656ff (patch)
treea2751ad82d28c37df483ed9269187e7f7de74d1e /source/blender/editors/armature/pose_slide.c
parent51347be24e474a3ad3d38a75d0060ca91b8a9794 (diff)
Pose slide / relax: fix various issues
* Fix operator adjust settings not working. * Fix modal operator not working when invoked from search menu. * Fix tagging to be correct for new depsgraph. * Fix pose relax doing nothing when start and end frames match even if the current frame value is different. * Remove odd 0.3..0.7 limit in adjust operator settings panel.
Diffstat (limited to 'source/blender/editors/armature/pose_slide.c')
-rw-r--r--source/blender/editors/armature/pose_slide.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index a984691064a..d683c599f7b 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -335,12 +335,6 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, Object *ob, flo
/* next/end */
eVal = evaluate_fcurve(fcu, nextFrameF);
- /* if both values are equal, don't do anything */
- if (IS_EQF(sVal, eVal)) {
- (*val) = sVal;
- return;
- }
-
/* calculate the relative weights of the endpoints */
if (pso->mode == POSESLIDE_BREAKDOWN) {
/* get weights from the percentage control */
@@ -982,35 +976,41 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
case LEFTMOUSE: /* confirm */
case RETKEY:
case PADENTER: {
- /* return to normal cursor and header status */
- ED_area_status_text(pso->sa, NULL);
- WM_cursor_modal_restore(win);
+ if (event->val == KM_PRESS) {
+ /* return to normal cursor and header status */
+ ED_area_status_text(pso->sa, NULL);
+ WM_cursor_modal_restore(win);
- /* insert keyframes as required... */
- pose_slide_autoKeyframe(C, pso);
- pose_slide_exit(op);
+ /* insert keyframes as required... */
+ pose_slide_autoKeyframe(C, pso);
+ pose_slide_exit(op);
- /* done! */
- return OPERATOR_FINISHED;
+ /* done! */
+ return OPERATOR_FINISHED;
+ }
+ break;
}
case ESCKEY: /* cancel */
case RIGHTMOUSE: {
- /* return to normal cursor and header status */
- ED_area_status_text(pso->sa, NULL);
- WM_cursor_modal_restore(win);
+ if (event->val == KM_PRESS) {
+ /* return to normal cursor and header status */
+ ED_area_status_text(pso->sa, NULL);
+ WM_cursor_modal_restore(win);
- /* reset transforms back to original state */
- pose_slide_reset(pso);
+ /* reset transforms back to original state */
+ pose_slide_reset(pso);
- /* depsgraph updates + redraws */
- pose_slide_refresh(C, pso);
+ /* depsgraph updates + redraws */
+ pose_slide_refresh(C, pso);
- /* clean up temp data */
- pose_slide_exit(op);
+ /* clean up temp data */
+ pose_slide_exit(op);
- /* canceled! */
- return OPERATOR_CANCELLED;
+ /* canceled! */
+ return OPERATOR_CANCELLED;
+ }
+ break;
}
/* Percentage Chane... */
@@ -1162,8 +1162,8 @@ static void pose_slide_opdef_properties(wmOperatorType *ot)
1.0f,
"Percentage",
"Weighting factor for which keyframe is favored more",
- 0.3,
- 0.7);
+ 0.0,
+ 1.0);
RNA_def_int(ot->srna,
"prev_frame",
@@ -1254,7 +1254,7 @@ void POSE_OT_push(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -1316,7 +1316,7 @@ void POSE_OT_relax(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -1378,7 +1378,7 @@ void POSE_OT_breakdown(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
/* Properties */
pose_slide_opdef_properties(ot);
@@ -1783,7 +1783,7 @@ void POSE_OT_propagate(wmOperatorType *ot)
ot->poll = ED_operator_posemode; /* XXX: needs selected bones! */
/* flag */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
/* properties */
/* TODO: add "fade out" control for tapering off amount of propagation as time goes by? */