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-27 09:25:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-27 09:30:51 +0300
commit80ef7fbeb15f388097e2f778d41f7280e77779cf (patch)
treec9667f120a4c63c3da795214de60b83a02b6c98d /source/blender/editors/transform/transform_ops.c
parent3f23b5ffd5935b260c79dcf58781d976be814044 (diff)
Transform: refactor orientation naming and usasge
Transform orientation was previously related to constraints, recent changes meant it was used even when not constraining to an axis. Now transform orientation is separate from axis constraints.
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r--source/blender/editors/transform/transform_ops.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index ef2ecc25315..6a36f302405 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -515,7 +515,7 @@ static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, c
/* Orientation/Constraints. */
{
/* Hide orientation axis if no constraints are set, since it wont be used. */
- PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "constraint_orientation");
+ PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "orient_type");
if (prop_con != NULL && (prop_con != prop)) {
if (STRPREFIX(prop_id, "constraint")) {
return false;
@@ -555,25 +555,26 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items);
}
- if (flags & P_CONSTRAINT) {
- RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
+ if (flags & P_ORIENT_MATRIX) {
+ prop = RNA_def_property(ot->srna, "orient_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
+ RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
- /* Set by 'constraint_orientation' or gizmo which acts on non-standard orientation. */
- prop = RNA_def_float_matrix(ot->srna, "constraint_matrix", 3, 3, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f);
+ /* Set by 'orient_type' or gizmo which acts on non-standard orientation. */
+ 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);
- /* Only use 'constraint_matrix' when 'constraint_matrix_orientation == constraint_orientation',
+ /* Only use 'orient_matrix' when 'orient_matrix_type == orient_type',
* this allows us to reuse the orientation set by a gizmo for eg, without disabling the ability
* to switch over to other orientations. */
- prop = RNA_def_property(ot->srna, "constraint_matrix_orientation", PROP_ENUM, PROP_NONE);
+ prop = RNA_def_property(ot->srna, "orient_matrix_type", PROP_ENUM, PROP_NONE);
RNA_def_property_ui_text(prop, "Matrix Orientation", "");
RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
RNA_def_property_flag(prop, PROP_HIDDEN);
+ }
- prop = RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE);
- RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation");
- RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf);
-
+ if (flags & P_CONSTRAINT) {
+ RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", "");
}
if (flags & P_MIRROR) {
@@ -674,7 +675,7 @@ static void TRANSFORM_OT_translate(struct wmOperatorType *ot)
Transform_Properties(
ot,
- P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_OPTIONS |
+ P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_OPTIONS |
P_GPENCIL_EDIT | P_CURSOR_EDIT);
}
@@ -699,7 +700,7 @@ static void TRANSFORM_OT_resize(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(
- ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_GPENCIL_EDIT | P_CENTER);
+ ot, P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_GPENCIL_EDIT | P_CENTER);
}
static bool skin_resize_poll(bContext *C)
@@ -732,7 +733,8 @@ static void TRANSFORM_OT_skin_resize(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
- Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_NO_TEXSPACE);
+ Transform_Properties(
+ ot, P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_OPTIONS | P_NO_TEXSPACE);
}
static void TRANSFORM_OT_trackball(struct wmOperatorType *ot)
@@ -780,7 +782,7 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(
- ot, P_ORIENT_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER);
+ ot, P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_GEO_SNAP | P_GPENCIL_EDIT | P_CENTER);
}
static void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
@@ -853,7 +855,9 @@ 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_ORIENT_AXIS | P_ORIENT_AXIS_ORTHO);
+ Transform_Properties(
+ ot, P_ORIENT_AXIS | P_ORIENT_AXIS_ORTHO | P_ORIENT_MATRIX | P_PROPORTIONAL | P_MIRROR |
+ P_SNAP | P_GPENCIL_EDIT);
}
static void TRANSFORM_OT_push_pull(struct wmOperatorType *ot)
@@ -944,7 +948,7 @@ static void TRANSFORM_OT_mirror(struct wmOperatorType *ot)
ot->poll = ED_operator_screenactive;
ot->poll_property = transform_poll_property;
- Transform_Properties(ot, P_CONSTRAINT | P_PROPORTIONAL | P_GPENCIL_EDIT | P_CENTER);
+ Transform_Properties(ot, P_ORIENT_MATRIX | P_CONSTRAINT | P_PROPORTIONAL | P_GPENCIL_EDIT | P_CENTER);
}
static void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
@@ -1096,7 +1100,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_ORIENT_AXIS | P_CONSTRAINT | P_MIRROR);
+ Transform_Properties(ot, P_ORIENT_AXIS | P_ORIENT_MATRIX | P_CONSTRAINT | P_MIRROR);
}
@@ -1126,7 +1130,8 @@ static void TRANSFORM_OT_transform(struct wmOperatorType *ot)
WM_operatortype_props_advanced_begin(ot);
Transform_Properties(
- ot, P_ORIENT_AXIS | P_CONSTRAINT | P_PROPORTIONAL | P_MIRROR | P_ALIGN_SNAP | P_GPENCIL_EDIT | P_CENTER);
+ ot, P_ORIENT_AXIS | P_ORIENT_MATRIX | 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))