Two small corrections for subsurf + wire render;
authorTon Roosendaal <ton@blender.org>
Wed, 13 Apr 2005 14:03:10 +0000 (14:03 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 13 Apr 2005 14:03:10 +0000 (14:03 +0000)
- when edges data exists, it skips adding faces to renderlist
- edges are rendered according to "Optimal" subsurf setting

source/blender/renderconverter/intern/convertBlenderScene.c

index cbb3239dd675b744508b7c2cc2bcb53bd4e7a877..7331033f87718bd76932c4cae3a09047dbf565ba 100644 (file)
@@ -1437,6 +1437,12 @@ static void init_render_mesh(Object *ob)
                                        }
                                }
                        }
+                       
+                       /* if wire material, and we got edges, don't do the faces */
+                       if(ma->mode & MA_WIRE) {
+                               end= dlm?dlm->totedge:me->totedge;
+                               if(end) ok= 0;
+                       }
 
                        if(ok) {
                                TFace *tface= NULL;
@@ -1560,32 +1566,36 @@ static void init_render_mesh(Object *ob)
                if(end && (ma->mode & MA_WIRE)) {
                        MEdge *medge;
                        medge= dlm?dlm->medge:me->medge;
+                       
                        for(a1=0; a1<end; a1++, medge++) {
-                               MVert *v0 = &mvert[vertofs+medge->v1];
-                               MVert *v1 = &mvert[vertofs+medge->v2];
-
-                               vlr= RE_findOrAddVlak(R.totvlak++);
-                               vlr->ob= vlr_set_ob(ob);
-                               vlr->v1= RE_findOrAddVert(vertofs+medge->v1);
-                               vlr->v2= RE_findOrAddVert(vertofs+medge->v2);
-                               vlr->v3= vlr->v2;
-                               vlr->v4= NULL;
                                
-                               xn= (v0->no[0]+v1->no[0]);
-                               yn= (v0->no[1]+v1->no[1]);
-                               zn= (v0->no[2]+v1->no[2]);
-                               if(do_puno==0) {
-                                       /* transpose ! */
-                                       vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
-                                       vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
-                                       vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
-                                       Normalise(vlr->n);
+                               if( (me->flag & ME_OPT_EDGES)==0 || (medge->flag & ME_EDGEDRAW)) {
+                                       MVert *v0 = &mvert[vertofs+medge->v1];
+                                       MVert *v1 = &mvert[vertofs+medge->v2];
+
+                                       vlr= RE_findOrAddVlak(R.totvlak++);
+                                       vlr->ob= vlr_set_ob(ob);
+                                       vlr->v1= RE_findOrAddVert(vertofs+medge->v1);
+                                       vlr->v2= RE_findOrAddVert(vertofs+medge->v2);
+                                       vlr->v3= vlr->v2;
+                                       vlr->v4= NULL;
+                                       
+                                       xn= (v0->no[0]+v1->no[0]);
+                                       yn= (v0->no[1]+v1->no[1]);
+                                       zn= (v0->no[2]+v1->no[2]);
+                                       if(do_puno==0) {
+                                               /* transpose ! */
+                                               vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
+                                               vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
+                                               vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
+                                               Normalise(vlr->n);
+                                       }
+                                       
+                                       vlr->mat= ma;
+                                       vlr->flag= 0;
+                                       vlr->ec= ME_V1V2;
+                                       vlr->lay= ob->lay;
                                }
-                               
-                               vlr->mat= ma;
-                               vlr->flag= 0;
-                               vlr->ec= ME_V1V2;
-                               vlr->lay= ob->lay;
                        }
                }
        }