Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2010-01-01 15:24:16 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-01 15:24:16 +0300
commite6f26957ea56c7cfdaecd26e192a2ccbd1f6c97a (patch)
treebfe8aee1f6b75a64fe070feecda9ee5cc2f4eb62 /source/blender/makesdna/DNA_action_types.h
parent0b673d45e535fc59546631d2ffe602bd68aaba56 (diff)
Cleanup of MotionPaths+Ghosts (AnimViz) - Part 1
This commit sets up some of the groundwork necessary to extend the animation visualisation capabilities, previously only available for bones in PoseMode, to Objects as well. Also, some of the other goals of this refactor is to make future visualisation goodies (i.e. editable paths) more feasible... (There's really nothing to see here yet. The following log notes are really just for my own reference to keep track of things.) Currently, the following things have been done: * New datastructures + settings have been tidied up, ready for usage * Added these new types into the Object and PoseBone code as necessary, with freeing/adding/copying accounted for * File IO code for the new data, including version patching to convert the old system to the new one. * Set up the drawing system for motionpaths based on the old armature path drawing code. Armatures still draw using the old system, since the two systems use different storage systems. * Started setting up the motionpath 'baking' code, but the core of this still needs to be coded... Next Steps (after some semi-urgent Durian Driver changes): * Port the ghosting/onionskinning code over too * Finish motionpath baking code * RNA wrapping for the new types * Hooking up all the new code into the operators, etc.
Diffstat (limited to 'source/blender/makesdna/DNA_action_types.h')
-rw-r--r--source/blender/makesdna/DNA_action_types.h112
1 files changed, 86 insertions, 26 deletions
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 9847b3a9219..aa3b921565f 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -46,13 +46,23 @@ struct Object;
/* Motion Paths ------------------------------------ */
/* (used for Pose Channels and Objects) */
-/* Data point for motion path */
+/* Data point for motion path (mpv) */
typedef struct bMotionPathVert {
float co[3]; /* coordinates of point in 3D-space */
int flag; /* quick settings */
} bMotionPathVert;
-/* Motion Path data cache - for elements providing transforms (i.e. Objects or PoseChannels) */
+/* bMotionPathVert->flag */
+typedef enum eMotionPathVert_Flag {
+ /* vert is selected */
+ MOTIONPATH_VERT_SEL = (1<<0),
+} eMotionPathVert_Flag;
+
+/* ........ */
+
+/* Motion Path data cache (mpath)
+ * - for elements providing transforms (i.e. Objects or PoseChannels)
+ */
typedef struct bMotionPath {
bMotionPathVert *points; /* path samples */
int length; /* the number of cached verts */
@@ -60,33 +70,79 @@ typedef struct bMotionPath {
int start_frame; /* for drawing paths, the start frame number */
int end_frame; /* for drawing paths, the end frame number */
- int flag; /* extra settings */
+ int flag; /* baking settings - eMotionPath_Flag */
} bMotionPath;
+/* bMotionPath->flag */
+typedef enum eMotionPath_Flag {
+ /* (for bones) path represents the head of the bone */
+ MOTIONPATH_FLAG_BHEAD = (1<<0),
+ /* motion path is being edited */
+ MOTIONPATH_FLAG_EDIT = (1<<1),
+} eMotionPath_Flag;
+/* Visualisation General --------------------------- */
+/* for Objects or Poses (but NOT PoseChannels) */
-/* Animation Visualisation Settings - for Objects or Armatures (not PoseChannels) */
+/* Animation Visualisation Settings (avs) */
typedef struct bAnimVizSettings {
+ /* Onion-Skinning Settings ----------------- */
+ int ghost_sf, ghost_ef; /* start and end frames of ghost-drawing range (only used for GHOST_TYPE_RANGE) */
+ int ghost_bc, ghost_ac; /* number of frames before/after current frame to show */
+
+ short ghost_type; /* eOnionSkinTypes */
+ short ghost_step; /* number of frames between each ghost shown (not for GHOST_TYPE_KEYS) */
+
int pad;
- int pathflag; /* eMotionPath_Settings */
- int pathsf, pathef; /* start and end frames of path-calculation range */
- int pathbc, pathac; /* number of frames before/after current frame of path-calculation */
+ /* Motion Path Settings ------------------- */
+ short path_type; /* eMotionPath_Types */
+ short path_step; /* number of frames between points indicated on the paths */
+
+ short path_viewflag; /* eMotionPaths_ViewFlag */
+ short path_bakeflag; /* eMotionPaths_BakeFlag */
+
+ int path_sf, path_ef; /* start and end frames of path-calculation range */
+ int path_bc, path_ac; /* number of frames before/after current frame to show */
} bAnimVizSettings;
-/* bMotionPathSettings->flag */
-typedef enum eMotionPath_Settings {
+
+/* bAnimVizSettings->ghost_type */
+typedef enum eOnionSkin_Types {
+ /* around current frame */
+ GHOST_TYPE_ACFRA = 0,
+ /* show ghosts within the specified frame range */
+ GHOST_TYPE_RANGE,
+ /* show ghosts on keyframes within the specified range only */
+ GHOST_TYPE_KEYS,
+} eOnionSkin_Types;
+
+
+/* bAnimVizSettings->path_type */
+typedef enum eMotionPaths_Types {
+ /* show the paths along their entire ranges */
+ MOTIONPATH_TYPE_RANGE = 0,
+ /* only show the parts of the paths around the current frame */
+ MOTIONPATH_TYPE_ACFRA,
+} eMotionPath_Types;
+
+/* bAnimVizSettings->path_viewflag */
+typedef enum eMotionPaths_ViewFlag {
/* show frames on path */
- MOTIONPATH_FLAG_FNUMS = (1<<0),
+ MOTIONPATH_VIEW_FNUMS = (1<<0),
/* show keyframes on path */
- MOTIONPATH_FLAG_KFRAS = (1<<1),
- /* for bones - calculate head-points for curves instead of tips */
- MOTIONPATH_FLAG_HEADS = (1<<2),
- /* show path around current frame */
- MOTIONPATH_FLAG_ACFRA = (1<<3),
+ MOTIONPATH_VIEW_KFRAS = (1<<1),
/* show keyframe/frame numbers */
- MOTIONPATH_FLAG_KFNOS = (1<<4)
-} eMotionPath_Settings;
+ MOTIONPATH_VIEW_KFNOS = (1<<2),
+} eMotionPath_ViewFlag;
+
+/* bAnimVizSettings->path_bakeflag */
+typedef enum eMotionPaths_BakeFlag {
+ /* motion paths directly associated with this block of settings needs updating */
+ MOTIONPATH_BAKE_NEEDS_RECALC = (1<<0),
+ /* for bones - calculate head-points for curves instead of tips */
+ MOTIONPATH_BAKE_HEADS = (1<<1),
+} eMotionPath_BakeFlag;
/* ************************************************ */
/* Poses */
@@ -113,9 +169,11 @@ typedef struct bPoseChannel {
short protectflag; /* protect channels from being transformed */
short agrp_index; /* index of action-group this bone belongs to (0 = default/no group) */
+// XXX depreceated.... old animation system (armature only viz) ----
int pathlen; /* for drawing paths, the amount of frames */
int pathsf; /* for drawing paths, the start frame number */
int pathef; /* for drawing paths, the end frame number */
+// XXX end of depreceated code -------------------------------------
struct Bone *bone; /* set on read file or rebuild pose */
struct bPoseChannel *parent; /* set on read file or rebuild pose */
@@ -152,8 +210,9 @@ typedef struct bPoseChannel {
float ikrotweight; /* weight of joint rotation constraint */
float iklinweight; /* weight of joint stretch constraint */
- float *path; /* totpath x 3 x float */
- struct Object *custom; /* draws custom object instead of this channel */
+ float *path; /* totpath x 3 x float */ // XXX depreceated... old animation system (armature only viz)
+ bMotionPath *mpath; /* motion path cache for this bone */
+ struct Object *custom; /* draws custom object instead of default bone shape */
} bPoseChannel;
@@ -259,6 +318,8 @@ typedef struct bPose {
int iksolver; /* ik solver to use, see ePose_IKSolverType */
void *ikdata; /* temporary IK data, depends on the IK solver. Not saved in file */
void *ikparam; /* IK solver parameters, structure depends on iksolver */
+
+ bAnimVizSettings avs; /* settings for visualisation of bone animation */
} bPose;
@@ -283,7 +344,7 @@ typedef enum ePose_Flags {
/* IK Solvers ------------------------------------ */
/* bPose->iksolver and bPose->ikparam->iksolver */
-typedef enum {
+typedef enum ePose_IKSolverType {
IKSOLVER_LEGACY = 0,
IKSOLVER_ITASC,
} ePose_IKSolverType;
@@ -310,7 +371,7 @@ typedef struct bItasc {
} bItasc;
/* bItasc->flag */
-typedef enum {
+typedef enum eItasc_Flags {
ITASC_AUTO_STEP = (1<<0),
ITASC_INITIAL_REITERATION = (1<<1),
ITASC_REITERATION = (1<<2),
@@ -318,7 +379,7 @@ typedef enum {
} eItasc_Flags;
/* bItasc->solver */
-typedef enum {
+typedef enum eItasc_Solver {
ITASC_SOLVER_SDLS = 0, /* selective damped least square, suitable for CopyPose constraint */
ITASC_SOLVER_DLS /* damped least square with numerical filtering of damping */
} eItasc_Solver;
@@ -509,15 +570,14 @@ typedef enum eSAction_Flag {
} eSAction_Flag;
/* SpaceAction Mode Settings */
-// XXX should this be used by other editors too?
typedef enum eAnimEdit_Context {
- /* action (default) */
+ /* action on the active object */
SACTCONT_ACTION = 0,
- /* editing of shapekey's IPO block */
+ /* list of all shapekeys on the active object, linked with their F-Curves */
SACTCONT_SHAPEKEY,
/* editing of gpencil data */
SACTCONT_GPENCIL,
- /* dopesheet */
+ /* dopesheet (default) */
SACTCONT_DOPESHEET,
} eAnimEdit_Context;