diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-02 22:04:31 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-02 22:04:31 +0400 |
commit | 89320c911eef0968f2c9c642da14a48f6a1bd5ae (patch) | |
tree | 9b1f3d5dd0d64de8d69376139c5c0fe8b9c7aa02 /source/blender/blenkernel/intern/multires.c | |
parent | 9cbbc9d3afd8742a36969736f648743d4f943393 (diff) |
Sculpt & modifiers: patch by Sergey Sharybin, with modifications by me.
Fixes various crashes and redraw problems, most noticeable new feature
is that you can now sculpt on a multires mesh with deforming modifiers
preceding it.
I've left out support for sculpting on multires with enabled modifiers
following it, in this case only the base mesh can be sculpted now. The
code changes needed to do this are just too ugly in my opinion, would
need a more torough redesign which I don't think we should try now. In
my opinion this is also not really an important case, since it's going
to be incredibly slow anyway to run a modifier on a high res mesh while
sculpting.
So, to summarize current state:
* Fastest sculpting: base mesh with no modifiers or multires with only
modifiers preceding it.
* Slower sculpting: base mesh with modifiers, depends on the speed of
the modifiers.
* Not supported: multires mesh with modifiers following it.
Diffstat (limited to 'source/blender/blenkernel/intern/multires.c')
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index ad069be50f5..ee8a74d6fbb 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -654,7 +654,9 @@ static void multiresModifier_update(DerivedMesh *dm) int i, j, numGrids, highGridSize, lowGridSize; /* create subsurf DM from original mesh at high level */ - cddm = CDDM_from_mesh(me, NULL); + if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform); + else cddm = CDDM_from_mesh(me, NULL); + highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0); /* create multires DM from original mesh and displacements */ @@ -705,7 +707,9 @@ static void multiresModifier_update(DerivedMesh *dm) else { DerivedMesh *cddm, *subdm; - cddm = CDDM_from_mesh(me, NULL); + if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform); + else cddm = CDDM_from_mesh(me, NULL); + subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0); cddm->release(cddm); |