diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_mirror.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 13 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_defaults.h | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 8 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_mirror.c | 7 |
7 files changed, 33 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index b4506b1a03c..08aea043fc7 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 18 +#define BLENDER_FILE_SUBVERSION 19 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenkernel/intern/mesh_mirror.c b/source/blender/blenkernel/intern/mesh_mirror.c index a22b52d68d5..93a2e9058fa 100644 --- a/source/blender/blenkernel/intern/mesh_mirror.c +++ b/source/blender/blenkernel/intern/mesh_mirror.c @@ -51,7 +51,7 @@ Mesh *BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(MirrorModifierData *mm (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.001f; + const float bisect_distance = mmd->bisect_threshold; Mesh *result; BMesh *bm; diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 916c4bf0cad..fe8e46e8928 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -2059,6 +2059,19 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + /* Set default value for the new bisect_threshold parameter in the mirror modifier. */ + if (!MAIN_VERSION_ATLEAST(bmain, 293, 19)) { + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { + if (md->type == eModifierType_Mirror) { + MirrorModifierData *mmd = (MirrorModifierData *)md; + /* This was the previous hard-coded value. */ + mmd->bisect_threshold = 0.001f; + } + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h index d8e48c51107..f6dac88051b 100644 --- a/source/blender/makesdna/DNA_modifier_defaults.h +++ b/source/blender/makesdna/DNA_modifier_defaults.h @@ -429,6 +429,7 @@ { \ .flag = MOD_MIR_AXIS_X | MOD_MIR_VGROUP, \ .tolerance = 0.001f, \ + .bisect_threshold = 0.001f, \ .uv_offset = {0.0f, 0.0f}, \ .uv_offset_copy = {0.0f, 0.0f}, \ .mirror_ob = NULL, \ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index ca6f1467d9c..c61e940190f 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -368,6 +368,8 @@ typedef struct MirrorModifierData { short axis DNA_DEPRECATED; short flag; float tolerance; + float bisect_threshold; + char _pad[4]; float uv_offset[2]; float uv_offset_copy[2]; struct Object *mirror_ob; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 67335b81a31..e3fb443951f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2226,6 +2226,14 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) prop, "Merge Distance", "Distance within which mirrored vertices are merged"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "bisect_threshold", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "bisect_threshold"); + RNA_def_property_range(prop, 0, FLT_MAX); + RNA_def_property_ui_range(prop, 0, 1, 0.01, 6); + RNA_def_property_ui_text( + prop, "Bisect Distance", "Distance from the bisect plane within which vertices are removed"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob"); RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror"); diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index afe94d8dead..b800ce7f803 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -165,6 +165,13 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_mirror_merge")); uiItemR(sub, ptr, "merge_threshold", 0, "", ICON_NONE); + bool is_bisect_set[3]; + RNA_boolean_get_array(ptr, "use_bisect_axis", is_bisect_set); + + sub = uiLayoutRow(col, true); + uiLayoutSetActive(sub, is_bisect_set[0] || is_bisect_set[1] || is_bisect_set[2]); + uiItemR(sub, ptr, "bisect_threshold", 0, IFACE_("Bisect Distance"), ICON_NONE); + modifier_panel_end(layout, ptr); } |