[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40010] branches/bmesh/blender/source/ blender: bmesh: corrected fix for svulpting on non-multires mesh

Sergey Sharybin g.ulairi at gmail.com
Wed Sep 7 14:16:21 CEST 2011


Revision: 40010
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40010
Author:   nazgul
Date:     2011-09-07 12:16:20 +0000 (Wed, 07 Sep 2011)
Log Message:
-----------
bmesh: corrected fix for svulpting on non-multires mesh

Previous fix wasn't correct. It made things working, but it removed
advantage of using PBVH for speed because derivedMesh used to be
recreated on each stroke step.

This commit fixes non-multires sculpting for Solid shading,
wireframe and render wouldn't work correct -- it'll require
a bit more tricky things because DM created for base mesh
doesn't points to mesh->mverts anymore, so sculpting and
drawing modules are using different verts arrays.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
    branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt_undo.c

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2011-09-07 12:06:08 UTC (rev 40009)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2011-09-07 12:16:20 UTC (rev 40010)
@@ -239,7 +239,7 @@
 	if(deformed)
 		return 0;
 
-	return (cddm->mvert == me->mvert) || ob->sculpt->kb;
+	return dm->deformedOnly || ob->sculpt->kb;
 }
 
 static struct PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm)

Modified: branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c	2011-09-07 12:06:08 UTC (rev 40009)
+++ branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c	2011-09-07 12:16:20 UTC (rev 40010)
@@ -3382,18 +3382,13 @@
 	ARegion *ar = CTX_wm_region(C);
 	MultiresModifierData *mmd = ss->multires;
 
-	if (!ss->cache) {
-		if(mmd)
-			multires_mark_as_modified(ob);
-	}
-
+	if(mmd)
+		multires_mark_as_modified(ob);
 	if(ob->derivedFinal) /* VBO no longer valid */
 		GPU_drawobject_free(ob->derivedFinal);
 
-	if (!ss->cache || !mmd)
-		DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
-	
 	if(ss->modifiers_active) {
+		DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 		ED_region_tag_redraw(ar);
 	}
 	else {

Modified: branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-09-07 12:06:08 UTC (rev 40009)
+++ branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-09-07 12:16:20 UTC (rev 40010)
@@ -193,7 +193,7 @@
 		if((mmd=sculpt_multires_active(scene, ob)))
 			multires_mark_as_modified(ob);
 
-		tag_update= ((Mesh*)ob->data)->id.us > 1 || !mmd;
+		tag_update= ((Mesh*)ob->data)->id.us > 1;
 
 		if(ss->modifiers_active) {
 			Mesh *mesh= ob->data;




More information about the Bf-blender-cvs mailing list