diff options
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 38 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 49 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mirror.c | 10 |
4 files changed, 30 insertions, 73 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 1dd3c545b79..82685e15913 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -569,43 +569,27 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.operator("object.meshdeform_bind", text="Bind") def MIRROR(self, layout, ob, md): + axis_text = "XYZ" split = layout.split(factor=0.33) col = split.column() col.label(text="Axis:") - col.prop(md, "use_x") - col.prop(md, "use_y") - col.prop(md, "use_z") + for i, text in enumerate(axis_text): + col.prop(md, "use_axis", text=text, index=i) col = split.column() col.label(text="Bisect:") - - col_x = col.column() - col_x.prop(md, "use_bisect_x") - col_x.active = md.use_x - - col_y = col.column() - col_y.prop(md, "use_bisect_y") - col_y.active = md.use_y - - col_z = col.column() - col_z.prop(md, "use_bisect_z") - col_z.active = md.use_z + for i, text in enumerate(axis_text): + colsub = col.column() + colsub.prop(md, "use_bisect_axis", text=text, index=i) + colsub.active = md.use_axis[i] col = split.column() col.label(text="Flip:") - - col_fx = col.column() - col_fx.prop(md, "flip_x") - col_fx.active = md.use_bisect_x and md.use_x - - col_fy = col.column() - col_fy.prop(md, "flip_y") - col_fy.active = md.use_bisect_y and md.use_y - - col_fz = col.column() - col_fz.prop(md, "flip_z") - col_fz.active = md.use_bisect_z and md.use_z + for i, text in enumerate(axis_text): + colsub = col.column() + colsub.prop(md, "use_bisect_flip_axis", text=text, index=i) + colsub.active = md.use_axis[i] and md.use_bisect_axis[i] layout.separator() diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index e2f963b7a1b..c5045caec9c 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -324,9 +324,9 @@ enum { MOD_MIR_BISECT_AXIS_X = (1 << 8), MOD_MIR_BISECT_AXIS_Y = (1 << 9), MOD_MIR_BISECT_AXIS_Z = (1 << 10), - MOD_MIR_FLIP_AXIS_X = (1 << 11), - MOD_MIR_FLIP_AXIS_Y = (1 << 12), - MOD_MIR_FLIP_AXIS_Z = (1 << 13), + MOD_MIR_BISECT_FLIP_AXIS_X = (1 << 11), + MOD_MIR_BISECT_FLIP_AXIS_Y = (1 << 12), + MOD_MIR_BISECT_FLIP_AXIS_Z = (1 << 13), }; typedef struct EdgeSplitModifierData { diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index c2fa89891b0..c1c2ceca7bc 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1541,19 +1541,22 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MirrorModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR); - prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); + prop = RNA_def_property(srna, "use_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X); - RNA_def_property_ui_text(prop, "X", "Enable X axis mirror"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Mirror Axis", "Enable axis mirror"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y); - RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror"); + prop = RNA_def_property(srna, "use_bisect_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_BISECT_AXIS_X); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Bisect Axis", "Cuts the mesh across the mirrorplane"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z); - RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror"); + prop = RNA_def_property(srna, "use_bisect_flip_axis", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_BISECT_FLIP_AXIS_X); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Bisect Flip Axis", "Flips the direction of the slice"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop = RNA_def_property(srna, "use_clip", PROP_BOOLEAN, PROP_NONE); @@ -1561,36 +1564,6 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Clip", "Prevent vertices from going through the mirror during transform"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_bisect_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_BISECT_AXIS_X); - RNA_def_property_ui_text(prop, "X", "Cuts the mesh across the mirrorplane"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop = RNA_def_property(srna, "use_bisect_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_BISECT_AXIS_Y); - RNA_def_property_ui_text(prop, "Y", "Cuts the mesh across the mirrorplane"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop = RNA_def_property(srna, "use_bisect_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_BISECT_AXIS_Z); - RNA_def_property_ui_text(prop, "Z", "Cuts the mesh across the mirrorplane"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop = RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_FLIP_AXIS_X); - RNA_def_property_ui_text(prop, "X", "Flips the direction of the slice"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop = RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_FLIP_AXIS_Y); - RNA_def_property_ui_text(prop, "Y", "Flips the direction of the slice"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop = RNA_def_property(srna, "flip_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_FLIP_AXIS_Z); - RNA_def_property_ui_text(prop, "Z", "Flips the direction of the slice"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "use_mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP); RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)"); diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index df08122aebf..659ac0dee30 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -88,10 +88,10 @@ static Mesh *doBiscetOnMirrorPlane( int axis, float mirrormat[4][4]) { - bool do_flip_axis = ( - (axis == 0 && mmd->flag & MOD_MIR_FLIP_AXIS_X) || - (axis == 1 && mmd->flag & MOD_MIR_FLIP_AXIS_Y) || - (axis == 2 && mmd->flag & MOD_MIR_FLIP_AXIS_Z)); + bool do_bisect_flip_axis = ( + (axis == 0 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_X) || + (axis == 1 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_Y) || + (axis == 2 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_Z)); const float bisect_distance = 0.001; @@ -132,7 +132,7 @@ static Mesh *doBiscetOnMirrorPlane( copy_v3_v3(plane_offset, plane); plane_offset[3] = plane[3] - bisect_distance; - if (do_flip_axis) { + if (do_bisect_flip_axis) { negate_v3(plane_offset); } |