- bug fix, bug reported by Campbel, thanks! Keep in mind, that integration
authorJiri Hnidek <jiri.hnidek@tul.cz>
Mon, 21 Aug 2006 13:19:18 +0000 (13:19 +0000)
committerJiri Hnidek <jiri.hnidek@tul.cz>
Mon, 21 Aug 2006 13:19:18 +0000 (13:19 +0000)
   of verse supports only sharing of mesh geometry now, you can't share
   vertex color, vertex weight, etc.

source/blender/blenkernel/intern/DerivedMesh.c
source/blender/src/drawmesh.c
source/blender/src/drawobject.c

index f0c1ef7f890009fa38fb99aa53a9bc1e18696591..94e4dabeda4acc7e312d4b718200d9c670e02be5 100644 (file)
@@ -1781,6 +1781,29 @@ static void vDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int))
        glShadeModel(GL_FLAT);
 }
 
+/* thsi function should draw mesh with mapped texture, but it isn't supported yet */
+static void vDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(struct TFace *tface, int matnr))
+{
+       VDerivedMesh *vdm = (VDerivedMesh*)dm;
+       struct VerseFace *vface;
+
+       if(!vdm->polygon_layer) return;
+
+       vface = vdm->polygon_layer->dl.lb.first;
+
+       while(vface) {
+               glBegin(vface->vvert3?GL_QUADS:GL_TRIANGLES);
+               glVertex3fv(vdm->verts ? vface->vvert0->cos : vface->vvert0->co);
+               glVertex3fv(vdm->verts ? vface->vvert1->cos : vface->vvert1->co);
+               glVertex3fv(vdm->verts ? vface->vvert2->cos : vface->vvert2->co);
+               if(vface->vvert3)
+                       glVertex3fv(vdm->verts ? vface->vvert3->cos : vface->vvert3->co);
+               glEnd();
+
+               vface = vface->next;
+       }
+}
+
 /* this function should draw mesh with colored faces (weight paint, vertex
  * colors, etc.), but it isn't supported yet */
 static void vDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2)
@@ -1905,6 +1928,7 @@ DerivedMesh *derivedmesh_from_versemesh(VNode *vnode, float (*vertexCos)[3])
        vdm->dm.drawUVEdges = vDM_drawUVEdges;
 
        vdm->dm.drawFacesSolid = vDM_drawFacesSolid;
+       vdm->dm.drawFacesTex = vDM_drawFacesTex;
        vdm->dm.drawFacesColored = vDM_drawFacesColored;
 
        vdm->dm.drawMappedFacesTex = vDM_drawMappedFacesTex;
index 72cd635b9f98d593b6114f53558ea15a351656e8..2ff671d33fa3498077afb55a649c685a4a560ca2 100644 (file)
@@ -916,7 +916,15 @@ void draw_tface_mesh(Object *ob, Mesh *me, int dt)
                int editing= (G.f & (G_VERTEXPAINT+G_FACESELECT+G_TEXTUREPAINT+G_WEIGHTPAINT)) && (ob==((G.scene->basact) ? (G.scene->basact->object) : 0));
                int start, totface;
 
+#ifdef WITH_VERSE
+               if(me->vnode) {
+                       /* verse-blender doesn't support uv mapping of textures yet */
+                       dm->drawFacesTex(dm, NULL);
+               }
+               else if(ob==OBACT && (G.f & G_FACESELECT) && me && me->tface)
+#else
                if(ob==OBACT && (G.f & G_FACESELECT) && me && me->tface)
+#endif
                        dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, (void*)me);
                else
                        dm->drawFacesTex(dm, draw_tface__set_draw);
index 6bb70a42b96906c55bd3a28a9e8909c235924b94..ee098b2ee7c42a9354879ad0e9b776839e8e501e 100644 (file)
@@ -4317,7 +4317,7 @@ static void bbs_mesh_solid(Object *ob)
 
        /* draw edges for seam marking in faceselect mode, but not when painting,
           so that painting doesn't get interrupted on an edge */
-       if ((G.f & G_FACESELECT) && !(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT))) {
+       if ((G.f & G_FACESELECT) && !(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT|G_WEIGHTPAINT)) && me->tface) {
                struct { Mesh *me; EdgeHash *eh; int offset; } userData;
 
                userData.me = me;