Blender V4.3
ANIM_fcurve.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#include "ANIM_keyframing.hh"
13
15#include "BLI_string_ref.hh"
16
17#include "DNA_anim_types.h"
18
19#include "ANIM_keyframing.hh"
20
21struct AnimData;
22struct FCurve;
23
24namespace blender::animrig {
25
26/* All the information needed to look up or create an FCurve. */
30 std::optional<PropertySubType> prop_subtype;
31 std::optional<blender::StringRefNull> channel_group;
32};
33
34/* This is used to pass in the settings for a keyframe into a function. */
40
47KeyframeSettings get_keyframe_settings(bool from_userprefs);
48
54const FCurve *fcurve_find(Span<const FCurve *> fcurves, FCurveDescriptor fcurve_descriptor);
55FCurve *fcurve_find(Span<FCurve *> fcurves, FCurveDescriptor fcurve_descriptor);
56
65
67void initialize_bezt(BezTriple *beztr,
68 float2 position,
69 const KeyframeSettings &settings,
70 eFCurve_Flags fcu_flags);
71
82bool fcurve_delete_keyframe_at_time(FCurve *fcurve, float time);
83
95bool delete_keyframe_fcurve_legacy(AnimData *adt, FCurve *fcu, float cfra);
96
112
129 const float2 position,
130 const KeyframeSettings &settings,
132
138 const FCurve *fcu, float start_frame, float sample_rate, float *samples, int sample_count);
139
140enum class BakeCurveRemove {
141 NONE = 0,
142 IN_RANGE = 1,
143 OUT_RANGE = 2,
144 ALL = 3,
145};
146
152void bake_fcurve(FCurve *fcu, blender::int2 range, float step, BakeCurveRemove remove_existing);
153
159
160} // namespace blender::animrig
Functions to insert, delete or modify keyframes.
eInsertKeyFlags
eFCurve_Flags
eBezTriple_Handle
eBezTriple_Interpolation
eBezTriple_KeyframeType
KeyframeSettings get_keyframe_settings(bool from_userprefs)
void initialize_bezt(BezTriple *beztr, float2 position, const KeyframeSettings &settings, eFCurve_Flags fcu_flags)
void sample_fcurve_segment(const FCurve *fcu, float start_frame, float sample_rate, float *samples, int sample_count)
const FCurve * fcurve_find(Span< const FCurve * > fcurves, FCurveDescriptor fcurve_descriptor)
bool fcurve_delete_keyframe_at_time(FCurve *fcurve, float time)
SingleKeyingResult insert_vert_fcurve(FCurve *fcu, const float2 position, const KeyframeSettings &settings, eInsertKeyFlags flag)
Main Key-framing API call.
void bake_fcurve(FCurve *fcu, blender::int2 range, float step, BakeCurveRemove remove_existing)
int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag)
Lesser Key-framing API call.
bool delete_keyframe_fcurve_legacy(AnimData *adt, FCurve *fcu, float cfra)
void bake_fcurve_segments(FCurve *fcu)
FCurve * create_fcurve_for_channel(FCurveDescriptor fcurve_descriptor)
std::optional< blender::StringRefNull > channel_group
std::optional< PropertySubType > prop_subtype
eBezTriple_Interpolation interpolation
eBezTriple_KeyframeType keyframe_type
uint8_t flag
Definition wm_window.cc:138