23 MAQUINA_IGNORE_WARNINGS_BEGIN
25 MAQUINA_IGNORE_WARNINGS_END
40 using WrapFunc = std::function<std::pair<float,float>(float)>;
77 std::vector<int> selected_keys()
const;
80 int key_index(
float t)
const;
83 int previous_key(
float t)
const;
86 int next_key(
float t)
const;
97 void set_time(
float t);
100 float as_float()
const;
106 void set_value(
float v);
109 void set_value(
const Value& v);
112 bool selected()
const;
115 void set_selected(
bool state);
118 Key(Impl* curve,
size_t index) : _curve(curve), _index(index) {}
141 void normalize(
bool repeat);
148 void _skip_unselected()
153 const int size = int(_parent->
size());
154 while (_index < size)
156 if ((*_parent)[_index].selected())
169 Iterator(
int index,
AnimCurve *parent,
bool only_selected) : _index(index), _parent(parent), _only_selected(only_selected)
185 Iterator begin(
bool only_selected =
false) {
return {0,
this, only_selected}; }
196 Keys(
AnimCurve *parent,
bool only_selected) : _parent(parent), _only_selected(only_selected) {}
204 bool only_selected =
false 207 return {
this, only_selected};
218 std::optional<Value>
clip(
float frame_in,
float frame_out);
221 Value time_wrap(
const gsl::span<const WrapSlice>& wrap_slices,
CycleMode pre_cycle_mode,
CycleMode post_cycle_mode)
const;
224 AnimCurve(std::shared_ptr<Impl> impl) { _impl=impl; }
293 bool broken_tangents =
false;
296 bool selected =
false;
313 const Key operator[](
size_t n)
const;
320 void _skip_unselected()
325 const int size = int(_parent->
size());
326 while (_index < size)
328 if ((*_parent)[_index].selected)
341 Iterator(
int index,
AnimCurveFloat *parent,
bool only_selected) : _index(index), _parent(parent), _only_selected(only_selected)
357 Iterator begin(
bool only_selected =
false) {
return {0,
this, only_selected}; }
376 bool only_selected =
false 379 return {
this, only_selected};
383 void set_key(
size_t n,
const Key& key);
387 size_t set_key(
const Key& key);
392 size_t insert_key(
const Key& key,
bool before=
true);
402 void normalize(
bool repeat);
An animation curve for floating point values. That type of curves contains tangents.
Definition: AnimCurve.h:229
size_t size() const
Returns the number of keys.
Keys(AnimCurveFloat *parent, bool only_selected)
Definition: AnimCurve.h:368
const Key operator[](size_t i) const
Get a key.
Definition: AnimCurve.h:135
bool operator==(const Iterator &o)
Definition: AnimCurve.h:173
Iterator(int index, AnimCurve *parent, bool only_selected)
Definition: AnimCurve.h:169
float start
The start time in the original animation.
Definition: AnimCurve.h:44
WrapSlice(float start, float end, const WrapFunc &time_wrap_func)
Definition: AnimCurve.h:41
CycleMode
Definition: AnimCurve.h:29
WrapFunc time_wrap_func
The time wrap functor, for an original animation time, return the new animation time.
Definition: AnimCurve.h:50
A key iteration.
Definition: AnimCurve.h:363
Keys(AnimCurve *parent, bool only_selected)
Definition: AnimCurve.h:196
Iterator & operator++()
Definition: AnimCurve.h:347
std::input_iterator_tag iterator_category
Definition: AnimCurve.h:163
CycleMode
Definition: AnimCurve.h:232
Quat< T > spline(const Quat< T > &q0, const Quat< T > &q1, const Quat< T > &q2, const Quat< T > &q3, T t)
Definition: ImathQuat.h:544
Iterator begin()
Definition: AnimCurve.h:369
An anim curve key.
Definition: AnimCurve.h:241
Iterator(int index, AnimCurveFloat *parent, bool only_selected)
Definition: AnimCurve.h:341
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
An animation curve abstraction, can animate any type of value, bool, int, float or other values...
Definition: AnimCurve.h:55
Definition: AnimCurve.h:315
float end
The end time in the original animation.
Definition: AnimCurve.h:47
static const Value default_value
The default value.
Definition: Value.h:245
Mode mode
Definition: AnimCurve.h:267
A key iteration.
Definition: AnimCurve.h:191
Iterator begin(bool only_selected=false)
Begin iterator on keyframes.
Definition: AnimCurve.h:357
Iterator end()
End iterator on keyframes.
Definition: AnimCurve.h:188
A curve key.
Definition: AnimCurve.h:89
Iterator begin()
Definition: AnimCurve.h:197
Iterator end()
End iterator on keyframes.
Definition: AnimCurve.h:360
The channel is not animable.
#define MAQUINA_EXPORT
Definition: Export.h:31
Imath::V2f tangent
The key.
Definition: AnimCurve.h:266
Definition: AnimCurve.h:143
Tangent right
The right tangent.
Definition: AnimCurve.h:290
Definition: ImathVec.h:61
MAQUINA_EXPORT Value copy_keys(Node &anim_layer)
Return a copy of the active key selection in a layer.
A monotone slice of time wrapping.
Definition: AnimCurve.h:38
Imath::V2f key
The key, x is the frame, y the value.
Definition: AnimCurve.h:284
Keys keys(bool only_selected=false)
Return an iteration on the keys.
Definition: AnimCurve.h:203
Key operator*()
Definition: AnimCurve.h:181
Tangent left
The left tangent.
Definition: AnimCurve.h:287
size_t size() const
Return the number of keys.
std::function< std::pair< float, float >(float)> WrapFunc
Definition: AnimCurve.h:40
Iterator & operator++()
Definition: AnimCurve.h:175
Iterator end()
Definition: AnimCurve.h:198
bool operator==(const Iterator &o)
Definition: AnimCurve.h:345
Iterator begin(bool only_selected=false)
Begin iterator on keyframes.
Definition: AnimCurve.h:185
Iterator end()
Definition: AnimCurve.h:370
bool operator!=(const Iterator &o)
Definition: AnimCurve.h:174
Mode
Definition: AnimCurve.h:247
T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:82
std::input_iterator_tag iterator_category
Definition: AnimCurve.h:335
std::ptrdiff_t difference_type
Definition: AnimCurve.h:337
Key operator*()
Definition: AnimCurve.h:353
Keys keys(bool only_selected=false)
Return an iteration on the keys.
Definition: AnimCurve.h:375
MAQUINA_EXPORT int insert_key(const Plug &plug, float t, float v)
std::ptrdiff_t difference_type
Definition: AnimCurve.h:165
bool operator!=(const Iterator &o)
Definition: AnimCurve.h:346
MAQUINA_EXPORT void remove_key(Plug &plug, const float frame)
Remove the key at frame in the active layer.
Definition: AnimCurve.h:244
Base class of all Rumba values.
Definition: Value.h:34