Anim: Graph Editor Push/Pull operator #112388

Merged
Christoph Lendenfeld merged 8 commits from ChrisLend/blender:ge_push_pull into main 2023-09-21 12:46:34 +02:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit c95d2fe379 - Show all commits

View File

@ -903,8 +903,7 @@ void push_pull_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const float f
const float delta = fcu->bezt[i].vec[1][1] - linear;
/* The factor is multiplied by 2 just to increase the effect. */
const float key_y_value = linear + delta * factor * 2;
const float key_y_value = linear + delta * factor;
BKE_fcurve_keyframe_move_value_with_handles(&fcu->bezt[i], key_y_value);
}
}

View File

@ -2109,6 +2109,8 @@ static int push_pull_invoke(bContext *C, wmOperator *op, const wmEvent *event)
tGraphSliderOp *gso = static_cast<tGraphSliderOp *>(op->customdata);
gso->modal_update = push_pull_modal_update;
gso->factor_prop = RNA_struct_find_property(op->ptr, "factor");
ED_slider_factor_bounds_set(gso->slider, 0, 2);
ED_slider_factor_set(gso->slider, 1);
common_draw_status_header(C, gso, "Push Pull Keys");
return invoke_result;
@ -2151,12 +2153,12 @@ void GRAPH_OT_push_pull(wmOperatorType *ot)
RNA_def_float_factor(ot->srna,
"factor",
0.5f,
1.0f,
-FLT_MAX,
FLT_MAX,
"Factor",
"Control how far to push or pull the keys",
0.0f,
1.0f);
2.0f);
}
/** \} */