Blender V5.0
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
19struct AnimData;
20struct FCurve;
21
22namespace blender::animrig {
23
33 std::optional<PropertyType> prop_type;
34 std::optional<PropertySubType> prop_subtype;
35 std::optional<blender::StringRefNull> channel_group;
36};
37
38/* This is used to pass in the settings for a keyframe into a function. */
44
51KeyframeSettings get_keyframe_settings(bool from_userprefs);
52
58const FCurve *fcurve_find(Span<const FCurve *> fcurves, const FCurveDescriptor &fcurve_descriptor);
59FCurve *fcurve_find(Span<FCurve *> fcurves, const FCurveDescriptor &fcurve_descriptor);
60
68FCurve *create_fcurve_for_channel(const FCurveDescriptor &fcurve_descriptor);
69
74
76void initialize_bezt(BezTriple *beztr,
77 float2 position,
78 const KeyframeSettings &settings,
79 eFCurve_Flags fcu_flags);
80
91bool fcurve_delete_keyframe_at_time(FCurve *fcurve, float time);
92
104bool delete_keyframe_fcurve_legacy(AnimData *adt, FCurve *fcu, float cfra);
105
121
138 const float2 position,
139 const KeyframeSettings &settings,
141
147 const FCurve *fcu, float start_frame, float sample_rate, float *samples, int sample_count);
148
149enum class BakeCurveRemove {
150 NONE = 0,
153 ALL = 3,
154};
155
161void bake_fcurve(FCurve *fcu, blender::int2 range, float step, BakeCurveRemove remove_existing);
162
168
176bool fcurve_frame_has_keyframe(const FCurve *fcu, float frame);
177
178} // namespace blender::animrig
Functions to insert, delete or modify keyframes.
#define IN_RANGE(a, b, c)
eInsertKeyFlags
eFCurve_Flags
eBezTriple_Handle
eBezTriple_Interpolation
eBezTriple_KeyframeType
PropertyType
Definition RNA_types.hh:161
@ NONE
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)
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)
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)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
std::optional< blender::StringRefNull > channel_group
std::optional< PropertySubType > prop_subtype
std::optional< PropertyType > prop_type
eBezTriple_Interpolation interpolation
eBezTriple_KeyframeType keyframe_type
uint8_t flag
Definition wm_window.cc:145