- bug fix, bug reported by Campbel, thanks! Keep in mind, that integration
of verse supports only sharing of mesh geometry now, you can't share vertex color, vertex weight, etc.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user