[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53598] trunk/blender/source/blender/ blenkernel/intern/cdderivedmesh.c: Workaround for textured display with dynamic topology enabled

Sergey Sharybin sergey.vfx at gmail.com
Sun Jan 6 09:28:49 CET 2013


Revision: 53598
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53598
Author:   nazgul
Date:     2013-01-06 08:28:45 +0000 (Sun, 06 Jan 2013)
Log Message:
-----------
Workaround for textured display with dynamic topology enabled

This will only make object display with proper shape in textured
view, but all materials and textures will be replaced with default
gray color. There's currently no better way to deal with textured
display when dynamic topology enabled because of all UV/tfaces are
clearing when enabling dynamic topology sculpt.

Anyway, better to display gray object with proper lighting in this
case rather than not update object's shape during sculpt.

Proper solution will be possible once CD layer will be preserved
by BMesh log.

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-06 07:10:22 UTC (rev 53597)
+++ trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2013-01-06 08:28:45 UTC (rev 53598)
@@ -647,6 +647,23 @@
 		index_mp_to_orig = NULL;
 	}
 
+	/* TODO: not entirely correct, but currently dynamic topology will
+	 *       destroy UVs anyway, so textured display wouldn't work anyway
+	 *
+	 *       this will do more like solid view with lights set up for
+	 *       textured view, but object itself will be displayed gray
+	 *       (the same as it'll display without UV maps in textured view)
+	 */
+	if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
+		if (dm->numTessFaceData) {
+			glDisable(GL_TEXTURE_2D);
+			BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
+			glEnable(GL_TEXTURE_2D);
+		}
+
+		return;
+	}
+
 	colType = CD_TEXTURE_MCOL;
 	mcol = dm->getTessFaceDataArray(dm, colType);
 	if (!mcol) {




More information about the Bf-blender-cvs mailing list