diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-08-31 12:43:42 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-08-31 14:22:12 +0300 |
commit | 82ef1edce4a2152c59a093705be2fcccc3256ab2 (patch) | |
tree | dce14bd9191b7e4ae517b892c13a9d38f5f8cf35 /source/blender/makesdna/DNA_anim_types.h | |
parent | 9821dd72bac89053ce0213e68116855910c681e9 (diff) |
Drivers: support explicit euler rotation order for transform channels.
The meaning of the euler angles completely depends on the rotation
order. Currently the rotation order is taken from the target of the
driver variable, which somewhat makes sense if it uses euler, but if
it's quaternion, then the order is always set to XYZ.
Add a new option for the rotation channels of the Transform Channel
driver variables that defaults to the old behavior, but allows setting
an explicit rotation order.
Diffstat (limited to 'source/blender/makesdna/DNA_anim_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 1718aabc51d..8c25d470a36 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -319,6 +319,10 @@ typedef struct DriverTarget { /** Transform channel index (for DVAR_TYPE_TRANSFORM_CHAN.)*/ short transChan; + /** Rotation channel calculation type. */ + char rotation_mode; + char _pad[7]; + /** * Flags for the validity of the target * (NOTE: these get reset every time the types change). @@ -362,6 +366,23 @@ typedef enum eDriverTarget_TransformChannels { MAX_DTAR_TRANSCHAN_TYPES, } eDriverTarget_TransformChannels; +/* Rotation channel mode for Driver Targets */ +typedef enum eDriverTarget_RotationMode { + /** Automatic euler mode. */ + DTAR_ROTMODE_AUTO = 0, + + /** Explicit euler rotation modes - must sync with BLI_math_rotation.h defines. */ + DTAR_ROTMODE_EULER_XYZ = 1, + DTAR_ROTMODE_EULER_XZY, + DTAR_ROTMODE_EULER_YXZ, + DTAR_ROTMODE_EULER_YZX, + DTAR_ROTMODE_EULER_ZXY, + DTAR_ROTMODE_EULER_ZYX, + + DTAR_ROTMODE_EULER_MIN = DTAR_ROTMODE_EULER_XYZ, + DTAR_ROTMODE_EULER_MAX = DTAR_ROTMODE_EULER_ZYX, +} eDriverTarget_RotationMode; + /* --- */ /* maximum number of driver targets per variable */ |