~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/mesh.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 *  
5
5
 * 
6
 
 * $Id: mesh.c,v 1.81 2007/02/09 15:09:55 ton Exp $
 
6
 * $Id: mesh.c,v 1.85 2007/04/29 13:39:45 campbellbarton Exp $
7
7
 *
8
8
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
9
9
 *
228
228
        MEM_freeN (dvert);
229
229
}
230
230
 
231
 
Mesh *add_mesh()
 
231
Mesh *add_mesh(char *name)
232
232
{
233
233
        Mesh *me;
234
234
        
235
 
        me= alloc_libblock(&G.main->mesh, ID_ME, "Mesh");
 
235
        me= alloc_libblock(&G.main->mesh, ID_ME, name);
236
236
        
237
237
        me->size[0]= me->size[1]= me->size[2]= 1.0;
238
238
        me->smoothresh= 30;
502
502
                MVert *mvert = NULL;
503
503
                
504
504
                if(me->mr) {
505
 
                        lvl = multires_level_n(me->mr, me->mr->renderlvl);
 
505
                        lvl = multires_level_n(me->mr, me->mr->pinlvl);
506
506
                        vcos = MEM_callocN(sizeof(*vcos)*lvl->totvert, "orco mr mesh");
507
507
                        mvert = lvl->verts;
508
508
                        totvert = lvl->totvert;
852
852
        }
853
853
 
854
854
        /* make mesh */
855
 
        me= add_mesh();
 
855
        me= add_mesh("Mesh");
856
856
        me->totvert= totvert;
857
857
        me->totface= totvlak;
858
858
 
1072
1072
                MVert *mv= &mverts[i];
1073
1073
                float *no= tnorms[i];
1074
1074
                
1075
 
                if (Normalise(no)==0.0) {
 
1075
                if (Normalize(no)==0.0) {
1076
1076
                        VECCOPY(no, mv->co);
1077
 
                        Normalise(no);
 
1077
                        Normalize(no);
1078
1078
                }
1079
1079
 
1080
1080
                mv->no[0]= (short)(no[0]*32767.0);
1150
1150
        mf= mface;
1151
1151
        tf= tface;
1152
1152
        for(a=0; a<totface; a++, mf++, tf++)
1153
 
                if(!selected || (!(tf->flag & TF_HIDE) && (tf->flag & TF_SELECT)))
 
1153
                if(!selected || (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL)))
1154
1154
                        totuv += (mf->v4)? 4: 3;
1155
1155
                
1156
1156
        if(totuv==0)
1171
1171
        mf= mface;
1172
1172
        tf= tface;
1173
1173
        for(a=0; a<totface; a++, mf++, tf++) {
1174
 
                if(!selected || (!(tf->flag & TF_HIDE) && (tf->flag & TF_SELECT))) {
 
1174
                if(!selected || (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL))) {
1175
1175
                        nverts= (mf->v4)? 4: 3;
1176
1176
 
1177
1177
                        for(i=0; i<nverts; i++) {