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:
authorPablo Dobarro <pablodp606@gmail.com>2020-03-09 22:10:56 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-03-09 22:11:18 +0300
commit18e3615a68191c9f35303139d109972744499565 (patch)
tree1120a51ab295715c8a2711b45335ceda18909654 /source/blender/makesdna
parent0dfb4ac1ff9a81864d44f91e259a829d80863a80 (diff)
Face Sets: Use white color for a default Face Set to enable the overlay
This introduces a variable to store a face set ID which is going to be rendered white. When initializing a mesh or randomizing the colors, this variable gets updated to always render a white face set. This way the face set overlay can be enabled without adding colors to the mesh if face sets are not in use. After creating the first face set, new colors are generated randomly like usual. The face set stored as default does not have any special meaning for tools or brushes, it just affects the rendering color. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7035
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_mesh_defaults.h1
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h5
-rw-r--r--source/blender/makesdna/DNA_view3d_defaults.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_mesh_defaults.h b/source/blender/makesdna/DNA_mesh_defaults.h
index 275bcc64562..abcdf8bf57b 100644
--- a/source/blender/makesdna/DNA_mesh_defaults.h
+++ b/source/blender/makesdna/DNA_mesh_defaults.h
@@ -36,6 +36,7 @@
.remesh_voxel_size = 0.1f, \
.remesh_voxel_adaptivity = 0.0f, \
.face_sets_color_seed = 0, \
+ .face_sets_color_default = 1, \
.flag = ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME, \
}
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index c0c7c0465bb..5f915d4516b 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -197,9 +197,12 @@ typedef struct Mesh {
float remesh_voxel_adaptivity;
char remesh_mode;
- char _pad1[7];
+ char _pad1[3];
int face_sets_color_seed;
+ /* Stores the initial Face Set to be rendered white. This way the overlay can be enabled by
+ * default and Face Sets can be used without affecting the color of the mesh. */
+ int face_sets_color_default;
/** Deprecated multiresolution modeling data, only keep for loading old files. */
struct Multires *mr DNA_DEPRECATED;
diff --git a/source/blender/makesdna/DNA_view3d_defaults.h b/source/blender/makesdna/DNA_view3d_defaults.h
index c139d4dc0d1..afade37d0c8 100644
--- a/source/blender/makesdna/DNA_view3d_defaults.h
+++ b/source/blender/makesdna/DNA_view3d_defaults.h
@@ -59,7 +59,7 @@
/* Intentionally different to vertex/paint mode, \
* we typically want to see shading too. */ \
.sculpt_mode_mask_opacity = 0.75f, \
- .sculpt_mode_face_sets_opacity = 0.0f, \
+ .sculpt_mode_face_sets_opacity = 1.0f, \
\
.edit_flag = V3D_OVERLAY_EDIT_FACES | V3D_OVERLAY_EDIT_SEAMS | \
V3D_OVERLAY_EDIT_SHARP | V3D_OVERLAY_EDIT_FREESTYLE_EDGE | \