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/blenkernel/intern/pbvh.c
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/blenkernel/intern/pbvh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 61caccccf90..ae20e5d023d 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -565,6 +565,7 @@ void BKE_pbvh_build_mesh(PBVH *bvh,
bvh->pdata = pdata;
bvh->face_sets_color_seed = mesh->face_sets_color_seed;
+ bvh->face_sets_color_default = mesh->face_sets_color_default;
BB_reset(&cb);
@@ -1304,6 +1305,7 @@ static void pbvh_update_draw_buffer_cb(void *__restrict userdata,
CustomData_get_layer(bvh->ldata, CD_MLOOPCOL),
CustomData_get_layer(bvh->pdata, CD_SCULPT_FACE_SETS),
bvh->face_sets_color_seed,
+ bvh->face_sets_color_default,
node->face_vert_indices,
update_flags);
break;
@@ -2615,9 +2617,10 @@ void BKE_pbvh_update_normals(PBVH *bvh, struct SubdivCCG *subdiv_ccg)
MEM_SAFE_FREE(nodes);
}
-void BKE_pbvh_face_sets_color_seed_set(PBVH *bvh, int seed)
+void BKE_pbvh_face_sets_color_set(PBVH *bvh, int seed, int color_default)
{
bvh->face_sets_color_seed = seed;
+ bvh->face_sets_color_default = color_default;
}
/**