Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-01-06 12:28:45 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-01-06 12:28:45 +0400
commit252d0c6c5bbb8de66e10249892abb16f891b9ac7 (patch)
tree0dc268b22e6d2949f254e50a70022cbde24cf94d /source/blender/blenkernel/intern/cdderivedmesh.c
parent0ea3c285ea769bcb692b6fbe7ad072c514b5f4d2 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 51890851ebc..517a5d6f6c6 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -647,6 +647,23 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
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) {