small feature request from zanqdo, merging in the mirror modifier is now optional...
authorMichael Fox <mfoxdogg@gmail.com>
Thu, 10 Feb 2011 00:05:03 +0000 (00:05 +0000)
committerMichael Fox <mfoxdogg@gmail.com>
Thu, 10 Feb 2011 00:05:03 +0000 (00:05 +0000)
release/scripts/ui/properties_data_modifier.py
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/modifiers/intern/MOD_mirror.c

index b3060e0f3372e33e6b06b4593e2d2586564d2f38..7a1ea160abceb751fa6b943e211007b0f35066d5 100644 (file)
@@ -363,7 +363,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
             col.prop(md, "use_dynamic_bind")
 
     def MIRROR(self, layout, ob, md):
-        layout.prop(md, "merge_threshold")
         split = layout.split(percentage=0.25)
 
         col = split.column()
@@ -374,6 +373,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
 
         col = split.column()
         col.label(text="Options:")
+        col.prop(md, "use_mirror_merge", text="Merge")
         col.prop(md, "use_clip", text="Clipping")
         col.prop(md, "use_mirror_vertex_groups", text="Vertex Groups")
 
@@ -383,6 +383,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
         col.prop(md, "use_mirror_v", text="V")
 
         col = layout.column()
+        
+        if md.use_mirror_merge == True:
+            col.prop(md, "merge_threshold")
         col.label(text="Mirror Object:")
         col.prop(md, "mirror_object", text="")
 
index 914a980cd79348ec28a6308d4acb91bb195a7f01..f219f54cc2520175de7a1774f1e8e3b647fd13b7 100644 (file)
@@ -235,6 +235,7 @@ typedef struct MirrorModifierData {
 #define MOD_MIR_AXIS_Y         (1<<4)
 #define MOD_MIR_AXIS_Z         (1<<5)
 #define MOD_MIR_VGROUP         (1<<6)
+#define MOD_MIR_MERGE          (1<<7)
 
 typedef struct EdgeSplitModifierData {
        ModifierData modifier;
index 15da48a82d476865cf246b856bb00ca90b883a13..6045b920e01391cd8d82eee072d2a1738b506d03 100644 (file)
@@ -776,6 +776,11 @@ static void rna_def_modifier_mirror(BlenderRNA *brna)
        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)");
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
+       
+       prop= RNA_def_property(srna, "use_mirror_merge", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MERGE);
+       RNA_def_property_ui_text(prop, "Merge Verticies", "Merge verticies within the merge threshold");
+       RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
        prop= RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
index 9546bf1300b95fd36887220f435a676d9c503012..19f21ce655f802c7b105b4fc020de5ed5cac5b06 100644 (file)
@@ -142,7 +142,11 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
                if (mmd->mirror_ob) {
                        mul_m4_v3(mtx, co);
                }
-               isShared = ABS(co[axis])<=tolerance;
+               
+               if(mmd->flag & MOD_MIR_MERGE)
+                       isShared = ABS(co[axis])<=tolerance;
+               else
+                       isShared = 0;
                
                /* Because the topology result (# of vertices) must be the same if
                * the mesh data is overridden by vertex cos, have to calc sharedness
@@ -154,8 +158,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
                
                indexMap[i][0] = numVerts - 1;
                indexMap[i][1] = !isShared;
-               
-               if(isShared) {
+               //
+               if(isShared ) {
                        co[axis] = 0;
                        if (mmd->mirror_ob) {
                                mul_m4_v3(imtx, co);