Blender V5.0
DNA_anim_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009 Blender Authors, Joshua Leung. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_utildefines.h"
12
13#include "DNA_ID.h"
14#include "DNA_action_types.h"
15#include "DNA_anim_enums.h"
16#include "DNA_curve_types.h"
17#include "DNA_listBase.h"
18
19#ifdef __cplusplus
20# include "BLI_span.hh"
21
22# include <type_traits>
23#endif
24
25/* ************************************************ */
26/* F-Curve DataTypes */
27
28/* Modifiers -------------------------------------- */
29
36typedef struct FModifier {
37 struct FModifier *next, *prev;
38
40 struct FCurve *curve;
42 void *data;
43
45 char name[/*MAX_NAME*/ 64];
47 short type;
49 short flag;
55
56 char _pad[6];
57
59 float influence;
60
62 float sfra;
64 float efra;
66 float blendin;
68 float blendout;
70
71/* --- */
72
73/* Generator modifier data */
74typedef struct FMod_Generator {
75 /* general generator information */
79 unsigned int arraysize;
80
84 int mode;
85
87 int flag;
89
112
113/* envelope modifier - envelope data */
114typedef struct FCM_EnvelopeData {
116 float min, max;
118 float time;
119
121 short f1;
123 short f2;
125
126/* envelope-like adjustment to values (for fade in/out) */
138
139/* cycling/repetition modifier data */
140/* TODO: we can only do complete cycles. */
151
152/* limits modifier data */
153typedef struct FMod_Limits {
157 int flag;
158 char _pad[4];
160
161/* noise modifier data */
162typedef struct FMod_Noise {
163 float size;
164 float strength;
165 float phase;
166 float offset;
169
170 short depth;
173 char _pad[3];
175
176/* stepped modifier data */
177typedef struct FMod_Stepped {
181 float offset;
182
187
189 int flag;
191
192/* Drivers -------------------------------------- */
193
199typedef struct DriverTarget {
202
204 char *rna_path;
205
210 char pchan_name[/*MAX_NAME*/ 64];
213
216 char _pad[5];
217
222 short flag;
224 short options;
227
228 /* Context-dependent property of a "Context Property" type target.
229 * The `rna_path` of this property is used as a target.
230 * This is a value of enumerator #eDriverTarget_ContextProperty. */
232
233 /* Fall back value to use with DTAR_OPTION_USE_FALLBACK. */
236
237/* --- */
238
247typedef struct DriverVar {
248 struct DriverVar *next, *prev;
249
254 char name[/*MAX_NAME*/ 64];
255
258
262 char type;
263
265 short flag;
267 float curval;
269
270/* --- */
271
284typedef struct ChannelDriver {
287
288 /* python expression to execute (may call functions defined in an accessory file)
289 * which relates the target 'variables' in some way to yield a single usable value
290 */
292 char expression[256];
295
298
300 float curval;
301 /* XXX to be implemented... this is like the constraint influence setting. */
304
305 /* general settings */
307 int type;
309 int flag;
311
312/* F-Curves -------------------------------------- */
313
320typedef struct FPoint {
322 float vec[2];
324 int flag;
325 char _pad[4];
327
329typedef struct FCurve {
330 struct FCurve *next, *prev;
331
332 /* group */
335
336 /* driver settings */
339 /* evaluation settings */
342
343 /* motion data */
349 unsigned int totvert;
350
359
360 /* value cache + settings */
362 float curval;
364 short flag;
366 short extend;
369
370 char _pad[3];
371
372 /* RNA - data link */
385 char *rna_path;
386
387 /* curve coloring (for editor) */
391 float color[3];
392
395
396/* ************************************************ */
397/* 'Action' Data-types */
398
399/* NOTE: Although these are part of the Animation System,
400 * they are not stored here, see `DNA_action_types.h` instead. */
401
402/* ************************************************ */
403/* NLA - Non-Linear Animation */
404
405/* NLA Strips ------------------------------------- */
406
413typedef struct NlaStrip {
414 struct NlaStrip *next, *prev;
415
425
444 char last_slot_identifier[/*MAX_ID_NAME*/ 258];
445 char _pad0[2];
446 /* TODO: move out? */
451
453 char name[/*MAX_NAME*/ 64];
454
459
461 float start, end;
464
466 float repeat;
468 float scale;
469
474
477 char _pad1[2];
478
480 short type;
481
484
486 int flag;
487 char _pad2[4];
488
489 /* Pointer to an original NLA strip. */
491
492 void *_pad3;
494
495#ifdef __cplusplus
496/* Some static assertions that things that should have the same type actually do. */
497static_assert(
498 std::is_same_v<decltype(ActionSlot::handle), decltype(NlaStrip::action_slot_handle)>);
499#endif
500
501/* NLA Tracks ------------------------------------- */
502
511typedef struct NlaTrack {
512 struct NlaTrack *next, *prev;
513
516
518 int flag;
521 int index;
522
524 char name[/*MAX_NAME*/ 64];
526
527/* ************************************ */
528/* KeyingSet Data-types */
529
539typedef struct KS_Path {
540 struct KS_Path *next, *prev;
541
545 char group[/*MAX_NAME*/ 64];
546
549
553 short flag;
554
556 char *rna_path;
559
565
566/* ---------------- */
567
579typedef struct KeyingSet {
580 struct KeyingSet *next, *prev;
581
584
586 char idname[/*MAX_NAME*/ 64];
588 char name[/*MAX_NAME*/ 64];
590 char description[1024];
592 char typeinfo[/*MAX_NAME*/ 64];
593
596
598 short flag;
599
604
605 char _pad[6];
607
608/* ************************************************ */
609/* Animation Data */
610
611/* AnimOverride ------------------------------------- */
612
623typedef struct AnimOverride {
625
627 char *rna_path;
630
632 float value;
634
635/* AnimData ------------------------------------- */
636
651typedef struct AnimData {
662
680 char last_slot_identifier[/*MAX_ID_NAME*/ 258];
681 uint8_t _pad0[2];
682
689 char tmp_last_slot_identifier[/*MAX_ID_NAME*/ 258];
690 uint8_t _pad1[2];
691
692 /* nla-tracks */
704
705 /* 'drivers' for this ID-block's settings - FCurves, but are completely
706 * separate from those for animation data
707 */
713
716
717 /* settings for animation evaluation */
719 int flag;
720
721 /* settings for active action evaluation (based on NLA strip settings) */
728
729 uint8_t _pad2[4];
731
732#ifdef __cplusplus
733/* Some static assertions that things that should have the same type actually do. */
734static_assert(std::is_same_v<decltype(ActionSlot::handle), decltype(AnimData::slot_handle)>);
735static_assert(
736 std::is_same_v<decltype(ActionSlot::identifier), decltype(AnimData::last_slot_identifier)>);
737#endif
738
739/* Base Struct for Anim ------------------------------------- */
740
ID and Library types, which are fundamental for SDNA.
These structs are the foundation for all linked lists in the library system.
char identifier[258]
char tmp_last_slot_identifier[258]
uint8_t _pad0[2]
bAction * action
short act_blendmode
NlaStrip * actstrip
ListBase overrides
float act_influence
int32_t slot_handle
FCurve ** driver_array
uint8_t _pad2[4]
NlaTrack * act_track
int32_t tmp_slot_handle
bAction * tmpact
short act_extendmode
uint8_t _pad1[2]
ListBase drivers
ListBase nla_tracks
char last_slot_identifier[258]
struct AnimOverride * prev
struct AnimOverride * next
char expression[256]
struct ExprPyLike_Parsed * expr_simple
char pchan_name[64]
struct DriverVar * next
DriverTarget targets[8]
char name[64]
struct DriverVar * prev
struct FCurve * next
bActionGroup * grp
float curval
char * rna_path
FPoint * fpt
ChannelDriver * driver
BezTriple * bezt
float color[3]
struct FCurve * prev
float prev_norm_factor
float prev_offset
char _pad[3]
short extend
int array_index
unsigned int totvert
int active_keyframe_index
char auto_smoothing
ListBase modifiers
FCM_EnvelopeData * data
unsigned int arraysize
char name[64]
struct FCurve * curve
float influence
struct FModifier * next
short ui_expand_flag
char _pad[6]
struct FModifier * prev
char _pad[4]
float vec[2]
Definition DNA_ID.h:414
struct KS_Path * next
short keyingoverride
char group[64]
short keyingflag
short groupmode
struct KS_Path * prev
char * rna_path
struct KeyingSet * prev
char name[64]
char typeinfo[64]
char idname[64]
struct KeyingSet * next
ListBase paths
short keyingoverride
char description[1024]
struct NlaStrip * next
short blendmode
char _pad2[4]
char _pad1[2]
ListBase fcurves
char name[64]
float influence
char last_slot_identifier[258]
ListBase strips
void * speaker_handle
int32_t action_slot_handle
ListBase modifiers
struct NlaStrip * prev
struct NlaStrip * orig_strip
short extendmode
char _pad0[2]
bAction * act
float strip_time
ListBase strips
struct NlaTrack * next
char name[64]
struct NlaTrack * prev