Animation: shear left slider #106521
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue