diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-20 08:41:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-20 08:50:48 +0300 |
commit | f889050aea70c2ff3c36c8c8600dd2b02d5e9f91 (patch) | |
tree | 3b6bd799859f8bdd44e4056bf2a7df499618c07f /source/blender/editors/transform/transform.c | |
parent | dc800154b619de64d2de7dae5f81154af343ccd2 (diff) |
Fix T62757: Mirror operator fails for non-modal execution
Unlike most transform operators that use an orientation and values,
Mirror uses the constraint axes to define which axes are mirrored.
Now constraint axes are shown in this case.
Other changes:
- Use 'EXEC_DEFAULT' for mirror menu items.
- Show mirror on local axis when not in edit-mode since this is useful
in object mode too.
- Remove mirror vertex groups since this is in the vertex group menu and
this menu isn't currently used for general symmetry operators which
are currently in other menus.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c447d75657b..dd71084c51f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2633,7 +2633,10 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } /* Constraint init from operator */ - if (t->flag & T_MODAL) { + if ((t->flag & T_MODAL) || + /* For mirror operator the constraint axes are effectively the values. */ + (RNA_struct_find_property(op->ptr, "values") == NULL)) + { if ((prop = RNA_struct_find_property(op->ptr, "constraint_axis")) && RNA_property_is_set(op->ptr, prop)) { @@ -2644,21 +2647,14 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve if (constraint_axis[0] || constraint_axis[1] || constraint_axis[2]) { t->con.mode |= CON_APPLY; - /* Only for interactive operation, when redoing, ignore these values since the numbers - * will be constrainted already. */ - if (t->flag & T_MODAL) { - if (constraint_axis[0]) { - t->con.mode |= CON_AXIS0; - } - if (constraint_axis[1]) { - t->con.mode |= CON_AXIS1; - } - if (constraint_axis[2]) { - t->con.mode |= CON_AXIS2; - } + if (constraint_axis[0]) { + t->con.mode |= CON_AXIS0; } - else { - t->con.mode |= CON_AXIS0 | CON_AXIS1 | CON_AXIS2; + if (constraint_axis[1]) { + t->con.mode |= CON_AXIS1; + } + if (constraint_axis[2]) { + t->con.mode |= CON_AXIS2; } setUserConstraint(t, t->orientation.user, t->con.mode, "%s"); |