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

« back to all changes in this revision

Viewing changes to source/blender/src/vpaint.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:
1
1
/**
2
 
 * $Id: vpaint.c,v 1.83 2007/01/10 06:43:03 nicholasbishop Exp $
 
2
 * $Id: vpaint.c,v 1.88 2007/05/04 16:59:01 khughes Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
86
86
#include "BIF_toolbox.h"
87
87
 
88
88
#include "BDR_vpaint.h"
 
89
#include "BDR_editobject.h"
89
90
 
90
91
#include "BSE_drawview.h"
91
92
#include "BSE_trans_types.h"
108
109
 
109
110
#define MAXINDEX        512000
110
111
 
111
 
VPaint Gvp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT+VP_SPRAY, NULL};
112
 
VPaint Gwp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, NULL};
 
112
VPaint Gvp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT+VP_SPRAY, 0};
 
113
VPaint Gwp= {1.0, 1.0, 1.0, 0.2, 25.0, 1.0, 1.0, 0, VP_AREA+VP_SOFT, 0};
113
114
 
114
115
static int *get_indexarray(void)
115
116
{
319
320
void clear_vpaint_selectedfaces()
320
321
{
321
322
        Mesh *me;
322
 
        MTFace *tf;
 
323
        MFace *mf;
323
324
        Object *ob;
324
325
        unsigned int paintcol, *mcol;
325
326
        int i;
333
334
 
334
335
        paintcol= vpaint_get_current_col(&Gvp);
335
336
 
336
 
        tf = me->mtface;
 
337
        mf = me->mface;
337
338
        mcol = (unsigned int*)me->mcol;
338
 
        for (i = 0; i < me->totface; i++, tf++, mcol+=4) {
339
 
                if (tf->flag & TF_SELECT) {
 
339
        for (i = 0; i < me->totface; i++, mf++, mcol+=4) {
 
340
                if (mf->flag & ME_FACE_SEL) {
340
341
                        mcol[0] = paintcol;
341
342
                        mcol[1] = paintcol;
342
343
                        mcol[2] = paintcol;
356
357
        extern float editbutvweight;
357
358
        float paintweight= editbutvweight;
358
359
        Mesh *me;
359
 
        MTFace *tface;
360
360
        MFace *mface;
361
361
        Object *ob;
362
362
        MDeformWeight *dw, *uw;
368
368
        
369
369
        ob= OBACT;
370
370
        me= ob->data;
371
 
        if(me==0 || me->totface==0 || me->dvert==0 || !me->mtface) return;
 
371
        if(me==0 || me->totface==0 || me->dvert==0 || !me->mface) return;
372
372
        
373
373
        indexar= get_indexarray();
374
 
        for(index=0, tface=me->mtface; index<me->totface; index++, tface++) {
375
 
                if((tface->flag & TF_SELECT)==0)
 
374
        for(index=0, mface=me->mface; index<me->totface; index++, mface++) {
 
375
                if((mface->flag & ME_FACE_SEL)==0)
376
376
                        indexar[index]= 0;
377
377
                else
378
378
                        indexar[index]= index+1;
1083
1083
        Object *ob; 
1084
1084
        Mesh *me;
1085
1085
        MFace *mface;
1086
 
        MTFace *tface;
1087
1086
        float mat[4][4], imat[4][4], paintweight, *vertexcosnos;
1088
1087
        float vpimat[3][3];
1089
1088
        int *indexar, index, totindex, alpha, totw;
1220
1219
                                }
1221
1220
                        }
1222
1221
 
1223
 
                        if((G.f & G_FACESELECT) && me->mtface) {
 
1222
                        if((G.f & G_FACESELECT) && me->mface) {
1224
1223
                                for(index=0; index<totindex; index++) {
1225
1224
                                        if(indexar[index] && indexar[index]<=me->totface) {
1226
1225
                                        
1227
 
                                                tface= ((MTFace *)me->mtface) + (indexar[index]-1);
 
1226
                                                mface= ((MFace *)me->mface) + (indexar[index]-1);
1228
1227
                                        
1229
 
                                                if((tface->flag & TF_SELECT)==0) {
 
1228
                                                if((mface->flag & ME_FACE_SEL)==0) {
1230
1229
                                                        indexar[index]= 0;
1231
1230
                                                }
1232
1231
                                        }                                       
1357
1356
        Object *ob;
1358
1357
        Mesh *me;
1359
1358
        MFace *mface;
1360
 
        MTFace *tface;
1361
1359
        float mat[4][4], imat[4][4], *vertexcosnos;
1362
1360
        float vpimat[3][3];
1363
1361
        unsigned int paintcol=0, *mcol, *mcolorig, fcol1, fcol2;
1439
1437
                                        }                                       
1440
1438
                                }
1441
1439
                        }
1442
 
                        if((G.f & G_FACESELECT) && me->mtface) {
 
1440
                        if((G.f & G_FACESELECT) && me->mface) {
1443
1441
                                for(index=0; index<totindex; index++) {
1444
1442
                                        if(indexar[index] && indexar[index]<=me->totface) {
1445
 
                                                tface= ((MTFace *)me->mtface) + (indexar[index]-1);
 
1443
                                                mface= ((MFace *)me->mface) + (indexar[index]-1);
1446
1444
                                        
1447
 
                                                if((tface->flag & TF_SELECT)==0)
 
1445
                                                if((mface->flag & ME_FACE_SEL)==0)
1448
1446
                                                        indexar[index]= 0;
1449
1447
                                        }                                       
1450
1448
                                }
1585
1583
        
1586
1584
        scrarea_queue_headredraw(curarea);
1587
1585
        ob= OBACT;
1588
 
        if(!ob || ob->id.lib) {
 
1586
        if(!ob || object_data_is_libdata(ob)) {
1589
1587
                G.f &= ~G_VERTEXPAINT;
1590
1588
                return;
1591
1589
        }