Merge of itasc branch. Project files, scons and cmake should be working. Makefile...
[blender.git] / source / blender / makesdna / DNA_action_types.h
index 7e54045..43ef9f2 100644 (file)
 struct SpaceLink;
 struct Object;
 
+/* ************************************************ */
+/* Visualisation */
+
+/* Motion Paths ------------------------------------ */
+/* (used for Pose Channels and Objects) */
+
+/* Data point for motion path */
+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) */
+typedef struct bMotionPath {
+       bMotionPathVert *points;        /* path samples */
+       int     length;                                 /* the number of cached verts */
+       
+       int start_frame;                        /* for drawing paths, the start frame number */
+       int     end_frame;                              /* for drawing paths, the end frame number */
+       
+       int flag;                                       /* extra settings */
+} bMotionPath;
+
+
+
+/* Animation Visualisation Settings - for Objects or Armatures (not PoseChannels) */
+typedef struct bAnimVizSettings {
+       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 */
+} bAnimVizSettings;
+
+/* bMotionPathSettings->flag */
+typedef enum eMotionPath_Settings {
+               /* show frames on path */
+       MOTIONPATH_FLAG_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),
+               /* show keyframe/frame numbers */
+       MOTIONPATH_FLAG_KFNOS           = (1<<4)
+} eMotionPath_Settings;
+
 /* ************************************************ */
 /* Poses */
 
@@ -98,7 +146,9 @@ typedef struct bPoseChannel {
        float           limitmin[3], limitmax[3];       /* DOF constraint */
        float           stiffness[3];                           /* DOF stiffness */
        float           ikstretch;
-       
+       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 */
 } bPoseChannel;
@@ -118,7 +168,8 @@ typedef enum ePchan_Flag {
        POSE_CHAIN              =       0x0200,
        POSE_DONE               =   0x0400,
        POSE_KEY                =       0x1000,
-       POSE_STRIDE             =       0x2000
+       POSE_STRIDE             =       0x2000,
+       POSE_IKTREE             =   0x4000,
 } ePchan_Flag;
 
 /* PoseChannel constflag (constraint detection) */
@@ -142,17 +193,32 @@ typedef enum ePchan_IkFlag {
        BONE_IK_YLIMIT  = (1<<4),
        BONE_IK_ZLIMIT  = (1<<5),
        
+       BONE_IK_ROTCTL  = (1<<6),
+       BONE_IK_LINCTL  = (1<<7),
+
        BONE_IK_NO_XDOF_TEMP = (1<<10),
        BONE_IK_NO_YDOF_TEMP = (1<<11),
-       BONE_IK_NO_ZDOF_TEMP = (1<<12)
+       BONE_IK_NO_ZDOF_TEMP = (1<<12),
+
 } ePchan_IkFlag;
 
 /* PoseChannel->rotmode */
 typedef enum ePchan_RotMode {
                /* quaternion rotations (default, and for older Blender versions) */
        PCHAN_ROT_QUAT  = 0,
-               /* euler rotations (xyz only) */
-       PCHAN_ROT_EUL,
+               /* euler rotations - keep in sync with enum in BLI_arithb.h */
+       PCHAN_ROT_XYZ = 1,              /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */
+       PCHAN_ROT_XZY,
+       PCHAN_ROT_YXZ,
+       PCHAN_ROT_YZX,
+       PCHAN_ROT_ZXY,
+       PCHAN_ROT_ZYX,
+       /* NOTE: space is reserved here for 18 other possible 
+        * euler rotation orders not implemented 
+        */
+       PCHAN_ROT_MAX,  /* sentinel for Py API*/
+               /* axis angle rotations */
+       PCHAN_ROT_AXISANGLE = -1
 } ePchan_RotMode;
 
 /* Pose ------------------------------------ */
@@ -175,7 +241,9 @@ typedef struct bPose {
        ListBase agroups;                       /* list of bActionGroups */
        
        int active_group;                       /* index of active group (starts from 1) */
-       int pad;
+       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 */ 
 } bPose;
 
 
@@ -191,8 +259,53 @@ typedef enum ePose_Flags {
        POSE_CONSTRAINTS_TIMEDEPEND = (1<<3),
                /* recalculate bone paths */
        POSE_RECALCPATHS = (1<<4),
+           /* set by armature_rebuild_pose to give a chance to the IK solver to rebuild IK tree */
+       POSE_WAS_REBUILT = (1<<5),
+           /* set by game_copy_pose to indicate that this pose is used in the game engine */
+       POSE_GAME_ENGINE = (1<<6),
 } ePose_Flags;
 
