diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-29 09:01:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-29 09:01:16 +0300 |
commit | 1c92ffa1499cf692d7fd0802d761fcfa244afc83 (patch) | |
tree | abc96f6de1af1cdf0a681bce0fb7ff2f39b4ccab /source/blender/editors | |
parent | b4b1397ad9314b73ad58daaf70206b3e3f30c063 (diff) |
Transform: scale center override by aspect
Needed for image space.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 12 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 65c8f70c06d..179b68dd270 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1332,11 +1332,6 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } } - if (op && (prop = RNA_struct_find_property(op->ptr, "center_override")) && RNA_property_is_set(op->ptr, prop)) { - RNA_property_float_get_array(op->ptr, prop, t->center); - t->flag |= T_OVERRIDE_CENTER; - } - if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) && RNA_property_is_set(op->ptr, prop))) { @@ -1440,6 +1435,13 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve #endif setTransformViewAspect(t, t->aspect); + + if (op && (prop = RNA_struct_find_property(op->ptr, "center_override")) && RNA_property_is_set(op->ptr, prop)) { + RNA_property_float_get_array(op->ptr, prop, t->center); + mul_v3_v3(t->center, t->aspect); + t->flag |= T_OVERRIDE_CENTER; + } + setTransformViewMatrices(t); initNumInput(&t->num); } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 273d312eccb..1aa800f9fb1 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -570,7 +570,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) prop = RNA_def_property(ot->srna, "center_override", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 3); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - RNA_def_property_ui_text(prop, "Center", "Force using this center value (when set)"); + RNA_def_property_ui_text(prop, "Center Override", "Force using this center value (when set)"); } if ((flags & P_NO_DEFAULTS) == 0) { |