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-03-20 08:41:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-20 08:50:48 +0300
commitf889050aea70c2ff3c36c8c8600dd2b02d5e9f91 (patch)
tree3b6bd799859f8bdd44e4056bf2a7df499618c07f /source/blender
parentdc800154b619de64d2de7dae5f81154af343ccd2 (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')
-rw-r--r--source/blender/editors/transform/transform.c26
-rw-r--r--source/blender/editors/transform/transform_ops.c9
2 files changed, 20 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");
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 8886a0d49e5..648e616a27c 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -521,6 +521,15 @@ static bool transform_poll_property(const bContext *UNUSED(C), wmOperator *op, c
PropertyRNA *prop_con = RNA_struct_find_property(op->ptr, "orient_type");
if (prop_con != NULL && (prop_con != prop)) {
if (STRPREFIX(prop_id, "constraint")) {
+
+ /* Special case: show constraint axis if we don't have values,
+ * needed for mirror operator. */
+ if (STREQ(prop_id, "constraint_axis") &&
+ (RNA_struct_find_property(op->ptr, "value") == NULL))
+ {
+ return true;
+ }
+
return false;
}
}