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:
authorCampbell Barton <ideasman42@gmail.com>2017-10-01 13:12:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-01 13:21:24 +0300
commit22ecea9e38e708056262f3d98b0d0c6210da75cf (patch)
tree1551b8cc4a35863bd9098a2bb12cdb161c8196f7 /source/blender/blenkernel
parent9139532dc8655f23b59da3ee399cc01d1fa2b7b2 (diff)
Weight Paint: restore non-spray functionality
When painting with spray disabled - we need to re-apply on top of the original each time. Applying the soc-2016-pbvh-painting branch removed this. While I'd added back a simple previous weight array, this won't work when multiple groups are painted at once.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_paint.h5
-rw-r--r--source/blender/blenkernel/intern/paint.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 6cae8d28947..fe7461c810d 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -228,9 +228,12 @@ typedef struct SculptSession {
/* Vertex aligned arrays of weights. */
float *previous_accum;
- float *previous_weight;
/* Keep track of how much each vertex has been painted (non-airbrush only). */
float *alpha_weight;
+
+ /* Needed to continuously re-apply over the same weights (VP_SPRAY disabled).
+ * Lazy initialize as needed (flag is set to 1 to tag it as uninitialized). */
+ struct MDeformVert *dvert_prev;
} wpaint;
//struct {
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 849fb5c6b5a..c2f1d05dd89 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -49,6 +49,7 @@
#include "BKE_brush.h"
#include "BKE_colortools.h"
+#include "BKE_deform.h"
#include "BKE_main.h"
#include "BKE_context.h"
#include "BKE_crazyspace.h"
@@ -686,8 +687,12 @@ void BKE_sculptsession_free_vwpaint_data(struct SculptSession *ss)
gmap = &ss->mode.wpaint.gmap;
MEM_SAFE_FREE(ss->mode.wpaint.alpha_weight);
- MEM_SAFE_FREE(ss->mode.wpaint.previous_weight);
MEM_SAFE_FREE(ss->mode.wpaint.previous_accum);
+ if (ss->mode.wpaint.dvert_prev) {
+ BKE_defvert_array_free_elems(ss->mode.wpaint.dvert_prev, ss->totvert);
+ MEM_freeN(ss->mode.wpaint.dvert_prev);
+ ss->mode.wpaint.dvert_prev = NULL;
+ }
}
else {
return;