Blender  V2.59
DNA_action_types.h
Go to the documentation of this file.
00001 /*  
00002  * $Id: DNA_action_types.h 36222 2011-04-19 13:01:50Z aligorith $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * Contributor(s): Original design: Reevan McKay
00024  * Contributor(s): Full recode, Ton Roosendaal, Crete 2005
00025  * Contributor(s): Animation recode, Joshua Leung
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00035 #ifndef DNA_ACTION_TYPES_H
00036 #define DNA_ACTION_TYPES_H
00037 
00038 #include "DNA_listBase.h"
00039 #include "DNA_ID.h"
00040 #include "DNA_view2d_types.h"
00041 #include "DNA_userdef_types.h" /* ThemeWireColor */
00042 
00043 struct SpaceLink;
00044 struct Object;
00045 struct Group;
00046 struct GHash;
00047 
00048 /* ************************************************ */
00049 /* Visualisation */
00050 
00051 /* Motion Paths ------------------------------------ */
00052 /* (used for Pose Channels and Objects) */
00053 
00054 /* Data point for motion path (mpv) */
00055 typedef struct bMotionPathVert {
00056         float co[3];                            /* coordinates of point in 3D-space */
00057         int flag;                                       /* quick settings */
00058 } bMotionPathVert;
00059 
00060 /* bMotionPathVert->flag */
00061 typedef enum eMotionPathVert_Flag {
00062                 /* vert is selected */
00063         MOTIONPATH_VERT_SEL             = (1<<0)
00064 } eMotionPathVert_Flag;
00065 
00066 /* ........ */
00067 
00068 /* Motion Path data cache (mpath)
00069  *      - for elements providing transforms (i.e. Objects or PoseChannels) 
00070  */
00071 typedef struct bMotionPath {
00072         bMotionPathVert *points;        /* path samples */
00073         int     length;                                 /* the number of cached verts */
00074         
00075         int start_frame;                        /* for drawing paths, the start frame number */
00076         int     end_frame;                              /* for drawing paths, the end frame number */
00077         
00078         int flag;                                       /* baking settings - eMotionPath_Flag */ 
00079 } bMotionPath;
00080 
00081 /* bMotionPath->flag */
00082 typedef enum eMotionPath_Flag {
00083                 /* (for bones) path represents the head of the bone */
00084         MOTIONPATH_FLAG_BHEAD           = (1<<0),
00085                 /* motion path is being edited */
00086         MOTIONPATH_FLAG_EDIT            = (1<<1)
00087 } eMotionPath_Flag;
00088 
00089 /* Visualisation General --------------------------- */
00090 /* for Objects or Poses (but NOT PoseChannels) */
00091 
00092 /* Animation Visualisation Settings (avs) */
00093 typedef struct bAnimVizSettings {
00094         /* Onion-Skinning Settings ----------------- */
00095         int     ghost_sf, ghost_ef;                     /* start and end frames of ghost-drawing range (only used for GHOST_TYPE_RANGE) */
00096         int ghost_bc, ghost_ac;                 /* number of frames before/after current frame to show */
00097         
00098         short ghost_type;                               /* eOnionSkin_Types */
00099         short ghost_step;                               /* number of frames between each ghost shown (not for GHOST_TYPE_KEYS) */
00100         
00101         short ghost_flag;                               /* eOnionSkin_Flag */
00102         
00103         /* General Settings ------------------------ */
00104         short recalc;                                   /* eAnimViz_RecalcFlags */
00105         
00106         /* Motion Path Settings ------------------- */
00107         short path_type;                                /* eMotionPath_Types */
00108         short path_step;                                /* number of frames between points indicated on the paths */
00109         
00110         short path_viewflag;                    /* eMotionPaths_ViewFlag */
00111         short path_bakeflag;                    /* eMotionPaths_BakeFlag */
00112         
00113         int path_sf, path_ef;                   /* start and end frames of path-calculation range */
00114         int     path_bc, path_ac;                       /* number of frames before/after current frame to show */
00115 } bAnimVizSettings;
00116 
00117 
00118 /* bAnimVizSettings->recalc */
00119 typedef enum eAnimViz_RecalcFlags {
00120                 /* motionpaths need recalculating */
00121         ANIMVIZ_RECALC_PATHS    = (1<<0)
00122 } eAnimViz_RecalcFlags;
00123 
00124 
00125 /* bAnimVizSettings->ghost_type */
00126 typedef enum eOnionSkin_Types {
00127                 /* no ghosts at all */
00128         GHOST_TYPE_NONE = 0,
00129                 /* around current frame */
00130         GHOST_TYPE_ACFRA,
00131                 /* show ghosts within the specified frame range */
00132         GHOST_TYPE_RANGE,
00133                 /* show ghosts on keyframes within the specified range only */
00134         GHOST_TYPE_KEYS
00135 } eOnionSkin_Types;
00136 
00137 /* bAnimVizSettings->ghost_flag */
00138 typedef enum eOnionSkin_Flag {
00139                 /* only show selected bones in ghosts */
00140         GHOST_FLAG_ONLYSEL      = (1<<0)
00141 } eOnionSkin_Flag;
00142 
00143 
00144 /* bAnimVizSettings->path_type */
00145 typedef enum eMotionPaths_Types {
00146                 /* show the paths along their entire ranges */
00147         MOTIONPATH_TYPE_RANGE = 0,
00148                 /* only show the parts of the paths around the current frame */
00149         MOTIONPATH_TYPE_ACFRA
00150 } eMotionPath_Types;
00151 
00152 /* bAnimVizSettings->path_viewflag */
00153 typedef enum eMotionPaths_ViewFlag {
00154                 /* show frames on path */
00155         MOTIONPATH_VIEW_FNUMS           = (1<<0),
00156                 /* show keyframes on path */
00157         MOTIONPATH_VIEW_KFRAS           = (1<<1),
00158                 /* show keyframe/frame numbers */
00159         MOTIONPATH_VIEW_KFNOS           = (1<<2),
00160                 /* find keyframes in whole action (instead of just in matching group name) */
00161         MOTIONPATH_VIEW_KFACT           = (1<<3)
00162 } eMotionPath_ViewFlag;
00163 
00164 /* bAnimVizSettings->path_bakeflag */
00165 typedef enum eMotionPaths_BakeFlag {
00166                 /* motion paths directly associated with this block of settings needs updating */
00167         MOTIONPATH_BAKE_NEEDS_RECALC    = (1<<0),
00168                 /* for bones - calculate head-points for curves instead of tips */
00169         MOTIONPATH_BAKE_HEADS                   = (1<<1),
00170                 /* motion paths exist for AnimVizSettings instance - set when calc for first time, and unset when clearing */
00171         MOTIONPATH_BAKE_HAS_PATHS               = (1<<2)
00172 } eMotionPath_BakeFlag;
00173 
00174 /* ************************************************ */
00175 /* Poses */
00176 
00177 /* PoseChannel ------------------------------------ */
00178 
00179 /* PoseChannel 
00180  *
00181  * A PoseChannel stores the results of Actions and transform information 
00182  * with respect to the restposition of Armature bones 
00183  */
00184 typedef struct bPoseChannel {
00185         struct bPoseChannel     *next, *prev;
00186         
00187         IDProperty                      *prop;          /* User-Defined Properties on this PoseChannel */                       
00188         
00189         ListBase                        constraints;/* Constraints that act on this PoseChannel */
00190         char                            name[32];       /* Channels need longer names than normal blender objects */
00191         
00192         short                           flag;           /* dynamic, for detecting transform changes */
00193         short                           constflag;  /* for quick detecting which constraints affect this channel */
00194         short                           ikflag;         /* settings for IK bones */
00195         short               selectflag; /* copy of bone flag, so you can work with library armatures, not for runtime use */
00196         short                           protectflag; /* protect channels from being transformed */
00197         short                           agrp_index; /* index of action-group this bone belongs to (0 = default/no group) */
00198         
00199 // XXX depreceated.... old animation system (armature only viz) ----
00200         int                                 pathlen;    /* for drawing paths, the amount of frames */
00201         int                             pathsf;         /* for drawing paths, the start frame number */
00202         int                                     pathef;         /* for drawing paths, the end frame number */
00203 // XXX end of depreceated code -------------------------------------
00204         
00205         struct Bone                     *bone;          /* set on read file or rebuild pose */
00206         struct bPoseChannel *parent;    /* set on read file or rebuild pose */
00207         struct bPoseChannel *child;             /* set on read file or rebuild pose, the 'ik' child, for b-bones */
00208         struct ListBase          iktree;                /* only while evaluating pose */
00209         
00210         bMotionPath *mpath;                             /* motion path cache for this bone */
00211         struct Object *custom;                  /* draws custom object instead of default bone shape */
00212         struct bPoseChannel *custom_tx; /* odd feature, display with another bones transform. needed in rare cases for advanced rigs, since the alternative is highly complicated - campbell */
00213 
00214                 /* transforms - written in by actions or transform */
00215         float           loc[3];                         
00216         float           size[3];
00217         
00218                 /* rotations - written in by actions or transform (but only one representation gets used at any time) */
00219         float           eul[3];                                 /* euler rotation */
00220         float           quat[4];                                /* quaternion rotation */
00221         float           rotAxis[3], rotAngle;   /* axis-angle rotation */
00222         short           rotmode;                                /* eRotationModes - rotation representation to use */
00223         short           pad;
00224         
00225         float           chan_mat[4][4];         /* matrix result of loc/quat/size , and where we put deform in, see next line */
00226         float           pose_mat[4][4];         /* constraints accumulate here. in the end, pose_mat = bone->arm_mat * chan_mat */
00227         float           constinv[4][4];         /* inverse result of constraints. doesn't include effect of restposition, parent, and local transform*/
00228         
00229         float           pose_head[3];           /* actually pose_mat[3] */
00230         float           pose_tail[3];           /* also used for drawing help lines... */
00231         
00232         float           limitmin[3], limitmax[3];       /* DOF constraint */
00233         float           stiffness[3];                           /* DOF stiffness */
00234         float           ikstretch;
00235         float           ikrotweight;            /* weight of joint rotation constraint */
00236         float           iklinweight;            /* weight of joint stretch constraint */
00237 
00238         float           *path;                          /* totpath x 3 x float */               // XXX depreceated... old animation system (armature only viz)
00239 } bPoseChannel;
00240 
00241 
00242 /* PoseChannel (transform) flags */
00243 typedef enum ePchan_Flag {
00244                 /* has transforms */
00245         POSE_LOC                =       (1<<0),
00246         POSE_ROT                =       (1<<1),
00247         POSE_SIZE               =       (1<<2),
00248                 /* old IK/cache stuff... */
00249         POSE_IK_MAT             =       (1<<3),
00250         POSE_UNUSED2    =       (1<<4),
00251         POSE_UNUSED3    =       (1<<5),
00252         POSE_UNUSED4    =       (1<<6),
00253         POSE_UNUSED5    =       (1<<7),
00254                 /* has Standard IK */
00255         POSE_HAS_IK             =       (1<<8),
00256                 /* IK/Pose solving*/
00257         POSE_CHAIN              =       (1<<9),
00258         POSE_DONE               =   (1<<10),
00259                 /* visualisation */
00260         POSE_KEY                =       (1<<11),
00261         POSE_STRIDE             =       (1<<12),
00262                 /* standard IK solving */
00263         POSE_IKTREE             =   (1<<13),
00264                 /* has Spline IK */
00265         POSE_HAS_IKS    =       (1<<14),
00266                 /* spline IK solving */
00267         POSE_IKSPLINE   =       (1<<15)
00268 } ePchan_Flag;
00269 
00270 /* PoseChannel constflag (constraint detection) */
00271 typedef enum ePchan_ConstFlag {
00272         PCHAN_HAS_IK            = (1<<0),
00273         PCHAN_HAS_CONST         = (1<<1),
00274                 /* only used for drawing Posemode, not stored in channel */
00275         PCHAN_HAS_ACTION        = (1<<2),
00276         PCHAN_HAS_TARGET        = (1<<3),
00277                 /* only for drawing Posemode too */
00278         PCHAN_HAS_STRIDE        = (1<<4),
00279                 /* spline IK */
00280         PCHAN_HAS_SPLINEIK      = (1<<5)
00281 } ePchan_ConstFlag;
00282 
00283 /* PoseChannel->ikflag */
00284 typedef enum ePchan_IkFlag {
00285         BONE_IK_NO_XDOF = (1<<0),
00286         BONE_IK_NO_YDOF = (1<<1),
00287         BONE_IK_NO_ZDOF = (1<<2),
00288 
00289         BONE_IK_XLIMIT  = (1<<3),
00290         BONE_IK_YLIMIT  = (1<<4),
00291         BONE_IK_ZLIMIT  = (1<<5),
00292         
00293         BONE_IK_ROTCTL  = (1<<6),
00294         BONE_IK_LINCTL  = (1<<7),
00295 
00296         BONE_IK_NO_XDOF_TEMP = (1<<10),
00297         BONE_IK_NO_YDOF_TEMP = (1<<11),
00298         BONE_IK_NO_ZDOF_TEMP = (1<<12)
00299 } ePchan_IkFlag;
00300 
00301 /* PoseChannel->rotmode and Object->rotmode */
00302 typedef enum eRotationModes {
00303                 /* quaternion rotations (default, and for older Blender versions) */
00304         ROT_MODE_QUAT   = 0,
00305                 /* euler rotations - keep in sync with enum in BLI_math.h */
00306         ROT_MODE_EUL = 1,               /* Blender 'default' (classic) - must be as 1 to sync with BLI_math_rotation.h defines */
00307         ROT_MODE_XYZ = 1,
00308         ROT_MODE_XZY,
00309         ROT_MODE_YXZ,
00310         ROT_MODE_YZX,
00311         ROT_MODE_ZXY,
00312         ROT_MODE_ZYX,
00313         /* NOTE: space is reserved here for 18 other possible 
00314          * euler rotation orders not implemented 
00315          */
00316                 /* axis angle rotations */
00317         ROT_MODE_AXISANGLE = -1,
00318 
00319         ROT_MODE_MIN = ROT_MODE_AXISANGLE,      /* sentinel for Py API */
00320         ROT_MODE_MAX = ROT_MODE_ZYX
00321 } eRotationModes;
00322 
00323 /* Pose ------------------------------------ */
00324 
00325 /* Pose-Object. 
00326  *
00327  * It is only found under ob->pose. It is not library data, even
00328  * though there is a define for it (hack for the outliner).
00329  */
00330 typedef struct bPose {
00331         ListBase chanbase;                      /* list of pose channels, PoseBones in RNA */
00332         struct GHash *chanhash;         /* ghash for quicker string lookups */
00333         
00334         short flag, pad;
00335         unsigned int proxy_layer;       /* proxy layer: copy from armature, gets synced */
00336         int pad1;
00337         
00338         float ctime;                            /* local action time of this pose */
00339         float stride_offset[3];         /* applied to object */
00340         float cyclic_offset[3];         /* result of match and cycles, applied in where_is_pose() */
00341         
00342         
00343         ListBase agroups;                       /* list of bActionGroups */
00344         
00345         int active_group;                       /* index of active group (starts from 1) */
00346         int     iksolver;                               /* ik solver to use, see ePose_IKSolverType */
00347         void *ikdata;                           /* temporary IK data, depends on the IK solver. Not saved in file */
00348         void *ikparam;                          /* IK solver parameters, structure depends on iksolver */ 
00349         
00350         bAnimVizSettings avs;           /* settings for visualisation of bone animation */
00351         char proxy_act_bone[32];           /*proxy active bone name*/
00352 } bPose;
00353 
00354 
00355 /* Pose->flag */
00356 typedef enum ePose_Flags {
00357                 /* results in armature_rebuild_pose being called */
00358         POSE_RECALC = (1<<0),
00359                 /* prevents any channel from getting overridden by anim from IPO */
00360         POSE_LOCKED     = (1<<1),
00361                 /* clears the POSE_LOCKED flag for the next time the pose is evaluated */
00362         POSE_DO_UNLOCK  = (1<<2),
00363                 /* pose has constraints which depend on time (used when depsgraph updates for a new frame) */
00364         POSE_CONSTRAINTS_TIMEDEPEND = (1<<3),
00365                 /* recalculate bone paths */
00366         POSE_RECALCPATHS = (1<<4),
00367                 /* set by armature_rebuild_pose to give a chance to the IK solver to rebuild IK tree */
00368         POSE_WAS_REBUILT = (1<<5),
00369                 /* set by game_copy_pose to indicate that this pose is used in the game engine */
00370         POSE_GAME_ENGINE = (1<<6)
00371 } ePose_Flags;
00372 
00373 /* IK Solvers ------------------------------------ */
00374 
00375 /* bPose->iksolver and bPose->ikparam->iksolver */
00376 typedef enum ePose_IKSolverType {
00377         IKSOLVER_LEGACY = 0,
00378         IKSOLVER_ITASC
00379 } ePose_IKSolverType;
00380 
00381 /* header for all bPose->ikparam structures */
00382 typedef struct bIKParam {
00383         int   iksolver;
00384 } bIKParam;
00385 
00386 /* bPose->ikparam when bPose->iksolver=1 */
00387 typedef struct bItasc {
00388         int   iksolver;
00389         float precision;
00390         short numiter;
00391         short numstep;
00392         float minstep;
00393         float maxstep;
00394         short solver;   
00395         short flag;
00396         float feedback;
00397         float maxvel;   /* max velocity to SDLS solver */
00398         float dampmax;  /* maximum damping for DLS solver */
00399         float dampeps;  /* threshold of singular value from which the damping start progressively */
00400 } bItasc;
00401 
00402 /* bItasc->flag */
00403 typedef enum eItasc_Flags {
00404         ITASC_AUTO_STEP = (1<<0),
00405         ITASC_INITIAL_REITERATION = (1<<1),
00406         ITASC_REITERATION = (1<<2),
00407         ITASC_SIMULATION = (1<<3)
00408 } eItasc_Flags;
00409 
00410 /* bItasc->solver */
00411 typedef enum eItasc_Solver {
00412         ITASC_SOLVER_SDLS = 0,  /* selective damped least square, suitable for CopyPose constraint */
00413         ITASC_SOLVER_DLS                /* damped least square with numerical filtering of damping */
00414 } eItasc_Solver;
00415 
00416 /* ************************************************ */
00417 /* Action */
00418 
00419 /* Groups -------------------------------------- */
00420 
00421 /* Action-Channel Group (agrp)
00422 
00423  * These are stored as a list per-Action, and are only used to 
00424  * group that Action's channels in an Animation Editor. 
00425  *
00426  * Even though all FCurves live in a big list per Action, each group they are in also
00427  * holds references to the achans within that list which belong to it. Care must be taken to
00428  * ensure that action-groups never end up being the sole 'owner' of a channel.
00429  * 
00430  * This is also exploited for bone-groups. Bone-Groups are stored per bPose, and are used 
00431  * primarily to color bones in the 3d-view. There are other benefits too, but those are mostly related
00432  * to Action-Groups.
00433  */
00434 typedef struct bActionGroup {
00435         struct bActionGroup *next, *prev;
00436         
00437         ListBase channels;                      /* Note: this must not be touched by standard listbase functions which would clear links to other channels */
00438         
00439         int flag;                                       /* settings for this action-group */
00440         int customCol;                          /* index of custom color set to use when used for bones (0=default - used for all old files, -1=custom set) */                          
00441         char name[64];                          /* name of the group */
00442         
00443         ThemeWireColor cs;                      /* color set to use when customCol == -1 */
00444 } bActionGroup;
00445 
00446 /* Action Group flags */
00447 typedef enum eActionGroup_Flag {
00448                 /* group is selected */
00449         AGRP_SELECTED   = (1<<0),
00450                 /* group is 'active' / last selected one */
00451         AGRP_ACTIVE     = (1<<1),
00452                 /* keyframes/channels belonging to it cannot be edited */
00453         AGRP_PROTECTED  = (1<<2),
00454                 /* for UI (DopeSheet), sub-channels are shown */
00455         AGRP_EXPANDED   = (1<<3),
00456                 /* sub-channels are not evaluated */
00457         AGRP_MUTED              = (1<<4),
00458                 /* sub-channels are not visible in Graph Editor */
00459         AGRP_NOTVISIBLE = (1<<5),
00460                 /* for UI (Graph Editor), sub-channels are shown */
00461         AGRP_EXPANDED_G = (1<<6),
00462         
00463         AGRP_TEMP               = (1<<30),
00464         AGRP_MOVED              = (1<<31)
00465 } eActionGroup_Flag;
00466 
00467 
00468 /* Actions -------------------------------------- */
00469 
00470 /* Action - reusable F-Curve 'bag'  (act) 
00471  *
00472  * This contains F-Curves that may affect settings from more than one ID blocktype and/or 
00473  * datablock (i.e. sub-data linked/used directly to the ID block that the animation data is linked to), 
00474  * but with the restriction that the other unrelated data (i.e. data that is not directly used or linked to
00475  * by the source ID block).
00476  *
00477  * It serves as a 'unit' of reusable animation information (i.e. keyframes/motion data), that 
00478  * affects a group of related settings (as defined by the user). 
00479  */
00480 typedef struct bAction {
00481         ID      id;                             /* ID-serialisation for relinking */
00482         
00483         ListBase curves;        /* function-curves (FCurve) */
00484         ListBase chanbase;      /* legacy data - Action Channels (bActionChannel) in pre-2.5 animation system */
00485         ListBase groups;        /* groups of function-curves (bActionGroup) */
00486         ListBase markers;       /* markers local to the Action (used to provide Pose-Libraries) */
00487         
00488         int flag;                       /* settings for this action */
00489         int active_marker;      /* index of the active marker */
00490         
00491         int idroot;                     /* type of ID-blocks that action can be assigned to (if 0, will be set to whatever ID first evaluates it) */
00492         int pad;
00493 } bAction;
00494 
00495 
00496 /* Flags for the action */
00497 typedef enum eAction_Flags {
00498                 /* flags for displaying in UI */
00499         ACT_COLLAPSED   = (1<<0),
00500         ACT_SELECTED    = (1<<1),
00501         
00502                 /* flags for evaluation/editing */
00503         ACT_MUTED               = (1<<9),
00504         ACT_PROTECTED   = (1<<10),
00505         ACT_DISABLED    = (1<<11)
00506 } eAction_Flags;
00507 
00508 
00509 /* ************************************************ */
00510 /* Action/Dopesheet Editor */
00511 
00512 /* Storage for Dopesheet/Grease-Pencil Editor data */
00513 typedef struct bDopeSheet {
00514         ID              *source;                        /* currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) */
00515         ListBase chanbase;                      /* cache for channels (only initialised when pinned) */  // XXX not used!
00516         
00517         struct Group *filter_grp;       /* object group for ADS_FILTER_ONLYOBGROUP filtering option */
00518         char searchstr[64];                     /* string to search for in displayed names of F-Curves for ADS_FILTER_BY_FCU_NAME filtering option */
00519         
00520         int filterflag;                         /* flags to use for filtering data */
00521         int flag;                                       /* standard flags */
00522 } bDopeSheet;
00523 
00524 
00525 /* DopeSheet filter-flag */
00526 typedef enum eDopeSheet_FilterFlag {
00527                 /* general filtering */
00528         ADS_FILTER_ONLYSEL                      = (1<<0),       /* only include channels relating to selected data */
00529         
00530                 /* temporary filters */
00531         ADS_FILTER_ONLYDRIVERS          = (1<<1),       /* for 'Drivers' editor - only include Driver data from AnimData */
00532         ADS_FILTER_ONLYNLA                      = (1<<2),       /* for 'NLA' editor - only include NLA data from AnimData */
00533         ADS_FILTER_SELEDIT                      = (1<<3),       /* for Graph Editor - used to indicate whether to include a filtering flag or not */
00534         
00535                 /* general filtering 2 */
00536         ADS_FILTER_SUMMARY                      = (1<<4),       /* for 'DopeSheet' Editors - include 'summary' line */
00537         ADS_FILTER_ONLYOBGROUP          = (1<<5),       /* only the objects in the specified object group get used */
00538         
00539                 /* datatype-based filtering */
00540         ADS_FILTER_NOSHAPEKEYS          = (1<<6),
00541         ADS_FILTER_NOMESH                       = (1<<7),
00542         ADS_FILTER_NOOBJ                        = (1<<8),       /* for animdata on object level, if we only want to concentrate on materials/etc. */
00543         ADS_FILTER_NOLAT                        = (1<<9),
00544         ADS_FILTER_NOCAM                        = (1<<10),
00545         ADS_FILTER_NOMAT                        = (1<<11),
00546         ADS_FILTER_NOLAM                        = (1<<12),
00547         ADS_FILTER_NOCUR                        = (1<<13),
00548         ADS_FILTER_NOWOR                        = (1<<14),
00549         ADS_FILTER_NOSCE                        = (1<<15),
00550         ADS_FILTER_NOPART                       = (1<<16),
00551         ADS_FILTER_NOMBA                        = (1<<17),
00552         ADS_FILTER_NOARM                        = (1<<18),
00553         ADS_FILTER_NONTREE                      = (1<<19),
00554         ADS_FILTER_NOTEX                        = (1<<20),
00555         
00556                 /* NLA-specific filters */
00557         ADS_FILTER_NLA_NOACT            = (1<<25),      /* if the AnimData block has no NLA data, don't include to just show Action-line */
00558         
00559                 /* general filtering 3 */
00560         ADS_FILTER_INCL_HIDDEN          = (1<<26),      /* include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
00561         ADS_FILTER_BY_FCU_NAME          = (1<<27),      /* for F-Curves, filter by the displayed name (i.e. to isolate all Location curves only) */
00562         
00563                 /* combination filters (some only used at runtime) */
00564         ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM|ADS_FILTER_NOMAT|ADS_FILTER_NOLAM|ADS_FILTER_NOCUR|ADS_FILTER_NOPART|ADS_FILTER_NOARM)
00565 } eDopeSheet_FilterFlag;        
00566 
00567 /* DopeSheet general flags */
00568 typedef enum eDopeSheet_Flag {
00569         ADS_FLAG_SUMMARY_COLLAPSED      = (1<<0)        /* when summary is shown, it is collapsed, so all other channels get hidden */
00570 } eDopeSheet_Flag;
00571 
00572 
00573 
00574 /* Action Editor Space. This is defined here instead of in DNA_space_types.h */
00575 typedef struct SpaceAction {
00576         struct SpaceLink *next, *prev;
00577         ListBase regionbase;            /* storage of regions for inactive spaces */
00578         int spacetype;
00579         float blockscale;
00580 
00581         short blockhandler[8];
00582 
00583         View2D v2d;                                     /* depricated, copied to region */
00584         
00585         bAction         *action;                /* the currently active action */
00586         bDopeSheet      ads;                    /* the currently active context (when not showing action) */
00587         
00588         char  mode, autosnap;           /* mode: editing context; autosnap: automatic keyframe snapping mode   */
00589         short flag;                             /* flag: bitmapped settings; */
00590         float timeslide;                        /* for Time-Slide transform mode drawing - current frame? */
00591 } SpaceAction;
00592 
00593 /* SpaceAction flag */
00594 typedef enum eSAction_Flag {
00595                 /* during transform (only set for TimeSlide) */
00596         SACTION_MOVING  = (1<<0),       
00597                 /* show sliders */
00598         SACTION_SLIDERS = (1<<1),       
00599                 /* draw time in seconds instead of time in frames */
00600         SACTION_DRAWTIME = (1<<2),
00601                 /* don't filter action channels according to visibility */
00602         //SACTION_NOHIDE = (1<<3), // XXX depreceated... old animation system
00603                 /* don't kill overlapping keyframes after transform */
00604         SACTION_NOTRANSKEYCULL = (1<<4),
00605                 /* don't include keyframes that are out of view */
00606         //SACTION_HORIZOPTIMISEON = (1<<5), // XXX depreceated... old irrelevant trick
00607                 /* show pose-markers (local to action) in Action Editor mode  */
00608         SACTION_POSEMARKERS_SHOW = (1<<6),
00609                 /* don't draw action channels using group colors (where applicable) */
00610         SACTION_NODRAWGCOLORS = (1<<7), // XXX depreceated... irrelevant for current groups implementation
00611                 /* don't draw current frame number beside frame indicator */
00612         SACTION_NODRAWCFRANUM = (1<<8),
00613                 /* temporary flag to force channel selections to be synced with main */
00614         SACTION_TEMP_NEEDCHANSYNC = (1<<9),
00615                 /* don't perform realtime updates */
00616         SACTION_NOREALTIMEUPDATES =     (1<<10),
00617                 /* move markers as well as keyframes */
00618         SACTION_MARKERS_MOVE = (1<<11)
00619 } eSAction_Flag;        
00620 
00621 /* SpaceAction Mode Settings */
00622 typedef enum eAnimEdit_Context {
00623                 /* action on the active object */
00624         SACTCONT_ACTION = 0,
00625                 /* list of all shapekeys on the active object, linked with their F-Curves */
00626         SACTCONT_SHAPEKEY,
00627                 /* editing of gpencil data */
00628         SACTCONT_GPENCIL,
00629                 /* dopesheet (default) */
00630         SACTCONT_DOPESHEET
00631 } eAnimEdit_Context;
00632 
00633 /* SpaceAction AutoSnap Settings (also used by other Animation Editors) */
00634 typedef enum eAnimEdit_AutoSnap {
00635                 /* no auto-snap */
00636         SACTSNAP_OFF = 0,       
00637                 /* snap to 1.0 frame/second intervals */
00638         SACTSNAP_STEP,
00639                 /* snap to actual frames/seconds (nla-action time) */
00640         SACTSNAP_FRAME,
00641                 /* snap to nearest marker */
00642         SACTSNAP_MARKER
00643 } eAnimEdit_AutoSnap;
00644 
00645 
00646 /* ************************************************ */
00647 /* Legacy Data */
00648 
00649 /* WARNING: Action Channels are now depreceated... they were part of the old animation system!
00650  *                (ONLY USED FOR DO_VERSIONS...)
00651  * 
00652  * Action Channels belong to Actions. They are linked with an IPO block, and can also own 
00653  * Constraint Channels in certain situations. 
00654  *
00655  * Action-Channels can only belong to one group at a time, but they still live the Action's
00656  * list of achans (to preserve backwards compatability, and also minimise the code
00657  * that would need to be recoded). Grouped achans are stored at the start of the list, according
00658  * to the position of the group in the list, and their position within the group. 
00659  */
00660 typedef struct bActionChannel {
00661         struct bActionChannel   *next, *prev;
00662         bActionGroup                    *grp;                                   /* Action Group this Action Channel belongs to */
00663         
00664         struct Ipo                              *ipo;                                   /* IPO block this action channel references */
00665         ListBase                                constraintChannels;             /* Constraint Channels (when Action Channel represents an Object or Bone) */
00666         
00667         int             flag;                   /* settings accessed via bitmapping */
00668         char    name[32];               /* channel name */
00669         int             temp;                   /* temporary setting - may be used to indicate group that channel belongs to during syncing  */
00670 } bActionChannel;
00671 
00672 /* Action Channel flags (ONLY USED FOR DO_VERSIONS...) */
00673 typedef enum ACHAN_FLAG {
00674         ACHAN_SELECTED  = (1<<0),
00675         ACHAN_HILIGHTED = (1<<1),
00676         ACHAN_HIDDEN    = (1<<2),
00677         ACHAN_PROTECTED = (1<<3),
00678         ACHAN_EXPANDED  = (1<<4),
00679         ACHAN_SHOWIPO   = (1<<5),
00680         ACHAN_SHOWCONS  = (1<<6),
00681         ACHAN_MOVED     = (1<<31)
00682 } ACHAN_FLAG; 
00683 
00684 #endif