+/* bPose->iksolver and bPose->ikparam->iksolver */
+typedef enum {
+       IKSOLVER_LEGACY = 0,
+       IKSOLVER_ITASC,
+} ePose_IKSolverType;
+
+/* header for all bPose->ikparam structures */
+typedef struct bIKParam {
+       int   iksolver;
+} bIKParam;
+
+/* bPose->ikparam when bPose->iksolver=1 */
+typedef struct bItasc {
+       int   iksolver;
+       float precision;
+       short numiter;
+       short numstep;
+       float minstep;
+       float maxstep;
+       short solver;   
+       short flag;
+       float feedback;
+       float maxvel;   /* max velocity to SDLS solver */
+       float dampmax;  /* maximum damping for DLS solver */
+       float dampeps;  /* threshold of singular value from which the damping start progressively */
+} bItasc;
+
+/* bItasc->flag */
+typedef enum {
+       ITASC_AUTO_STEP = (1<<0),
+       ITASC_INITIAL_REITERATION = (1<<1),
+       ITASC_REITERATION = (1<<2),
+       ITASC_SIMULATION = (1<<3),
+} eItasc_Flags;
+
+/* bItasc->solver */
+typedef enum {
+       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;
+
 /* ************************************************ */
 /* Action */
 
@@ -225,10 +338,18 @@ typedef struct bActionGroup {
 
 /* Action Group flags */
 typedef enum eActionGroup_Flag {
+               /* group is selected */
        AGRP_SELECTED   = (1<<0),
+               /* group is 'active' / last selected one */
        AGRP_ACTIVE     = (1<<1),
+               /* keyframes/channels belonging to it cannot be edited */
        AGRP_PROTECTED  = (1<<2),
+               /* for UI, sub-channels are shown */
        AGRP_EXPANDED   = (1<<3),
+               /* sub-channels are not evaluated */
+       AGRP_MUTED              = (1<<4),
+               /* sub-channels are not visible in Graph Editor */
+       AGRP_NOTVISIBLE = (1<<5),
        
        AGRP_TEMP               = (1<<30),
        AGRP_MOVED              = (1<<31)
@@ -269,6 +390,7 @@ typedef enum eAction_Flags {
                /* flags for evaluation/editing */
        ACT_MUTED               = (1<<9),
        ACT_PROTECTED   = (1<<10),
+       ACT_DISABLED    = (1<<11),
 } eAction_Flags;
 
 
@@ -288,8 +410,12 @@ typedef struct bDopeSheet {
 /* DopeSheet filter-flag */
 typedef enum DOPESHEET_FILTERFLAG {
                /* general filtering */
-       ADS_FILTER_ONLYSEL                      = (1<<0),
-       ADS_FILTER_ONLYDRIVERS          = (1<<1),
+       ADS_FILTER_ONLYSEL                      = (1<<0),       /* only include channels relating to selected data */
+       
+               /* temporary (runtime flags) */
+       ADS_FILTER_ONLYDRIVERS          = (1<<1),       /* for 'Drivers' editor - only include Driver data from AnimData */
+       ADS_FILTER_ONLYNLA                      = (1<<2),       /* for 'NLA' editor - only include NLA data from AnimData */
+       ADS_FILTER_SELEDIT                      = (1<<3),       /* for Graph Editor - used to indicate whether to include a filtering flag or not */
        
                /* datatype-based filtering */
        ADS_FILTER_NOSHAPEKEYS          = (1<<6),
@@ -299,10 +425,15 @@ typedef enum DOPESHEET_FILTERFLAG {
        ADS_FILTER_NOCUR                        = (1<<13),
        ADS_FILTER_NOWOR                        = (1<<14),
        ADS_FILTER_NOSCE                        = (1<<15),
+       ADS_FILTER_NOPART                       = (1<<16),
+       ADS_FILTER_NOMBA                        = (1<<17),
+       ADS_FILTER_NOARM                        = (1<<18),
+       
+               /* NLA-specific filters */
+       ADS_FILTER_NLA_NOACT            = (1<<20),      /* if the AnimData block has no NLA data, don't include to just show Action-line */
        
                /* combination filters (some only used at runtime) */
-       ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR),
-       ADS_FILTER_NLADUMMY = (ADS_FILTER_NOSHAPEKEYS|ADS_FILTER_NOOBDATA),
+       ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART),
 } DOPESHEET_FILTERFLAG;        
 
 /* DopeSheet general flags */
@@ -421,5 +552,3 @@ typedef enum ACHAN_FLAG {
 
 
 #endif
-
-