From 93f940db2565ad5aa60cd4166dcd5f8e0f25b1b7 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Fri, 6 Sep 2019 11:54:34 +0300 Subject: Transformation Constraint: implement a Mix Mode option. Allow selecting how the new location/rotation/scale is combined with the existing transformation. This is most useful for rotation, which has multiple options, and scale, which previously could only replace. --- source/blender/makesdna/DNA_constraint_types.h | 35 +++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index d123cf21db9..83fc4d2a3f7 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -450,7 +450,12 @@ typedef struct bTransformConstraint { /** Output euler order override. */ char to_euler_order; - char _pad[6]; + /** Mixing modes for location, rotation, and scale. */ + char mix_mode_loc; + char mix_mode_rot; + char mix_mode_scale; + + char _pad[3]; /** From_min/max defines range of target transform. */ float from_min[3]; @@ -809,6 +814,34 @@ typedef enum eTransform_ToFrom { TRANS_SCALE = 2, } eTransform_ToFrom; +/* bTransformConstraint.mix_mode_loc */ +typedef enum eTransform_MixModeLoc { + /* Add component values together (default). */ + TRANS_MIXLOC_ADD = 0, + /* Replace component values. */ + TRANS_MIXLOC_REPLACE, +} eTransform_MixModeLoc; + +/* bTransformConstraint.mix_mode_rot */ +typedef enum eTransform_MixModeRot { + /* Add component values together (default). */ + TRANS_MIXROT_ADD = 0, + /* Replace component values. */ + TRANS_MIXROT_REPLACE, + /* Multiply the generated rotation on the left. */ + TRANS_MIXROT_BEFORE, + /* Multiply the generated rotation on the right. */ + TRANS_MIXROT_AFTER, +} eTransform_MixModeRot; + +/* bTransformConstraint.mix_mode_scale */ +typedef enum eTransform_MixModeScale { + /* Replace component values (default). */ + TRANS_MIXSCALE_REPLACE = 0, + /* Multiply component values together. */ + TRANS_MIXSCALE_MULTIPLY, +} eTransform_MixModeScale; + /* bSameVolumeConstraint.free_axis */ typedef enum eSameVolume_Axis { SAMEVOL_X = 0, -- cgit v1.2.3