diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-04 12:06:59 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-09-06 07:57:16 +0300 |
commit | f4056e9ec3a89afbc592af3e3d169d2d584a9937 (patch) | |
tree | b100222f89ce3dfbc723e7f0a975b30019c76427 /source/blender/makesdna/DNA_constraint_types.h | |
parent | 9972d6c3062010bea514c9e382b0a99275d63a89 (diff) |
Copy Rotation: implement new mixing modes that actually work.
Upon close inspection, the way the Offset mode works in the
Copy Rotation constraint makes no sense, and in fact, destroys
the rotation of its owner unless either it's single axis, or
the order is set specifically to `ZYX Euler`.
Since it can't simply be changed because of backward compatibility
concerns, replace the checkbox with a dropdown that provides a set
of new modes that actually make sense.
Specifically, add a mode that simply adds Euler components together,
and two options that use matrix multiplication in different order.
The Python use_offset property is replaced with compatibility stubs.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5640
Diffstat (limited to 'source/blender/makesdna/DNA_constraint_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_constraint_types.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 42d58cb34d0..a7f900ddc9b 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -272,7 +272,8 @@ typedef struct bRotateLikeConstraint { struct Object *tar; int flag; char euler_order; - char _pad[3]; + char mix_mode; + char _pad[2]; /** MAX_ID_NAME-2. */ char subtarget[64]; } bRotateLikeConstraint; @@ -747,9 +748,25 @@ typedef enum eCopyRotation_Flags { ROTLIKE_X_INVERT = (1 << 4), ROTLIKE_Y_INVERT = (1 << 5), ROTLIKE_Z_INVERT = (1 << 6), +#ifdef DNA_DEPRECATED ROTLIKE_OFFSET = (1 << 7), +#endif } eCopyRotation_Flags; +/* bRotateLikeConstraint.mix_mode */ +typedef enum eCopyRotation_MixMode { + /* Replace rotation channel values. */ + ROTLIKE_MIX_REPLACE = 0, + /* Legacy Offset mode - don't use. */ + ROTLIKE_MIX_OFFSET, + /* Add Euler components together. */ + ROTLIKE_MIX_ADD, + /* Multiply the copied rotation on the left. */ + ROTLIKE_MIX_BEFORE, + /* Multiply the copied rotation on the right. */ + ROTLIKE_MIX_AFTER, +} eCopyRotation_MixMode; + /* bLocateLikeConstraint.flag */ typedef enum eCopyLocation_Flags { LOCLIKE_X = (1 << 0), |