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:
Diffstat (limited to 'source/blender/editors/armature/pose_slide.c')
-rw-r--r--source/blender/editors/armature/pose_slide.c54
1 files changed, 36 insertions, 18 deletions
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 7bc934e07a2..79182a89096 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -459,8 +459,9 @@ static void pose_slide_apply_props(tPoseSlideOp *pso,
FCurve *fcu = (FCurve *)ld->data;
const char *bPtr, *pPtr;
- if (fcu->rna_path == NULL)
+ if (fcu->rna_path == NULL) {
continue;
+ }
/* do we have a match?
* - bPtr is the RNA Path with the standard part chopped off
@@ -1209,8 +1210,9 @@ static int pose_slide_push_invoke(bContext *C, wmOperator *op, const wmEvent *ev
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* initialise percentage so that it won't pop on first mouse move */
pose_slide_mouse_update_percentage(pso, op, event);
@@ -1229,8 +1231,9 @@ static int pose_slide_push_exec(bContext *C, wmOperator *op)
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* do common exec work */
return pose_slide_exec_common(C, op, pso);
@@ -1269,8 +1272,9 @@ static int pose_slide_relax_invoke(bContext *C, wmOperator *op, const wmEvent *e
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* initialise percentage so that it won't pop on first mouse move */
pose_slide_mouse_update_percentage(pso, op, event);
@@ -1289,8 +1293,9 @@ static int pose_slide_relax_exec(bContext *C, wmOperator *op)
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* do common exec work */
return pose_slide_exec_common(C, op, pso);
@@ -1329,8 +1334,9 @@ static int pose_slide_breakdown_invoke(bContext *C, wmOperator *op, const wmEven
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* initialise percentage so that it won't pop on first mouse move */
pose_slide_mouse_update_percentage(pso, op, event);
@@ -1349,8 +1355,9 @@ static int pose_slide_breakdown_exec(bContext *C, wmOperator *op)
pose_slide_exit(op);
return OPERATOR_CANCELLED;
}
- else
+ else {
pso = op->customdata;
+ }
/* do common exec work */
return pose_slide_exec_common(C, op, pso);
@@ -1565,15 +1572,17 @@ static void pose_propagate_fcurve(
short first = 1;
/* skip if no keyframes to edit */
- if ((fcu->bezt == NULL) || (fcu->totvert < 2))
+ if ((fcu->bezt == NULL) || (fcu->totvert < 2)) {
return;
+ }
/* find the reference value from bones directly, which means that the user
* doesn't need to firstly keyframe the pose (though this doesn't mean that
* they can't either)
*/
- if (!pose_propagate_get_refVal(ob, fcu, &refVal))
+ if (!pose_propagate_get_refVal(ob, fcu, &refVal)) {
return;
+ }
/* find the first keyframe to start propagating from
* - if there's a keyframe on the current frame, we probably want to save this value there too
@@ -1585,10 +1594,12 @@ static void pose_propagate_fcurve(
if (mode != POSE_PROPAGATE_SELECTED_KEYS) {
match = binarysearch_bezt_index(fcu->bezt, startFrame, fcu->totvert, &keyExists);
- if (fcu->bezt[match].vec[1][0] < startFrame)
+ if (fcu->bezt[match].vec[1][0] < startFrame) {
i = match + 1;
- else
+ }
+ else {
i = match;
+ }
}
else {
/* selected - start from first keyframe */
@@ -1599,18 +1610,21 @@ static void pose_propagate_fcurve(
/* additional termination conditions based on the operator 'mode' property go here... */
if (ELEM(mode, POSE_PROPAGATE_BEFORE_FRAME, POSE_PROPAGATE_SMART_HOLDS)) {
/* stop if keyframe is outside the accepted range */
- if (bezt->vec[1][0] > modeData.end_frame)
+ if (bezt->vec[1][0] > modeData.end_frame) {
break;
+ }
}
else if (mode == POSE_PROPAGATE_NEXT_KEY) {
/* stop after the first keyframe has been processed */
- if (first == 0)
+ if (first == 0) {
break;
+ }
}
else if (mode == POSE_PROPAGATE_LAST_KEY) {
/* only affect this frame if it will be the last one */
- if (i != (fcu->totvert - 1))
+ if (i != (fcu->totvert - 1)) {
continue;
+ }
}
else if (mode == POSE_PROPAGATE_SELECTED_MARKERS) {
/* only allow if there's a marker on this frame */
@@ -1618,18 +1632,21 @@ static void pose_propagate_fcurve(
/* stop on matching marker if there is one */
for (ce = modeData.sel_markers.first; ce; ce = ce->next) {
- if (ce->cfra == round_fl_to_int(bezt->vec[1][0]))
+ if (ce->cfra == round_fl_to_int(bezt->vec[1][0])) {
break;
+ }
}
/* skip this keyframe if no marker */
- if (ce == NULL)
+ if (ce == NULL) {
continue;
+ }
}
else if (mode == POSE_PROPAGATE_SELECTED_KEYS) {
/* only allow if this keyframe is already selected - skip otherwise */
- if (BEZT_ISSEL_ANY(bezt) == 0)
+ if (BEZT_ISSEL_ANY(bezt) == 0) {
continue;
+ }
}
/* just flatten handles, since values will now be the same either side... */
@@ -1698,8 +1715,9 @@ static int pose_propagate_exec(bContext *C, wmOperator *op)
/* free temp data */
poseAnim_mapping_free(&pflinks);
- if (mode == POSE_PROPAGATE_SELECTED_MARKERS)
+ if (mode == POSE_PROPAGATE_SELECTED_MARKERS) {
BLI_freelistN(&modeData.sel_markers);
+ }
/* updates + notifiers */
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {