diff options
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform.c | 12 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 16 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 2 |
3 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 113c8cc723a..43cee8b5ef3 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2024,6 +2024,18 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) RNA_property_boolean_set_array(op->ptr, prop, constraint_axis); } + + { + const char *prop_id = NULL; + if (t->mode == TFM_SHRINKFATTEN) { + prop_id = "use_even_offset"; + } + + if (prop_id && (prop = RNA_struct_find_property(op->ptr, prop_id))) { + + RNA_property_boolean_set(op->ptr, prop, (t->flag & T_ALT_TRANSFORM) != 0); + } + } } /* note: caller needs to free 't' on a 0 return */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 243b54b04d5..f943ac5ee42 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -80,6 +80,7 @@ #include "BKE_editmesh.h" #include "BKE_tracking.h" #include "BKE_mask.h" +#include "BKE_utildefines.h" #include "ED_anim_api.h" #include "ED_armature.h" @@ -1069,6 +1070,8 @@ static int initTransInfo_edit_pet_to_flag(const int proportional) * Setup internal data, mouse, vectors * * \note \a op and \a event can be NULL + * + * \see #saveTransform does the reverse. */ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event) { @@ -1160,6 +1163,19 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->spacetype = sa->spacetype; } + /* handle T_ALT_TRANSFORM initialization, we may use for different operators */ + if (op) { + const char *prop_id = NULL; + if (t->mode == TFM_SHRINKFATTEN) { + prop_id = "use_even_offset"; + } + + if (prop_id && (prop = RNA_struct_find_property(op->ptr, prop_id)) && + RNA_property_is_set(op->ptr, prop)) + { + BKE_BIT_TEST_SET(t->flag, RNA_property_boolean_get(op->ptr, prop), T_ALT_TRANSFORM); + } + } if (t->spacetype == SPACE_VIEW3D) { View3D *v3d = sa->spacedata.first; diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 477b76e87e2..782b9753a30 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -791,6 +791,8 @@ static void TRANSFORM_OT_shrink_fatten(struct wmOperatorType *ot) RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX); + RNA_def_boolean(ot->srna, "use_even_offset", true, "Offset Even", "Scale the offset to give more even thickness"); + Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP); } |