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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-09-13 18:43:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-09-14 15:43:56 +0300
commit9a1ed283650720410b145ee5175188f3ef5107a9 (patch)
tree545e1c6f51f793d9eb9fadbcc00ad69b6ae63716
parentf827e3c84bc9ec585d16a796b614f4b1694e4507 (diff)
Sculpting: Fix wrong object was using for PBVH
The function is supposed to be called for original object. Draw manager abuses this a bit, will solve later by moving PBVH (re)creation to dependency graph. At the time being, stop adding object evaluation to draw manager, this is really where it does not belong to.
-rw-r--r--source/blender/blenkernel/intern/paint.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index edea8784715..443e7b242ad 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -875,6 +875,17 @@ void BKE_sculpt_update_mesh_elements(
Depsgraph *depsgraph, Scene *scene, Sculpt *sd, Object *ob,
bool need_pmap, bool need_mask)
{
+ /* TODO(sergey): Make sure ob points to an original object. This is what it
+ * is supposed to be pointing to. The issue is, currently draw code takes
+ * care of PBVH creation, even though this is something up to dependency
+ * graph.
+ * Probably, we need to being back logic which was checking for sculpt mode
+ * and (re)create PBVH if needed in that case, similar to how DerivedMesh
+ * was handling this.
+ */
+ ob = DEG_get_original_object(ob);
+ Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
+
SculptSession *ss = ob->sculpt;
Mesh *me = BKE_object_get_original_mesh(ob);
MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
@@ -911,7 +922,7 @@ void BKE_sculpt_update_mesh_elements(
ss->kb = (mmd == NULL) ? BKE_keyblock_from_object(ob) : NULL;
- Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH);
+ Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob_eval, CD_MASK_BAREMESH);
/* VWPaint require mesh info for loop lookup, so require sculpt mode here */
if (mmd && ob->mode & OB_MODE_SCULPT) {