[Bf-blender-cvs] [837db36] soc-2016-pbvh-painting: Copied PBVH painting from dm->drawFacesSolid to draw_mesh_paint.

Nathan Vollmer noreply at git.blender.org
Mon May 23 23:39:53 CEST 2016


Commit: 837db36d66b6e2fc5b5f1fe54bd1caf94f4507d0
Author: Nathan Vollmer
Date:   Mon May 23 15:39:49 2016 -0600
Branches: soc-2016-pbvh-painting
https://developer.blender.org/rB837db36d66b6e2fc5b5f1fe54bd1caf94f4507d0

Copied PBVH painting from dm->drawFacesSolid to draw_mesh_paint.

===================================================================

M	source/blender/editors/space_view3d/drawmesh.c
M	source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index a73a055..55e0d37 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -69,6 +69,8 @@
 
 #include "ED_uvedit.h"
 
+#include "BKE_pbvh.h"
+
 #include "view3d_intern.h"  /* own include */
 
 /* user data structures for derived mesh callbacks */
@@ -1367,5 +1369,18 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d,
 			set_inverted_drawing(0);
 		}
 	}
+
+	/* For drawing the PBVH */
+	if (ob->sculpt){
+		if (ob->sculpt->pbvh) {
+			if (BKE_pbvh_has_faces(ob->sculpt->pbvh)) {
+				float(*face_nors)[3] = CustomData_get_layer(&dm->polyData, CD_NORMAL);
+
+				BKE_pbvh_draw(ob->sculpt->pbvh, NULL, face_nors,
+					GPU_object_material_bind, false, false);
+				glShadeModel(GL_FLAT);
+			}
+		}
+	}
 }
 
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 6870e3f..8a347ba 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4158,10 +4158,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 		}
 	}
 	else if (dt == OB_PAINT) {
-		draw_mesh_paint(v3d, rv3d, ob, dm, draw_flags);
-
-		/* For drawing the PBVH */
-		dm->drawFacesSolid(dm, NULL, 0, GPU_object_material_bind);
+		draw_mesh_paint(v3d, rv3d, ob, dm, draw_flags, NULL, GPU_object_material_bind);
 
 		/* since we already draw wire as wp guide, don't draw over the top */
 		draw_wire = OBDRAW_WIRE_OFF;




More information about the Bf-blender-cvs mailing list