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:
authorJoseph Eagar <joeedh@gmail.com>2022-04-13 09:31:04 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-04-13 09:33:36 +0300
commitd1418dd151b1b446fd97108959ef0ba5c0404424 (patch)
tree36502624b47f4e716e889699882a14c93366c405
parent567aad9dcdcbcb4d05d4945a4cd493f809fcfe8c (diff)
Updated voxel remesher defaults
Implements T97163 Newly created meshes have all voxel remesher checkboxes aside from Fix Poles enabled. Startup files updated with versioning. Reviewed By @JulianKaspar Differential Revision: https://developer.blender.org/D14608 Ref D14608
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c3
-rw-r--r--source/blender/makesdna/DNA_mesh_defaults.h2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c3
3 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 000f132adcb..cec6d520af3 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -532,11 +532,12 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) {
/* Match default for new meshes. */
mesh->smoothresh = DEG2RADF(30);
+ /* Match voxel remesher options for all existing meshes in templates. */
+ mesh->flag |= ME_REMESH_REPROJECT_VOLUME | ME_REMESH_REPROJECT_PAINT_MASK | ME_REMESH_REPROJECT_SCULPT_FACE_SETS | ME_REMESH_REPROJECT_VERTEX_COLORS;
/* For Sculpting template. */
if (app_template && STREQ(app_template, "Sculpting")) {
mesh->remesh_voxel_size = 0.035f;
- mesh->flag |= ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME;
BKE_mesh_smooth_flag_set(mesh, false);
}
else {
diff --git a/source/blender/makesdna/DNA_mesh_defaults.h b/source/blender/makesdna/DNA_mesh_defaults.h
index 079bda42009..30fe387b05a 100644
--- a/source/blender/makesdna/DNA_mesh_defaults.h
+++ b/source/blender/makesdna/DNA_mesh_defaults.h
@@ -22,7 +22,7 @@
.remesh_voxel_adaptivity = 0.0f, \
.face_sets_color_seed = 0, \
.face_sets_color_default = 1, \
- .flag = ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME, \
+ .flag = ME_REMESH_REPROJECT_VOLUME | ME_REMESH_REPROJECT_PAINT_MASK | ME_REMESH_REPROJECT_SCULPT_FACE_SETS | ME_REMESH_REPROJECT_VERTEX_COLORS, \
.editflag = ME_EDIT_MIRROR_VERTEX_GROUPS \
}
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 22275df61f9..52af96e355d 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -3451,20 +3451,17 @@ static void rna_def_mesh(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_remesh_preserve_paint_mask", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_REMESH_REPROJECT_PAINT_MASK);
- RNA_def_property_boolean_default(prop, false);
RNA_def_property_ui_text(prop, "Preserve Paint Mask", "Keep the current mask on the new mesh");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop = RNA_def_property(srna, "use_remesh_preserve_sculpt_face_sets", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_REMESH_REPROJECT_SCULPT_FACE_SETS);
- RNA_def_property_boolean_default(prop, false);
RNA_def_property_ui_text(
prop, "Preserve Face Sets", "Keep the current Face Sets on the new mesh");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
prop = RNA_def_property(srna, "use_remesh_preserve_vertex_colors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_REMESH_REPROJECT_VERTEX_COLORS);
- RNA_def_property_boolean_default(prop, false);
RNA_def_property_ui_text(
prop, "Preserve Vertex Colors", "Keep the current vertex colors on the new mesh");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");