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>2011-04-23 13:07:46 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-04-23 13:07:46 +0400
commitef14d310a056d2af484d866acaf512fa80f8442d (patch)
tree5627c2cb2145f20c8742573eed21bdabe35e178a /source/blender/blenkernel/intern/cdderivedmesh.c
parent8ca9dc3cfe8fbe53ba8cd2ac2af5df9b9ff0f104 (diff)
Sculpting on shapekeys
====================== All this work with sculpting on armatured/deformed mesh allowed to implement sculpting on non-locked keys very easy -- just use the same approach of propagating offsets from deformed PBVH to "sculpting layer". - If key is locked, then old logic would be used. - If there's multires modifier enabled, sculpting would happen on multires.
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index cbe7382c3a9..0b29b29e60f 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -197,8 +197,20 @@ static int can_pbvh_draw(Object *ob, DerivedMesh *dm)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
Mesh *me= ob->data;
+ int deformed= 0;
- if(ob->sculpt->modifiers_active) return 0;
+ /* active modifiers means extra deformation, which can't be handled correct
+ on bith of PBVH and sculpt "layer" levels, so use PBVH only for internal brush
+ stuff and show final DerivedMesh so user would see actual object shape */
+ deformed|= ob->sculpt->modifiers_active;
+
+ /* as in case with modifiers, we can't synchronize deformation made against
+ PBVH and non-locked keyblock, so also use PBVH only for brushes and
+ final DM to give final result to user */
+ deformed|= ob->sculpt->kb && (ob->shapeflag&OB_SHAPE_LOCK) == 0;
+
+ if(deformed)
+ return 0;
return (cddm->mvert == me->mvert) || ob->sculpt->kb;
}