Animation: shear left slider #106521

Closed
AresDeveaux wants to merge 9 commits from AresDeveaux/blender:shear_left_slider into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 4 additions and 5 deletions
Showing only changes of commit 7f9b1d33e7 - Show all commits

View File

@ -505,16 +505,13 @@ void shear_left_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float
return;
}
/* The factor goes from 0 to 1, but for this tool it needs to go from -1 to 1. */
const float long_factor = factor * 2 - 1;
for (int i = segment->start_index; i < segment->start_index + segment->length; i++) {
/* For easy calculation of the curve, the values are normalized. */
const float normalized_x = (fcu->bezt[i].vec[1][0] - left_key->vec[1][0]) / key_x_range;
const float lineal = key_y_range * normalized_x;
const float key_y_value = fcu->bezt[i].vec[1][1] + lineal * long_factor;
const float key_y_value = fcu->bezt[i].vec[1][1] + lineal * factor;
move_key(&fcu->bezt[i], key_y_value);
}
}

View File

@ -1134,6 +1134,8 @@ static int shear_left_invoke(bContext *C, wmOperator *op, const wmEvent *event)
gso->modal_update = shear_left_modal_update;
gso->factor_prop = RNA_struct_find_property(op->ptr, "factor");
shear_left_draw_status_header(C, gso);
ED_slider_is_bidirectional_set(gso->slider, true);
ED_slider_factor_set(gso->slider, 0.0f);
return invoke_result;
}
@ -1177,7 +1179,7 @@ void GRAPH_OT_shear_left(wmOperatorType *ot)
RNA_def_float_factor(ot->srna,
"factor",
0.5f,
0.0f,
-FLT_MAX,
FLT_MAX,
"Curve Bend",