From ecaafbb70c21137db1fa2cc628ce910f18ccb82a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 19 Jul 2007 11:46:37 +0000 Subject: == SDNA - Code Comments == Added a few comments about various Animation-System Related structs. Hopefully, these will be helpful for people trying to get familiar with the code. --- source/blender/makesdna/DNA_action_types.h | 36 +++++++++++++++++++----------- source/blender/makesdna/DNA_curve_types.h | 3 ++- source/blender/makesdna/DNA_ipo_types.h | 13 ++++++----- source/blender/makesdna/DNA_nla_types.h | 10 +++++---- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 855252e1ef4..f0640dc5178 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -43,7 +43,7 @@ struct Object; typedef struct bPoseChannel { struct bPoseChannel *next, *prev; - ListBase constraints; + ListBase constraints;/* Constraints that act on this PoseChannel */ char name[32]; /* Channels need longer names than normal blender objects */ short flag; /* dynamic, for detecting transform changes */ @@ -83,30 +83,39 @@ typedef struct bPoseChannel { } bPoseChannel; - -typedef struct bPose{ - ListBase chanbase; +/* Pose-Object. It is only found under ob->pose. It is not library data, even + * though there is a define for it (hack for the outliner). + */ +typedef struct bPose { + ListBase chanbase; /* list of pose channels */ short flag, proxy_layer; /* proxy layer: copy from armature, gets synced */ float ctime; /* local action time of this pose */ float stride_offset[3]; /* applied to object */ float cyclic_offset[3]; /* result of match and cycles, applied in where_is_pose() */ } bPose; +/* Action Channels belong to Actions. They are linked with an IPO block, and can also own + * Constraint Channels in certain situations. + */ typedef struct bActionChannel { struct bActionChannel *next, *prev; - struct Ipo *ipo; - ListBase constraintChannels; + struct Ipo *ipo; /* IPO block this action channel references */ + ListBase constraintChannels; /* Constraint Channels (when Action Channel represents an Object or Bone) */ - int flag; - char name[32]; /* Channel name */ + int flag; /* settings accessed via bitmapping */ + char name[32]; /* channel name */ int reserved1; } bActionChannel; +/* Action. A recyclable block that contains a series of Action Channels (ipo), which define + * a clip of reusable animation for use in the NLA. + */ typedef struct bAction { ID id; - ListBase chanbase; /* Action Channels in this action */ + ListBase chanbase; /* Action Channels in this Action */ } bAction; +/* Action Editor Space. This is defined here instead of in DNA_space_types.h */ typedef struct SpaceAction { struct SpaceLink *next, *prev; int spacetype; @@ -116,10 +125,11 @@ typedef struct SpaceAction { short blockhandler[8]; View2D v2d; - bAction *action; - short flag, autosnap; - short pin, actnr, lock, actwidth; - float timeslide; + bAction *action; /* the currently active action */ + short flag, autosnap; /* flag: bitmapped settings; autosnap: automatic keyframe snapping mode */ + short pin, actnr, lock; /* pin: keep showing current action; actnr: used for finding chosen action from menu; lock: lock time to other windows */ + short actwidth; /* width of the left-hand side name panel (in pixels?) */ + float timeslide; /* for Time-Slide transform mode drawing - current frame? */ } SpaceAction; /* Action Channel flags */ diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 5439c65aa81..8e464f83716 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -75,7 +75,8 @@ typedef struct BevPoint { short f1, f2; } BevPoint; -/* note; alfa location in struct is abused by Key system */ +/* Keyframes on IPO curves and Points on Bezier Curves/Paths are generally BezTriples */ +/* note: alfa location in struct is abused by Key system */ /* vec in BezTriple looks like this: vec[0][0]=x location of handle 1 vec[0][1]=y location of handle 1 diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index 9321dce2ca3..57f44e22334 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -39,17 +39,20 @@ #include "DNA_ID.h" +/* IPO Data-Block */ typedef struct Ipo { ID id; - ListBase curve; - rctf cur; - short blocktype, showkey; - short muteipo, pad; + ListBase curve; /* A list of IpoCurve structs in a linked list. */ + rctf cur; /* Rect defining extents of keyframes? */ + + short blocktype, showkey; /* blocktype: self-explanatory; showkey: either 0 or 1 (show vertical yellow lines for editing) */ + short muteipo, pad; /* muteipo: either 0 or 1 (whether ipo block is muted) */ } Ipo; -/* sometimes used */ +/* NOTE: IpoCurve struct is defined in DNA_curve_types.h, not in here... */ +/* sometimes used */ typedef short IPO_Channel; /* defines: are these duped or new? */ diff --git a/source/blender/makesdna/DNA_nla_types.h b/source/blender/makesdna/DNA_nla_types.h index 7c4b6bebca4..d7ccfe01085 100644 --- a/source/blender/makesdna/DNA_nla_types.h +++ b/source/blender/makesdna/DNA_nla_types.h @@ -54,6 +54,7 @@ typedef struct bActionModifier { struct Object *ob; } bActionModifier; +/* NLA-Modifier Types */ #define ACTSTRIP_MOD_DEFORM 0 #define ACTSTRIP_MOD_NOISE 1 #define ACTSTRIP_MOD_OOMPH 2 @@ -64,7 +65,7 @@ typedef struct bActionStrip { short stride_axis; /* axis 0=x, 1=y, 2=z */ short curmod; /* current modifier for buttons */ - struct Ipo *ipo; /* Blending ipo */ + struct Ipo *ipo; /* Blending ipo - was used for some old NAN era experiments. Non-functional currently. */ struct bAction *act; /* The action referenced by this strip */ struct Object *object; /* For groups, the actual object being nla'ed */ float start, end; /* The range of frames covered by this strip */ @@ -73,7 +74,7 @@ typedef struct bActionStrip { float stridelen; /* The stridelength (considered when flag & ACT_USESTRIDE) */ float repeat; /* The number of times to repeat the action range */ - float blendin, blendout; + float blendin, blendout; /* The number of frames on either end of the strip's length to fade in/out */ char stridechannel[32]; /* Instead of stridelen, it uses an action channel */ char offs_bone[32]; /* if repeat, use this bone/channel for defining offset */ @@ -82,18 +83,19 @@ typedef struct bActionStrip { } bActionStrip; +/* strip->mode (these defines aren't really used, but are here for reference) */ #define ACTSTRIPMODE_BLEND 0 #define ACTSTRIPMODE_ADD 1 /* strip->flag */ #define ACTSTRIP_SELECT 0x01 #define ACTSTRIP_USESTRIDE 0x02 -#define ACTSTRIP_BLENDTONEXT 0x04 /* This is not used anywhere */ +#define ACTSTRIP_BLENDTONEXT 0x04 /* Not implemented. Is not used anywhere */ #define ACTSTRIP_HOLDLASTFRAME 0x08 #define ACTSTRIP_ACTIVE 0x10 #define ACTSTRIP_LOCK_ACTION 0x20 #define ACTSTRIP_MUTE 0x40 -#define ACTSTRIP_REVERSE 0x80 +#define ACTSTRIP_REVERSE 0x80 /* This has yet to be implemented. To indicate that a strip should be played backwards */ #define ACTSTRIP_CYCLIC_USEX 0x100 #define ACTSTRIP_CYCLIC_USEY 0x200 #define ACTSTRIP_CYCLIC_USEZ 0x400 -- cgit v1.2.3