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-04-14 22:06:49 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-04-14 22:07:29 +0300
commit47f46637be1bef9672ede0ab6795a7e9ea97fc6a (patch)
tree224be030fb8f26e240715d74153e87d7668e3a7e /source/blender/blenkernel/intern/pbvh.c
parent7dd8c889f18e9df5c86356fedb063e5ff9261577 (diff)
Sculpt: New Layer Brush
The Layer brush was in Blender before 2.81, when the sculpt API was introduced. It had a huge amount of bugs and glitches which made it almost unusable for anything but the most trivial cases. Also, it needed some hacks in the code just to support the persistent base. The brush was completely rewritten using the Sculpt API. It fulfills the same use case as the old one, but it has: - All previous artifacts fixed - Simpler code - Persistent base now works with multires thanks to the sculpt API - Small cursor widget to preview the layer height - More controllable and smoother strength and deformation - More correct masking support - More predictable invert support. When using persistent base, the brush invert mode resets to layer height 0, instead of jumping from +1 to -1. The brush can still be inverted in the brush direction property. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7147
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 06622f0d009..977e70745a3 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -685,8 +685,6 @@ void BKE_pbvh_free(PBVH *bvh)
if (node->face_vert_indices) {
MEM_freeN((void *)node->face_vert_indices);
}
- BKE_pbvh_node_layer_disp_free(node);
-
if (node->bm_faces) {
BLI_gset_free(node->bm_faces, NULL);
}
@@ -722,13 +720,6 @@ void BKE_pbvh_free(PBVH *bvh)
MEM_freeN(bvh);
}
-void BKE_pbvh_free_layer_disp(PBVH *bvh)
-{
- for (int i = 0; i < bvh->totnode; i++) {
- BKE_pbvh_node_layer_disp_free(&bvh->nodes[i]);
- }
-}
-
static void pbvh_iter_begin(PBVHIter *iter,
PBVH *bvh,
BKE_pbvh_SearchCallback scb,
@@ -2768,26 +2759,6 @@ void BKE_pbvh_grids_update(
}
}
-/* Get the node's displacement layer, creating it if necessary */
-float *BKE_pbvh_node_layer_disp_get(PBVH *bvh, PBVHNode *node)
-{
- if (!node->layer_disp) {
- int totvert = 0;
- BKE_pbvh_node_num_verts(bvh, node, &totvert, NULL);
- node->layer_disp = MEM_callocN(sizeof(float) * totvert, "layer disp");
- }
- return node->layer_disp;
-}
-
-/* If the node has a displacement layer, free it and set to null */
-void BKE_pbvh_node_layer_disp_free(PBVHNode *node)
-{
- if (node->layer_disp) {
- MEM_freeN(node->layer_disp);
- node->layer_disp = NULL;
- }
-}
-
float (*BKE_pbvh_vert_coords_alloc(PBVH *pbvh))[3]
{
float(*vertCos)[3] = NULL;