[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11313] trunk/blender/source/blender/ makesdna: == SDNA - Code Comments ==
Joshua Leung
aligorith at gmail.com
Thu Jul 19 13:46:37 CEST 2007
Revision: 11313
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11313
Author: aligorith
Date: 2007-07-19 13:46:37 +0200 (Thu, 19 Jul 2007)
Log Message:
-----------
== 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.
Modified Paths:
--------------
trunk/blender/source/blender/makesdna/DNA_action_types.h
trunk/blender/source/blender/makesdna/DNA_curve_types.h
trunk/blender/source/blender/makesdna/DNA_ipo_types.h
trunk/blender/source/blender/makesdna/DNA_nla_types.h
Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h 2007-07-19 00:42:01 UTC (rev 11312)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h 2007-07-19 11:46:37 UTC (rev 11313)
@@ -43,7 +43,7 @@
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 @@
} 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 @@
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 */
Modified: trunk/blender/source/blender/makesdna/DNA_curve_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_curve_types.h 2007-07-19 00:42:01 UTC (rev 11312)
+++ trunk/blender/source/blender/makesdna/DNA_curve_types.h 2007-07-19 11:46:37 UTC (rev 11313)
@@ -75,7 +75,8 @@
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
Modified: trunk/blender/source/blender/makesdna/DNA_ipo_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_ipo_types.h 2007-07-19 00:42:01 UTC (rev 11312)
+++ trunk/blender/source/blender/makesdna/DNA_ipo_types.h 2007-07-19 11:46:37 UTC (rev 11313)
@@ -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;
+/* 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? */
Modified: trunk/blender/source/blender/makesdna/DNA_nla_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_nla_types.h 2007-07-19 00:42:01 UTC (rev 11312)
+++ trunk/blender/source/blender/makesdna/DNA_nla_types.h 2007-07-19 11:46:37 UTC (rev 11313)
@@ -54,6 +54,7 @@
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 @@
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 @@
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 @@
} 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
More information about the Bf-blender-cvs
mailing list