Blender V5.3
abc_keyframing.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <functional>
12
13#include <Alembic/Abc/ISampleSelector.h>
14
15#include "BLI_set.hh"
16#include "BLI_vector.hh"
17
18#include "RNA_path.hh"
19
20namespace blender {
21
22namespace animrig {
23class Channelbag;
24struct FCurveDescriptor;
25} // namespace animrig
26
27struct bAction;
28struct FCurve;
29struct ID;
30struct Main;
31struct Scene;
32
33namespace io::alembic {
34
35struct TimeInfo;
36
38 Alembic::Abc::ISampleSelector selector{};
40 float frame = 0.0f;
41};
42
43/* Base class for creating FCurves and setting their samples for each frame.
44 * The actual FCurve creation is delegated to derived classes. */
46 protected:
47 ID *id_ = nullptr;
48 bAction *action_ = nullptr;
50
51 public:
53
55
56 void ensure_action_data(Main *bmain, const int sample_count);
57
58 /* Called every frame. Derived classes should set the sample for every FCurve that they have
59 * created. */
60 virtual void set_fcurves_sample(const FrameSampleInfo &sample_info) = 0;
61
62 void finish();
63
64 protected:
65 FCurve *create_fcurve(const animrig::FCurveDescriptor &fcurve_descriptor,
66 const int sample_count);
67
68 /* This is where derived classes should create FCurves for every property that they want to see
69 * key-framed. FCurves should be created using the #create_fcurve method above. */
70 virtual void create_fcurves(const int sample_count) = 0;
71
72 /* Derived classes can implement this to remove any FCurve for any property which was not
73 * actually animated. */
75};
76
77/* Create keyframes for the entire range of the supplied #TimeInfo. */
78void create_keyframes(Main *bmain,
79 Scene *scene,
80 Span<std::unique_ptr<FCurveCreationHelper>> helpers,
81 const TimeInfo time_info);
82
83void set_fcurve_sample(FCurve *fcu, int64_t sample_index, const float frame, const float value);
84
85} // namespace io::alembic
86} // namespace blender
void ensure_action_data(Main *bmain, const int sample_count)
virtual void set_fcurves_sample(const FrameSampleInfo &sample_info)=0
FCurve * create_fcurve(const animrig::FCurveDescriptor &fcurve_descriptor, const int sample_count)
virtual void create_fcurves(const int sample_count)=0
void create_keyframes(Main *bmain, Scene *scene, Span< std::unique_ptr< FCurveCreationHelper > > helpers, const TimeInfo time_info)
void set_fcurve_sample(FCurve *fcu, int64_t sample_index, const float frame, const float value)
BMesh Iterators.
__int64 int64_t
Definition BKE_text.h:90
Alembic::Abc::ISampleSelector selector