|
Blender
V2.59
|
00001 /* 00002 * $Id: DNA_constraint_types.h 34941 2011-02-17 20:48:12Z jesterking $ 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 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): 2007, Joshua Leung, major recode 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 * Constraint DNA data 00029 */ 00030 00031 #ifndef DNA_CONSTRAINT_TYPES_H 00032 #define DNA_CONSTRAINT_TYPES_H 00033 00038 #include "DNA_ID.h" 00039 #include "DNA_listBase.h" 00040 00041 struct Action; 00042 struct Text; 00043 struct Ipo; 00044 00045 /* channels reside in Object or Action (ListBase) constraintChannels */ 00046 // XXX depreceated... old AnimSys 00047 typedef struct bConstraintChannel { 00048 struct bConstraintChannel *next, *prev; 00049 struct Ipo *ipo; 00050 short flag; 00051 char name[30]; 00052 } bConstraintChannel; 00053 00054 /* A Constraint */ 00055 typedef struct bConstraint { 00056 struct bConstraint *next, *prev; 00057 00058 void *data; /* Constraint data (a valid constraint type) */ 00059 short type; /* Constraint type */ 00060 short flag; /* Flag - General Settings */ 00061 00062 char ownspace; /* Space that owner should be evaluated in */ 00063 char tarspace; /* Space that target should be evaluated in (only used if 1 target) */ 00064 00065 char name[30]; /* Constraint name */ 00066 00067 float enforce; /* Amount of influence exherted by constraint (0.0-1.0) */ 00068 float headtail; /* Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail*/ 00069 int pad; 00070 00071 struct Ipo *ipo; /* local influence ipo or driver */ // XXX depreceated for 2.5... old animation system hack 00072 00073 /* below are readonly fields that are set at runtime by the solver for use in the GE (only IK atm) */ 00074 float lin_error; /* residual error on constraint expressed in blender unit*/ 00075 float rot_error; /* residual error on constraint expressed in radiant */ 00076 } bConstraint; 00077 00078 00079 /* Multiple-target constraints --------------------- */ 00080 00081 /* This struct defines a constraint target. 00082 * It is used during constraint solving regardless of how many targets the 00083 * constraint has. 00084 */ 00085 typedef struct bConstraintTarget { 00086 struct bConstraintTarget *next, *prev; 00087 00088 struct Object *tar; /* object to use as target */ 00089 char subtarget[32]; /* subtarget - pchan or vgroup name */ 00090 00091 float matrix[4][4]; /* matrix used during constraint solving - should be cleared before each use */ 00092 00093 short space; /* space that target should be evaluated in (overrides bConstraint->tarspace) */ 00094 short flag; /* runtime settings (for editor, etc.) */ 00095 short type; /* type of target (B_CONSTRAINT_OB_TYPE) */ 00096 short rotOrder; /* rotation order for target (as defined in BLI_math.h) */ 00097 } bConstraintTarget; 00098 00099 /* bConstraintTarget -> flag */ 00100 typedef enum B_CONSTRAINT_TARGET_FLAG { 00101 CONSTRAINT_TAR_TEMP = (1<<0) /* temporary target-struct that needs to be freed after use */ 00102 } B_CONSTRAINT_TARGET_FLAG; 00103 00104 /* bConstraintTarget/bConstraintOb -> type */ 00105 typedef enum B_CONSTRAINT_OB_TYPE { 00106 CONSTRAINT_OBTYPE_OBJECT = 1, /* string is "" */ 00107 CONSTRAINT_OBTYPE_BONE, /* string is bone-name */ 00108 CONSTRAINT_OBTYPE_VERT, /* string is vertex-group name */ 00109 CONSTRAINT_OBTYPE_CV /* string is vertex-group name - is not available until curves get vgroups */ 00110 } B_CONSTRAINT_OB_TYPE; 00111 00112 00113 00114 /* Python Script Constraint */ 00115 typedef struct bPythonConstraint { 00116 struct Text *text; /* text-buffer (containing script) to execute */ 00117 IDProperty *prop; /* 'id-properties' used to store custom properties for constraint */ 00118 00119 int flag; /* general settings/state indicators accessed by bitmapping */ 00120 int tarnum; /* number of targets - usually only 1-3 are needed */ 00121 00122 ListBase targets; /* a list of targets that this constraint has (bConstraintTarget-s) */ 00123 00124 struct Object *tar; /* target from previous implementation (version-patch sets this to NULL on file-load) */ 00125 char subtarget[32]; /* subtarger from previous implentation (version-patch sets this to "" on file-load) */ 00126 } bPythonConstraint; 00127 00128 00129 /* Inverse-Kinematics (IK) constraint 00130 This constraint supports a variety of mode determine by the type field 00131 according to B_CONSTRAINT_IK_TYPE. 00132 Some fields are used by all types, some are specific to some types 00133 This is indicated in the comments for each field 00134 */ 00135 typedef struct bKinematicConstraint { 00136 struct Object *tar; /* All: target object in case constraint needs a target */ 00137 short iterations; /* All: Maximum number of iterations to try */ 00138 short flag; /* All & CopyPose: some options Like CONSTRAINT_IK_TIP */ 00139 short rootbone; /* All: index to rootbone, if zero go all the way to mother bone */ 00140 short max_rootbone; /* CopyPose: for auto-ik, maximum length of chain */ 00141 char subtarget[32]; /* All: String to specify sub-object target */ 00142 struct Object *poletar; /* All: Pole vector target */ 00143 char polesubtarget[32]; /* All: Pole vector sub-object target */ 00144 float poleangle; /* All: Pole vector rest angle */ 00145 float weight; /* All: Weight of constraint in IK tree */ 00146 float orientweight; /* CopyPose: Amount of rotation a target applies on chain */ 00147 float grabtarget[3]; /* CopyPose: for target-less IK */ 00148 short type; /* subtype of IK constraint: B_CONSTRAINT_IK_TYPE */ 00149 short mode; /* Distance: how to limit in relation to clamping sphere: LIMITDIST_.. */ 00150 float dist; /* Distance: distance (radius of clamping sphere) from target */ 00151 } bKinematicConstraint; 00152 00153 typedef enum B_CONSTRAINT_IK_TYPE { 00154 CONSTRAINT_IK_COPYPOSE = 0, /* 'standard' IK constraint: match position and/or orientation of target */ 00155 CONSTRAINT_IK_DISTANCE /* maintain distance with target */ 00156 } B_CONSTRAINT_IK_TYPE; 00157 00158 00159 /* Spline IK Constraint 00160 * Aligns 'n' bones to the curvature defined by the curve, 00161 * with the chain ending on the bone that owns this constraint, 00162 * and starting on the nth parent. 00163 */ 00164 typedef struct bSplineIKConstraint { 00165 /* target(s) */ 00166 struct Object *tar; /* curve object (with follow path enabled) which drives the bone chain */ 00167 00168 /* binding details */ 00169 float *points; /* array of numpoints items, denoting parametric positions along curve that joints should follow */ 00170 short numpoints; /* number of points to bound in points array */ 00171 short chainlen; /* number of bones ('n') that are in the chain */ 00172 00173 /* settings */ 00174 short flag; /* general settings for constraint */ 00175 short xzScaleMode; /* method used for determining the x & z scaling of the bones */ 00176 } bSplineIKConstraint; 00177 00178 00179 /* Single-target subobject constraints --------------------- */ 00180 00181 /* Track To Constraint */ 00182 typedef struct bTrackToConstraint { 00183 struct Object *tar; 00184 int reserved1; /* I'll be using reserved1 and reserved2 as Track and Up flags, not sure if that's what they were intented for anyway. Not sure either if it would create backward incompatibility if I were to rename them. - theeth*/ 00185 int reserved2; 00186 int flags; 00187 int pad; 00188 char subtarget[32]; 00189 } bTrackToConstraint; 00190 00191 /* Copy Rotation Constraint */ 00192 typedef struct bRotateLikeConstraint { 00193 struct Object *tar; 00194 int flag; 00195 int reserved1; 00196 char subtarget[32]; 00197 } bRotateLikeConstraint; 00198 00199 /* Copy Location Constraint */ 00200 typedef struct bLocateLikeConstraint { 00201 struct Object *tar; 00202 int flag; 00203 int reserved1; 00204 char subtarget[32]; 00205 } bLocateLikeConstraint; 00206 00207 /* Copy Scale Constraint */ 00208 typedef struct bSizeLikeConstraint { 00209 struct Object *tar; 00210 int flag; 00211 int reserved1; 00212 char subtarget[32]; 00213 } bSizeLikeConstraint; 00214 00215 /* Maintain Volume Constraint */ 00216 typedef struct bSameVolumeConstraint { 00217 int flag; 00218 float volume; 00219 } bSameVolumeConstraint; 00220 00221 /* Copy Transform Constraint */ 00222 typedef struct bTransLikeConstraint { 00223 struct Object *tar; 00224 char subtarget[32]; 00225 } bTransLikeConstraint; 00226 00227 /* Floor Constraint */ 00228 typedef struct bMinMaxConstraint { 00229 struct Object *tar; 00230 int minmaxflag; 00231 float offset; 00232 int flag; 00233 short sticky, stuck, pad1, pad2; /* for backward compatability */ 00234 float cache[3]; 00235 char subtarget[32]; 00236 } bMinMaxConstraint; 00237 00238 /* Action Constraint */ 00239 typedef struct bActionConstraint { 00240 struct Object *tar; 00241 short type; /* what transform 'channel' drives the result */ 00242 short local; /* was used in versions prior to the Constraints recode */ 00243 int start; 00244 int end; 00245 float min; 00246 float max; 00247 int pad; 00248 struct bAction *act; 00249 char subtarget[32]; 00250 } bActionConstraint; 00251 00252 /* Locked Axis Tracking constraint */ 00253 typedef struct bLockTrackConstraint { 00254 struct Object *tar; 00255 int trackflag; 00256 int lockflag; 00257 char subtarget[32]; 00258 } bLockTrackConstraint; 00259 00260 /* Damped Tracking constraint */ 00261 typedef struct bDampTrackConstraint { 00262 struct Object *tar; 00263 int trackflag; 00264 int pad; 00265 char subtarget[32]; 00266 } bDampTrackConstraint; 00267 00268 /* Follow Path constraints */ 00269 typedef struct bFollowPathConstraint { 00270 struct Object *tar; /* Must be path object */ 00271 00272 float offset; /* Offset in time on the path (in frames), when NOT using 'fixed position' */ 00273 float offset_fac; /* Parametric offset factor defining position along path, when using 'fixed position' */ 00274 00275 int followflag; 00276 00277 short trackflag; 00278 short upflag; 00279 } bFollowPathConstraint; 00280 00281 /* Stretch to constraint */ 00282 typedef struct bStretchToConstraint { 00283 struct Object *tar; 00284 int volmode; 00285 int plane; 00286 float orglength; 00287 float bulge; 00288 char subtarget[32]; 00289 } bStretchToConstraint; 00290 00291 /* Rigid Body constraint */ 00292 typedef struct bRigidBodyJointConstraint { 00293 struct Object *tar; 00294 struct Object *child; 00295 int type; 00296 float pivX; 00297 float pivY; 00298 float pivZ; 00299 float axX; 00300 float axY; 00301 float axZ; 00302 float minLimit[6]; 00303 float maxLimit[6]; 00304 float extraFz; 00305 short flag; 00306 short pad; 00307 short pad1; 00308 short pad2; 00309 } bRigidBodyJointConstraint; 00310 00311 /* Clamp-To Constraint */ 00312 typedef struct bClampToConstraint { 00313 struct Object *tar; /* 'target' must be a curve */ 00314 int flag; /* which axis/plane to compare owner's location on */ 00315 int flag2; /* for legacy reasons, this is flag2. used for any extra settings */ 00316 } bClampToConstraint; 00317 00318 /* Child Of Constraint */ 00319 typedef struct bChildOfConstraint { 00320 struct Object *tar; /* object which will act as parent (or target comes from) */ 00321 int flag; /* settings */ 00322 int pad; 00323 float invmat[4][4]; /* parent-inverse matrix to use */ 00324 char subtarget[32]; /* string to specify a subobject target */ 00325 } bChildOfConstraint; 00326 00327 /* Generic Transform->Transform Constraint */ 00328 typedef struct bTransformConstraint { 00329 struct Object *tar; /* target (i.e. 'driver' object/bone) */ 00330 char subtarget[32]; 00331 00332 short from, to; /* can be loc(0) , rot(1), or size(2) */ 00333 char map[3]; /* defines which target-axis deform is copied by each owner-axis */ 00334 char expo; /* extrapolate motion? if 0, confine to ranges */ 00335 00336 float from_min[3]; /* from_min/max defines range of target transform */ 00337 float from_max[3]; /* to map on to to_min/max range. */ 00338 00339 float to_min[3]; /* range of motion on owner caused by target */ 00340 float to_max[3]; 00341 } bTransformConstraint; 00342 00343 /* Pivot Constraint */ 00344 typedef struct bPivotConstraint { 00345 /* Pivot Point: 00346 * Either target object + offset, or just offset is used 00347 */ 00348 struct Object *tar; /* target object (optional) */ 00349 char subtarget[32]; /* subtarget name (optional) */ 00350 float offset[3]; /* offset from the target to use, regardless of whether it exists */ 00351 00352 /* Rotation-driven activation: 00353 * This option provides easier one-stop setups for footrolls 00354 */ 00355 short rotAxis; /* rotation axes to consider for this (ePivotConstraint_Axis) */ 00356 00357 /* General flags */ 00358 short flag; /* ePivotConstraint_Flag */ 00359 } bPivotConstraint; 00360 00361 /* transform limiting constraints - zero target ---------------------------- */ 00362 /* Limit Location Constraint */ 00363 typedef struct bLocLimitConstraint { 00364 float xmin, xmax; 00365 float ymin, ymax; 00366 float zmin, zmax; 00367 short flag; 00368 short flag2; 00369 } bLocLimitConstraint; 00370 00371 /* Limit Rotation Constraint */ 00372 typedef struct bRotLimitConstraint { 00373 float xmin, xmax; 00374 float ymin, ymax; 00375 float zmin, zmax; 00376 short flag; 00377 short flag2; 00378 } bRotLimitConstraint; 00379 00380 /* Limit Scaling Constraint */ 00381 typedef struct bSizeLimitConstraint { 00382 float xmin, xmax; 00383 float ymin, ymax; 00384 float zmin, zmax; 00385 short flag; 00386 short flag2; 00387 } bSizeLimitConstraint; 00388 00389 /* Limit Distance Constraint */ 00390 typedef struct bDistLimitConstraint { 00391 struct Object *tar; 00392 char subtarget[32]; 00393 00394 float dist; /* distance (radius of clamping sphere) from target */ 00395 float soft; /* distance from clamping-sphere to start applying 'fade' */ 00396 00397 short flag; /* settings */ 00398 short mode; /* how to limit in relation to clamping sphere */ 00399 int pad; 00400 } bDistLimitConstraint; 00401 00402 /* ShrinkWrap Constraint */ 00403 typedef struct bShrinkwrapConstraint { 00404 struct Object *target; 00405 float dist; /* distance to kept from target */ 00406 short shrinkType; /* shrink type (look on MOD shrinkwrap for values) */ 00407 char projAxis; /* axis to project over UP_X, UP_Y, UP_Z */ 00408 char pad[9]; 00409 } bShrinkwrapConstraint; 00410 00411 00412 /* ------------------------------------------ */ 00413 00414 /* bConstraint->type 00415 * - Do not ever change the order of these, or else files could get 00416 * broken as their correct value cannot be resolved 00417 */ 00418 typedef enum eBConstraint_Types { 00419 CONSTRAINT_TYPE_NULL = 0, /* Invalid/legacy constraint */ 00420 CONSTRAINT_TYPE_CHILDOF, /* Unimplemented non longer :) - during constraints recode, Aligorith */ 00421 CONSTRAINT_TYPE_TRACKTO, 00422 CONSTRAINT_TYPE_KINEMATIC, 00423 CONSTRAINT_TYPE_FOLLOWPATH, 00424 CONSTRAINT_TYPE_ROTLIMIT, /* Unimplemented no longer :) - Aligorith */ 00425 CONSTRAINT_TYPE_LOCLIMIT, /* Unimplemented no longer :) - Aligorith */ 00426 CONSTRAINT_TYPE_SIZELIMIT, /* Unimplemented no longer :) - Aligorith */ 00427 CONSTRAINT_TYPE_ROTLIKE, 00428 CONSTRAINT_TYPE_LOCLIKE, 00429 CONSTRAINT_TYPE_SIZELIKE, 00430 CONSTRAINT_TYPE_PYTHON, /* Unimplemented no longer :) - Aligorith. Scripts */ 00431 CONSTRAINT_TYPE_ACTION, 00432 CONSTRAINT_TYPE_LOCKTRACK, /* New Tracking constraint that locks an axis in place - theeth */ 00433 CONSTRAINT_TYPE_DISTLIMIT, /* limit distance */ 00434 CONSTRAINT_TYPE_STRETCHTO, /* claiming this to be mine :) is in tuhopuu bjornmose */ 00435 CONSTRAINT_TYPE_MINMAX, /* floor constraint */ 00436 CONSTRAINT_TYPE_RIGIDBODYJOINT, /* rigidbody constraint */ 00437 CONSTRAINT_TYPE_CLAMPTO, /* clampto constraint */ 00438 CONSTRAINT_TYPE_TRANSFORM, /* transformation (loc/rot/size -> loc/rot/size) constraint */ 00439 CONSTRAINT_TYPE_SHRINKWRAP, /* shrinkwrap (loc/rot) constraint */ 00440 CONSTRAINT_TYPE_DAMPTRACK, /* New Tracking constraint that minimises twisting */ 00441 CONSTRAINT_TYPE_SPLINEIK, /* Spline-IK - Align 'n' bones to a curve */ 00442 CONSTRAINT_TYPE_TRANSLIKE, /* Copy transform matrix */ 00443 CONSTRAINT_TYPE_SAMEVOL, /* Maintain volume during scaling */ 00444 CONSTRAINT_TYPE_PIVOT, /* Pivot Constraint */ 00445 00446 /* NOTE: no constraints are allowed to be added after this */ 00447 NUM_CONSTRAINT_TYPES 00448 } eBConstraint_Types; 00449 00450 /* bConstraint->flag */ 00451 /* flags 0x2 (1<<1) and 0x8 (1<<3) were used in past */ 00452 /* flag 0x20 (1<<5) was used to indicate that a constraint was evaluated using a 'local' hack for posebones only */ 00453 typedef enum eBConstraint_Flags { 00454 /* expand for UI */ 00455 CONSTRAINT_EXPAND = (1<<0), 00456 /* pre-check for illegal object name or bone name */ 00457 CONSTRAINT_DISABLE = (1<<2), 00458 /* to indicate which Ipo should be shown, maybe for 3d access later too */ 00459 CONSTRAINT_ACTIVE = (1<<4), 00460 /* to indicate that the owner's space should only be changed into ownspace, but not out of it */ 00461 CONSTRAINT_SPACEONCE = (1<<6), 00462 /* influence ipo is on constraint itself, not in action channel */ 00463 CONSTRAINT_OWN_IPO = (1<<7), 00464 /* indicates that constraint was added locally (i.e. didn't come from the proxy-lib) */ 00465 CONSTRAINT_PROXY_LOCAL = (1<<8), 00466 /* indicates that constraint is temporarily disabled (only used in GE) */ 00467 CONSTRAINT_OFF = (1<<9) 00468 } eBConstraint_Flags; 00469 00470 /* bConstraint->ownspace/tarspace */ 00471 typedef enum eBConstraint_SpaceTypes { 00472 /* default for all - worldspace */ 00473 CONSTRAINT_SPACE_WORLD = 0, 00474 /* for objects (relative to parent/without parent influence), 00475 * for bones (along normals of bone, without parent/restpositions) 00476 */ 00477 CONSTRAINT_SPACE_LOCAL, /* = 1 */ 00478 /* for posechannels - pose space */ 00479 CONSTRAINT_SPACE_POSE, /* = 2 */ 00480 /* for posechannels - local with parent */ 00481 CONSTRAINT_SPACE_PARLOCAL, /* = 3 */ 00482 /* for files from between 2.43-2.46 (should have been parlocal) */ 00483 CONSTRAINT_SPACE_INVALID /* = 4. do not exchange for anything! */ 00484 } eBConstraint_SpaceTypes; 00485 00486 /* bConstraintChannel.flag */ 00487 // XXX depreceated... old AnimSys 00488 typedef enum eConstraintChannel_Flags { 00489 CONSTRAINT_CHANNEL_SELECT = (1<<0), 00490 CONSTRAINT_CHANNEL_PROTECTED = (1<<1) 00491 } eConstraintChannel_Flags; 00492 00493 /* -------------------------------------- */ 00494 00495 /* bRotateLikeConstraint.flag */ 00496 typedef enum eCopyRotation_Flags { 00497 ROTLIKE_X = (1<<0), 00498 ROTLIKE_Y = (1<<1), 00499 ROTLIKE_Z = (1<<2), 00500 ROTLIKE_X_INVERT = (1<<4), 00501 ROTLIKE_Y_INVERT = (1<<5), 00502 ROTLIKE_Z_INVERT = (1<<6), 00503 ROTLIKE_OFFSET = (1<<7) 00504 } eCopyRotation_Flags; 00505 00506 /* bLocateLikeConstraint.flag */ 00507 typedef enum eCopyLocation_Flags { 00508 LOCLIKE_X = (1<<0), 00509 LOCLIKE_Y = (1<<1), 00510 LOCLIKE_Z = (1<<2), 00511 /* LOCLIKE_TIP is a depreceated option... use headtail=1.0f instead */ 00512 LOCLIKE_TIP = (1<<3), 00513 LOCLIKE_X_INVERT = (1<<4), 00514 LOCLIKE_Y_INVERT = (1<<5), 00515 LOCLIKE_Z_INVERT = (1<<6), 00516 LOCLIKE_OFFSET = (1<<7) 00517 } eCopyLocation_Flags; 00518 00519 /* bSizeLikeConstraint.flag */ 00520 typedef enum eCopyScale_Flags { 00521 SIZELIKE_X = (1<<0), 00522 SIZELIKE_Y = (1<<1), 00523 SIZELIKE_Z = (1<<2), 00524 SIZELIKE_OFFSET = (1<<3) 00525 } eCopyScale_Flags; 00526 00527 /* bSameVolumeConstraint.flag */ 00528 typedef enum eSameVolume_Modes { 00529 SAMEVOL_X = 0, 00530 SAMEVOL_Y, 00531 SAMEVOL_Z 00532 } eSameVolume_Modes; 00533 00534 /* Locked-Axis Values (Locked Track) */ 00535 typedef enum eLockAxis_Modes { 00536 LOCK_X = 0, 00537 LOCK_Y, 00538 LOCK_Z 00539 } eLockAxis_Modes; 00540 00541 /* Up-Axis Values (TrackTo and Locked Track) */ 00542 typedef enum eUpAxis_Modes { 00543 UP_X = 0, 00544 UP_Y, 00545 UP_Z 00546 } eUpAxis_Modes; 00547 00548 /* Tracking axis (TrackTo, Locked Track, Damped Track) and minmax (floor) constraint */ 00549 typedef enum eTrackToAxis_Modes { 00550 TRACK_X = 0, 00551 TRACK_Y, 00552 TRACK_Z, 00553 TRACK_nX, 00554 TRACK_nY, 00555 TRACK_nZ 00556 } eTrackToAxis_Modes; 00557 00558 /* FollowPath flags */ 00559 typedef enum eFollowPath_Flags { 00560 FOLLOWPATH_FOLLOW = (1<<0), 00561 FOLLOWPATH_STATIC = (1<<1), 00562 FOLLOWPATH_RADIUS = (1<<2) 00563 } eFollowPath_Flags; 00564 00565 /* bTrackToConstraint->flags */ 00566 typedef enum eTrackTo_Flags { 00567 TARGET_Z_UP = (1<<0) 00568 } eTrackTo_Flags; 00569 00570 /* Strech To Constraint -> volmode */ 00571 typedef enum eStretchTo_VolMode { 00572 VOLUME_XZ = 0, 00573 VOLUME_X, 00574 VOLUME_Z, 00575 NO_VOLUME 00576 } eStretchTo_VolMode; 00577 00578 /* Stretch To Constraint -> plane mode */ 00579 typedef enum eStretchTo_PlaneMode { 00580 PLANE_X = 0, 00581 PLANE_Y, 00582 PLANE_Z 00583 } eStretchTo_PlaneMode; 00584 00585 /* Clamp-To Constraint ->flag */ 00586 typedef enum eClampTo_Modes { 00587 CLAMPTO_AUTO = 0, 00588 CLAMPTO_X, 00589 CLAMPTO_Y, 00590 CLAMPTO_Z 00591 } eClampTo_Modes; 00592 00593 /* ClampTo Constraint ->flag2 */ 00594 typedef enum eClampTo_Flags { 00595 CLAMPTO_CYCLIC = (1<<0) 00596 } eClampTo_Flags; 00597 00598 /* bKinematicConstraint->flag */ 00599 typedef enum eKinematic_Flags { 00600 CONSTRAINT_IK_TIP = (1<<0), 00601 CONSTRAINT_IK_ROT = (1<<1), 00602 /* targetless */ 00603 CONSTRAINT_IK_AUTO = (1<<2), 00604 /* autoik */ 00605 CONSTRAINT_IK_TEMP = (1<<3), 00606 CONSTRAINT_IK_STRETCH = (1<<4), 00607 CONSTRAINT_IK_POS = (1<<5), 00608 CONSTRAINT_IK_SETANGLE = (1<<6), 00609 CONSTRAINT_IK_GETANGLE = (1<<7), 00610 /* limit axis */ 00611 CONSTRAINT_IK_NO_POS_X = (1<<8), 00612 CONSTRAINT_IK_NO_POS_Y = (1<<9), 00613 CONSTRAINT_IK_NO_POS_Z = (1<<10), 00614 CONSTRAINT_IK_NO_ROT_X = (1<<11), 00615 CONSTRAINT_IK_NO_ROT_Y = (1<<12), 00616 CONSTRAINT_IK_NO_ROT_Z = (1<<13), 00617 /* axis relative to target */ 00618 CONSTRAINT_IK_TARGETAXIS = (1<<14) 00619 } eKinematic_Flags; 00620 00621 /* bSplineIKConstraint->flag */ 00622 typedef enum eSplineIK_Flags { 00623 /* chain has been attached to spline */ 00624 CONSTRAINT_SPLINEIK_BOUND = (1<<0), 00625 /* root of chain is not influenced by the constraint */ 00626 CONSTRAINT_SPLINEIK_NO_ROOT = (1<<1), 00627 /* bones in the chain should not scale to fit the curve */ 00628 CONSTRAINT_SPLINEIK_SCALE_LIMITED = (1<<2), 00629 /* evenly distribute the bones along the path regardless of length */ 00630 CONSTRAINT_SPLINEIK_EVENSPLITS = (1<<3), 00631 /* don't adjust the x and z scaling of the bones by the curve radius */ 00632 CONSTRAINT_SPLINEIK_NO_CURVERAD = (1<<4) 00633 } eSplineIK_Flags; 00634 00635 /* bSplineIKConstraint->xzScaleMode */ 00636 typedef enum eSplineIK_XZScaleModes { 00637 /* no x/z scaling */ 00638 CONSTRAINT_SPLINEIK_XZS_NONE = 0, 00639 /* bones in the chain should take their x/z scales from the original scaling */ 00640 CONSTRAINT_SPLINEIK_XZS_ORIGINAL, 00641 /* x/z scales are the inverse of the y-scale */ 00642 CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC 00643 } eSplineIK_XZScaleModes; 00644 00645 /* MinMax (floor) flags */ 00646 typedef enum eFloor_Flags { 00647 MINMAX_STICKY = (1<<0), 00648 MINMAX_STUCK = (1<<1), 00649 MINMAX_USEROT = (1<<2) 00650 } eFloor_Flags; 00651 00652 /* transform limiting constraints -> flag2 */ 00653 typedef enum eTransformLimits_Flags2 { 00654 /* not used anymore - for older Limit Location constraints only */ 00655 LIMIT_NOPARENT = (1<<0), 00656 /* for all Limit constraints - allow to be used during transform? */ 00657 LIMIT_TRANSFORM = (1<<1) 00658 } eTransformLimits_Flags2; 00659 00660 /* transform limiting constraints -> flag (own flags) */ 00661 typedef enum eTransformLimits_Flags { 00662 LIMIT_XMIN = (1<<0), 00663 LIMIT_XMAX = (1<<1), 00664 LIMIT_YMIN = (1<<2), 00665 LIMIT_YMAX = (1<<3), 00666 LIMIT_ZMIN = (1<<4), 00667 LIMIT_ZMAX = (1<<5) 00668 } eTransformLimits_Flags; 00669 00670 /* limit rotation constraint -> flag (own flags) */ 00671 typedef enum eRotLimit_Flags { 00672 LIMIT_XROT = (1<<0), 00673 LIMIT_YROT = (1<<1), 00674 LIMIT_ZROT = (1<<2) 00675 } eRotLimit_Flags; 00676 00677 /* distance limit constraint */ 00678 /* bDistLimitConstraint->flag */ 00679 typedef enum eDistLimit_Flag { 00680 LIMITDIST_USESOFT = (1<<0) 00681 } eDistLimit_Flag; 00682 00683 /* bDistLimitConstraint->mode */ 00684 typedef enum eDistLimit_Modes { 00685 LIMITDIST_INSIDE = 0, 00686 LIMITDIST_OUTSIDE, 00687 LIMITDIST_ONSURFACE 00688 } eDistLimit_Modes; 00689 00690 /* python constraint -> flag */ 00691 typedef enum ePyConstraint_Flags { 00692 PYCON_USETARGETS = (1<<0), 00693 PYCON_SCRIPTERROR = (1<<1) 00694 } ePyConstraint_Flags; 00695 00696 /* ChildOf Constraint -> flag */ 00697 typedef enum eChildOf_Flags { 00698 CHILDOF_LOCX = (1<<0), 00699 CHILDOF_LOCY = (1<<1), 00700 CHILDOF_LOCZ = (1<<2), 00701 CHILDOF_ROTX = (1<<3), 00702 CHILDOF_ROTY = (1<<4), 00703 CHILDOF_ROTZ = (1<<5), 00704 CHILDOF_SIZEX = (1<<6), 00705 CHILDOF_SIZEY = (1<<7), 00706 CHILDOF_SIZEZ = (1<<8), 00707 CHILDOF_ALL = 511 00708 } eChildOf_Flags; 00709 00710 /* Pivot Constraint */ 00711 /* Restrictions for Pivot Constraint axis to consider for enabling constraint */ 00712 typedef enum ePivotConstraint_Axis { 00713 /* do not consider this activity-clamping */ 00714 PIVOTCON_AXIS_NONE = -1, 00715 00716 /* consider -ve x-axis rotations */ 00717 PIVOTCON_AXIS_X_NEG, 00718 /* consider -ve y-axis rotations */ 00719 PIVOTCON_AXIS_Y_NEG, 00720 /* consider -ve z-axis rotations */ 00721 PIVOTCON_AXIS_Z_NEG, 00722 00723 /* consider +ve x-axis rotations */ 00724 PIVOTCON_AXIS_X, 00725 /* consider +ve y-axis rotations */ 00726 PIVOTCON_AXIS_Y, 00727 /* consider +ve z-axis rotations */ 00728 PIVOTCON_AXIS_Z 00729 } ePivotConstraint_Axis; 00730 00731 /* settings for Pivot Constraint in general */ 00732 typedef enum ePivotConstraint_Flag { 00733 /* offset is to be interpreted as being a fixed-point in space */ 00734 PIVOTCON_FLAG_OFFSET_ABS = (1<<0), 00735 /* rotation-based activation uses negative rotation to drive result */ 00736 PIVOTCON_FLAG_ROTACT_NEG = (1<<1) 00737 } ePivotConstraint_Flag; 00738 00739 /* Rigid-Body Constraint */ 00740 #define CONSTRAINT_DRAW_PIVOT 0x40 00741 #define CONSTRAINT_DISABLE_LINKED_COLLISION 0x80 00742 00743 /* important: these defines need to match up with PHY_DynamicTypes headerfile */ 00744 #define CONSTRAINT_RB_BALL 1 00745 #define CONSTRAINT_RB_HINGE 2 00746 #define CONSTRAINT_RB_CONETWIST 4 00747 #define CONSTRAINT_RB_VEHICLE 11 00748 #define CONSTRAINT_RB_GENERIC6DOF 12 00749 00750 #endif