Animation: Match Slope slider #110567

Merged
Christoph Lendenfeld merged 24 commits from ChrisLend/blender:blend_to_infinity_slider into main 2023-08-17 10:28:56 +02:00
2 changed files with 7 additions and 6 deletions
Showing only changes of commit d0399ba471 - Show all commits

View File

@ -724,7 +724,7 @@ bool blend_to_infinity_fcurve_segment(FCurve *fcu, FCurveSegment *segment, const
const float delta = reference_key->vec[1][1] + new_y_delta - fcu->bezt[i].vec[1][1];
const float key_y_value = fcu->bezt[i].vec[1][1] + delta * fabs(factor);
move_key(&fcu->bezt[i], key_y_value);
BKE_fcurve_keyframe_move_value_with_handles(&fcu->bezt[i], key_y_value);
}
return true;
}

View File

@ -996,7 +996,8 @@ static void blend_to_infinity_graph_keys(bAnimContext *ac, const float factor)
bool all_segments_valid = true;
ANIM_animdata_filter(ac, &anim_data, OPERATOR_DATA_FILTER, ac->data, ac->datatype);
ANIM_animdata_filter(
ac, &anim_data, OPERATOR_DATA_FILTER, ac->data, eAnimCont_Types(ac->datatype));
LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) {
FCurve *fcu = (FCurve *)ale->key_data;
ListBase segments = find_fcurve_segments(fcu);
@ -1048,7 +1049,7 @@ static void blend_to_infinity_draw_status_header(bContext *C, tGraphSliderOp *gs
static void blend_to_infinity_modal_update(bContext *C, wmOperator *op)
{
tGraphSliderOp *gso = op->customdata;
tGraphSliderOp *gso = static_cast<tGraphSliderOp *>(op->customdata);
blend_to_infinity_draw_status_header(C, gso);
@ -1067,12 +1068,12 @@ static int blend_to_infinity_invoke(bContext *C, wmOperator *op, const wmEvent *
return invoke_result;
}
tGraphSliderOp *gso = op->customdata;
tGraphSliderOp *gso = static_cast<tGraphSliderOp *>(op->customdata);
gso->modal_update = blend_to_infinity_modal_update;
gso->factor_prop = RNA_struct_find_property(op->ptr, "factor");
blend_to_infinity_draw_status_header(C, gso);
ED_slider_allow_overshoot_set(gso->slider, false);
ED_slider_is_bidirectional_set(gso->slider, true);
ED_slider_allow_overshoot_set(gso->slider, false, false);
ED_slider_factor_bounds_set(gso->slider, -1, 1);
ED_slider_factor_set(gso->slider, 0.0f);
return invoke_result;