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-11-05 01:39:36 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-11-06 01:40:30 +0300
commit02677ec4e0fadc9b2bec694fd14155ea16e48adf (patch)
tree11a859bbec72e8d2cdf7aed02b164ef99c30f457 /source/blender/editors/sculpt_paint/sculpt.c
parente041d0fc02b1f0f8e9bc4436accb1ced374aeadd (diff)
Fix T81915: Draw Face Sets not working with deformed sculpt mesh
The draw face sets brush uses the poly center when used in meshes to increase its precision when working in low poly geometry. For this to work with deformed meshes, the deformed coordinates from the PBVH should be used instead. Reviewed By: sergey Maniphest Tasks: T81915 Differential Revision: https://developer.blender.org/D9424
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 56b5a494df0..875f24837c1 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -292,6 +292,21 @@ void SCULPT_active_vertex_normal_get(SculptSession *ss, float normal[3])
SCULPT_vertex_normal_get(ss, SCULPT_active_vertex_get(ss), normal);
}
+MVert *SCULPT_mesh_deformed_mverts_get(SculptSession *ss)
+{
+ switch (BKE_pbvh_type(ss->pbvh)) {
+ case PBVH_FACES:
+ if (ss->shapekey_active || ss->deform_modifiers_active) {
+ return BKE_pbvh_get_verts(ss->pbvh);
+ }
+ return ss->mvert;
+ case PBVH_BMESH:
+ case PBVH_GRIDS:
+ return NULL;
+ }
+ return NULL;
+}
+
float *SCULPT_brush_deform_target_vertex_co_get(SculptSession *ss,
const int deform_target,
PBVHVertexIter *iter)