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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-09-01 13:19:11 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-09-01 14:13:23 +0300
commit18d4ad5a59d32922f9d70b0412da0c830baceb17 (patch)
treec6e630362f87e533b5482ae7fd096ce49d0eeab6 /source/blender/makesdna/DNA_constraint_types.h
parentae43b1d51b4a0384c2197a6aca5cd2810c9283ff (diff)
Copy Rotation & Transform: add Euler order override options.
For reasons similar to drivers, it should be possible to set an explicit Euler rotation order in constraints that use Euler angles. The Transform constraint in a way approaches drivers in its use, in that it effectively alters channels using values of other channels after applying a fixed form mathematical expression. For this reason, instead of just specifying the euler order for its inputs, it uses the same enum as driver variables. However Quaternion components are converted to a weighted pseudo-angle representation as the rest of the constraint UI expects angles.
Diffstat (limited to 'source/blender/makesdna/DNA_constraint_types.h')
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index 17ce279f1b7..42d58cb34d0 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -271,7 +271,8 @@ typedef struct bTrackToConstraint {
typedef struct bRotateLikeConstraint {
struct Object *tar;
int flag;
- int reserved1;
+ char euler_order;
+ char _pad[3];
/** MAX_ID_NAME-2. */
char subtarget[64];
} bRotateLikeConstraint;
@@ -441,6 +442,13 @@ typedef struct bTransformConstraint {
/** Extrapolate motion? if 0, confine to ranges. */
char expo;
+ /** Input rotation type - uses the same values as driver targets. */
+ char from_rotation_mode;
+ /** Output euler order override. */
+ char to_euler_order;
+
+ char _pad[6];
+
/** From_min/max defines range of target transform. */
float from_min[3];
/** To map on to to_min/max range. */
@@ -715,6 +723,20 @@ typedef enum eConstraintChannel_Flags {
CONSTRAINT_CHANNEL_PROTECTED = (1 << 1),
} eConstraintChannel_Flags;
+/* Common enum for constraints that support override. */
+typedef enum eConstraint_EulerOrder {
+ /** Automatic euler mode. */
+ CONSTRAINT_EULER_AUTO = 0,
+
+ /** Explicit euler rotation modes - must sync with BLI_math_rotation.h defines. */
+ CONSTRAINT_EULER_XYZ = 1,
+ CONSTRAINT_EULER_XZY,
+ CONSTRAINT_EULER_YXZ,
+ CONSTRAINT_EULER_YZX,
+ CONSTRAINT_EULER_ZXY,
+ CONSTRAINT_EULER_ZYX,
+} eConstraint_EulerOrder;
+
/* -------------------------------------- */
/* bRotateLikeConstraint.flag */