[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54002] trunk/blender/source/blender/ blenkernel/intern/cdderivedmesh.c: Fix/ workaround for GLSL textured and matcap modes for dyntopo

Sergey Sharybin sergey.vfx at gmail.com
Tue Jan 22 17:06:11 CET 2013


Revision: 54002
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54002
Author:   nazgul
Date:     2013-01-22 16:06:09 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
Fix/workaround for GLSL textured and matcap modes for dyntopo

Currently used special checks in DM draw code, perhaps better would be
simply to flush changes from PBVH to DM.

Anyway, now things seems to be working OK, will check on better solution
from code point of view later.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c

Modified: trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2013-01-22 15:30:29 UTC (rev 54001)
+++ trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2013-01-22 16:06:09 UTC (rev 54002)
@@ -1111,6 +1111,19 @@
 		index_mp_to_orig = NULL;
 	}
 
+	/* TODO: same as for solid draw, not entirely correct, but works fine for now,
+	 *       will skip using textures (dyntopo currently destroys UV anyway) and
+	 *       works fine for matcap
+	 */
+	if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
+		if (dm->numTessFaceData) {
+			setMaterial(1, &gattribs);
+			BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+		}
+
+		return;
+	}
+
 	cdDM_update_normals_from_pbvh(dm);
 
 	matnr = -1;
@@ -1412,6 +1425,19 @@
 		index_mp_to_orig = NULL;
 	}
 
+	/* TODO: same as for solid draw, not entirely correct, but works fine for now,
+	 *       will skip using textures (dyntopo currently destroys UV anyway) and
+	 *       works fine for matcap
+	 */
+	if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
+		if (dm->numTessFaceData) {
+			setMaterial(userData, 1, NULL);
+			BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+		}
+
+		return;
+	}
+
 	cdDM_update_normals_from_pbvh(dm);
 
 	matnr = -1;




More information about the Bf-blender-cvs mailing list