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-21 13:52:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-21 13:59:15 +0300
commit1bfbfa281046b9d600a1604794fce3aadd7f5cf7 (patch)
treef2d818a9ab7ebb4a5d08efa2cddd51a29c83751d /source/blender/editors/transform/transform_ops.c
parent510810c72d11ccb3b1b4b69e8f3e3a3189877862 (diff)
Transform: remove constraints from the redo panel
Constraint options had confusing behavior: - When non were pressed, the orientation was ignored. - When any were pressed, the orientation was used, but only unconstrained axed could be adjusted. Now constraining is only used for modal execution so there is no need to show these in the interface. When an orientation is selected, the XYZ values always transform using that space. Note, transform system should be refactored to support different orientations w/o having to use constraints. Addresses T57204
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r--source/blender/editors/transform/transform_ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 46ab11cee7b..31a8c8559b6 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -515,8 +515,8 @@ 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_axis");
- if (prop_con && !RNA_property_is_set(op->ptr, prop_con)) {
+ PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "constraint_orientation");
+ if (prop_con != NULL && (prop_con != prop)) {
if (STRPREFIX(prop_id, "constraint")) {
return false;
}
@@ -565,6 +565,14 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
prop = RNA_def_float_matrix(ot->srna, "constraint_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',
+ * 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);
+ 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);