Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-02-26 12:22:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-26 13:17:17 +0300
commit6ebad22091c06f1e11e5efca7f19b1800e91fe09 (patch)
treeaaf2c2f991c6c6322e96d01b773ef1e804c708fd /source/blender/editors/transform/transform_ops.c
parent0a87bf67849be91d4b874862815c8ca9e93a4047 (diff)
Transform: fix rotate redo behavior
- Add XYZ option. - Orientation now works as expected. Now a redo for rotation works logically, setting the axis to Z & the orientation to view. Resolves T57205
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r--source/blender/editors/transform/transform_ops.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 31a8c8559b6..d2b59eac4f1 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -542,20 +542,20 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
{
PropertyRNA *prop;
- if (flags & P_AXIS) {
- prop = RNA_def_property(ot->srna, "axis", PROP_FLOAT, PROP_DIRECTION);
- RNA_def_property_array(prop, 3);
- /* Make this not hidden when there's a nice axis selection widget */
- RNA_def_property_flag(prop, PROP_HIDDEN);
- RNA_def_property_ui_text(prop, "Axis", "The axis around which the transformation occurs");
- }
+ if (flags & P_ORIENT_AXIS) {
+ prop = RNA_def_property(ot->srna, "orient_axis", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Axis", "");
+ RNA_def_property_enum_default(prop, 2);
+ RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items);
- if (flags & P_AXIS_ORTHO) {
- prop = RNA_def_property(ot->srna, "axis_ortho", PROP_FLOAT, PROP_DIRECTION);
- RNA_def_property_array(prop, 3);
- /* Make this not hidden when there's a nice axis selection widget */
- RNA_def_property_flag(prop, PROP_HIDDEN);
- RNA_def_property_ui_text(prop, "Axis", "The orthogonal axis around which the transformation occurs");
+ prop = RNA_def_float_matrix(ot->srna, "orient_matrix", 3, 3, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
+ RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+ }
+ if (flags & P_ORIENT_AXIS_ORTHO) {
+ prop = RNA_def_property(ot->srna, "orient_axis_ortho", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Axis Ortho", "");
+ RNA_def_property_enum_default(prop, 1);
+ RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items);
}
if (flags & P_CONSTRAINT) {
@@ -783,7 +783,7 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(
- ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER);
+ ot, P_ORIENT_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER);
}
static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
@@ -856,7 +856,7 @@ static void TRANSFORM_OT_shear(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
- Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_AXIS | P_AXIS_ORTHO);
+ Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_ORIENT_AXIS | P_ORIENT_AXIS_ORTHO);
}
static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot)
@@ -1099,7 +1099,7 @@ static void TRANSFORM_OT_rotate_normal(struct wmOperatorType *ot)
RNA_def_float_rotation(ot->srna, "value", 0, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI * 2, M_PI * 2);
- Transform_Properties(ot, P_AXIS | P_CONSTRAINT | P_MIRROR);
+ Transform_Properties(ot, P_ORIENT_AXIS | P_CONSTRAINT | P_MIRROR);
}
@@ -1129,7 +1129,7 @@ static void TRANSFORM_OT_transform(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(
- ot, P_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER);
+ ot, P_ORIENT_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER);
}
static int transform_from_gizmo_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))