Blender V5.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
19namespace blender {
20
21struct AnimData;
22struct FCurve;
23
24namespace animrig {
25
35 std::optional<PropertyType> prop_type;
36 std::optional<PropertySubType> prop_subtype;
37 std::optional<StringRefNull> channel_group;
38};
39
46
53KeyframeSettings get_keyframe_settings(bool from_userprefs);
54
60const FCurve *fcurve_find(Span<const FCurve *> fcurves, const FCurveDescriptor &fcurve_descriptor);
61FCurve *fcurve_find(Span<FCurve *> fcurves, const FCurveDescriptor &fcurve_descriptor);
62
70FCurve *create_fcurve_for_channel(const FCurveDescriptor &fcurve_descriptor);
71
76
78void initialize_bezt(BezTriple *beztr,
80 const KeyframeSettings &settings,
81 eFCurve_Flags fcu_flags);
82
93bool fcurve_delete_keyframe_at_time(FCurve *fcurve, float time);
94
106bool delete_keyframe_fcurve_legacy(AnimData *adt, FCurve *fcu, float cfra);
107
122int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag);
123
139 const float2 position,
140 const KeyframeSettings &settings,
141 eInsertKeyFlags flag);
142
148 const FCurve *fcu, float start_frame, float sample_rate, float *samples, int sample_count);
149
150enum class BakeCurveRemove {
151 NONE = 0,
154 ALL = 3,
155};
156
162void bake_fcurve(FCurve *fcu, int2 range, float step, BakeCurveRemove remove_existing);
163
169
177bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame);
178
179} // namespace animrig
180} // namespace blender
Functions to insert, delete or modify keyframes.
#define IN_RANGE(a, b, c)
#define position
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
KeyframeSettings get_keyframe_settings(bool from_userprefs)
bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame)
eFCurve_Flags fcurve_flags_for_property_type(PropertyType prop_type)
FCurve * create_fcurve_for_channel(const FCurveDescriptor &fcurve_descriptor)
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)
bool fcurve_delete_keyframe_at_time(FCurve *fcurve, float time)
void bake_fcurve(FCurve *fcu, int2 range, float step, BakeCurveRemove remove_existing)
SingleKeyingResult insert_vert_fcurve(FCurve *fcu, const float2 position, const KeyframeSettings &settings, eInsertKeyFlags flag)
Main Key-framing API call.
const FCurve * fcurve_find(Span< const FCurve * > fcurves, const FCurveDescriptor &fcurve_descriptor)
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)
BMesh Iterators.
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
std::optional< StringRefNull > channel_group
std::optional< PropertySubType > prop_subtype
std::optional< PropertyType > prop_type
eBezTriple_Interpolation interpolation
eBezTriple_KeyframeType keyframe_type