[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30670] branches/soc-2010-nicolasbishop/ source/blender: == Multires ==
Nicholas Bishop
nicholasbishop at gmail.com
Fri Jul 23 21:08:05 CEST 2010
Revision: 30670
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30670
Author: nicholasbishop
Date: 2010-07-23 21:08:05 +0200 (Fri, 23 Jul 2010)
Log Message:
-----------
== Multires ==
Small bug fixes
* When dropping down to multires level zero in sculpt mode, update PBVH from the CDDM
* When checking for modifiers in sculpt, ignore multires on level zero
Modified Paths:
--------------
branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/DerivedMesh.c
branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt.c
branches/soc-2010-nicolasbishop/source/blender/modifiers/intern/MOD_multires.c
Modified: branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/DerivedMesh.c 2010-07-23 18:47:54 UTC (rev 30669)
+++ branches/soc-2010-nicolasbishop/source/blender/blenkernel/intern/DerivedMesh.c 2010-07-23 19:08:05 UTC (rev 30670)
@@ -2214,6 +2214,10 @@
ob->derivedFinal->needsFree = 0;
ob->derivedDeform->needsFree = 0;
ob->lastDataMask = dataMask;
+
+ /* update the pbvh for paint */
+ if((ob->mode & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT)) && ob->paint)
+ ob->paint->pbvh= ob->derivedFinal->getPBVH(ob, ob->derivedFinal);
}
static void editmesh_build_data(Scene *scene, Object *obedit, EditMesh *em, CustomDataMask dataMask)
Modified: branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt.c 2010-07-23 18:47:54 UTC (rev 30669)
+++ branches/soc-2010-nicolasbishop/source/blender/editors/sculpt_paint/sculpt.c 2010-07-23 19:08:05 UTC (rev 30670)
@@ -126,11 +126,22 @@
else
md= modifiers_getVirtualModifierList(ob);
- /* exception for shape keys because we can edit those */
for(; md; md= md->next) {
- if(modifier_isEnabled(scene, md, eModifierMode_Realtime))
- if(md->type != eModifierType_ShapeKey)
+ if(modifier_isEnabled(scene, md, eModifierMode_Realtime)) {
+
+ /* exception for shape keys because we can edit those */
+ if(md->type == eModifierType_ShapeKey)
+ continue;
+
+ /*exception for multires on level zero, it's
+ not caught by the earlier multires check */
+ else if(md->type == eModifierType_Multires &&
+ ((MultiresModifierData*)md)->sculptlvl == 0)
+ continue;
+
+ else
return 1;
+ }
}
return 0;
Modified: branches/soc-2010-nicolasbishop/source/blender/modifiers/intern/MOD_multires.c
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/modifiers/intern/MOD_multires.c 2010-07-23 18:47:54 UTC (rev 30669)
+++ branches/soc-2010-nicolasbishop/source/blender/modifiers/intern/MOD_multires.c 2010-07-23 19:08:05 UTC (rev 30670)
@@ -62,7 +62,6 @@
static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
int useRenderParams, int isFinalCalc)
{
- int update_pbvh= (ob->mode & OB_MODE_SCULPT) && ob->paint;
MultiresModifierData *mmd = (MultiresModifierData*)md;
DerivedMesh *result;
@@ -76,11 +75,6 @@
result->release(result);
result= cddm;
}
- else if(update_pbvh) {
- /* would be created on the fly too, just nicer this
- way on first stroke after e.g. switching levels */
- ob->paint->pbvh= result->getPBVH(ob, result);
- }
return result;
}
More information about the Bf-blender-cvs
mailing list