Page MenuHome

edit_tmp_union.txt

Authored By
Chris Want (hos)
Nov 13 2013, 1:04 PM
Size
45 KB
Subscribers
None

edit_tmp_union.txt

? obj
? user-def.mk
Index: source/blender/blenkernel/intern/displist.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/intern/displist.c,v
retrieving revision 1.123.2.6
diff -u -p -r1.123.2.6 displist.c
--- source/blender/blenkernel/intern/displist.c 11 Dec 2005 13:23:29 -0000 1.123.2.6
+++ source/blender/blenkernel/intern/displist.c 31 Dec 2005 03:56:17 -0000
@@ -1225,7 +1225,7 @@ void filldisplist(ListBase *dispbase, Li
f1+= 3;
/* index number */
- eve->vn= (EditVert *)totvert;
+ eve->tmp.l = totvert;
totvert++;
eve= eve->next;
@@ -1235,9 +1235,9 @@ void filldisplist(ListBase *dispbase, Li
efa= fillfacebase.first;
index= dlnew->index;
while(efa) {
- index[0]= (long)efa->v1->vn;
- index[1]= (long)efa->v2->vn;
- index[2]= (long)efa->v3->vn;
+ index[0]= (long)efa->v1->tmp.l;
+ index[1]= (long)efa->v2->tmp.l;
+ index[2]= (long)efa->v3->tmp.l;
index+= 3;
efa= efa->next;
Index: source/blender/blenkernel/intern/exotic.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenkernel/intern/exotic.c,v
retrieving revision 1.51
diff -u -p -r1.51 exotic.c
--- source/blender/blenkernel/intern/exotic.c 5 Nov 2005 17:14:54 -0000 1.51
+++ source/blender/blenkernel/intern/exotic.c 31 Dec 2005 03:56:17 -0000
@@ -2611,7 +2611,7 @@ static void write_videoscape_mesh(Object
VECCOPY(co, eve->co);
Mat4MulVecfl(ob->obmat, co);
fprintf(fp, "%f %f %f\n", co[0], co[1], co[2] );
- eve->vn= (struct EditVert *)tot;
+ eve->tmp.l = tot;
tot++;
eve= eve->next;
}
@@ -2619,10 +2619,19 @@ static void write_videoscape_mesh(Object
while(evl) {
if(evl->v4==0) {
- fprintf(fp, "3 %p %p %p 0x%x\n", evl->v1->vn, evl->v2->vn, evl->v3->vn, kleur[evl->mat_nr]);
+ fprintf(fp, "3 %ld %ld %ld 0x%x\n",
+ evl->v1->tmp.l,
+ evl->v2->tmp.l,
+ evl->v3->tmp.l,
+ kleur[evl->mat_nr]);
}
else {
- fprintf(fp, "4 %p %p %p %p 0x%x\n", evl->v1->vn, evl->v2->vn, evl->v3->vn, evl->v4->vn, kleur[evl->mat_nr]);
+ fprintf(fp, "4 %ld %ld %ld %ld 0x%x\n",
+ evl->v1->tmp.l,
+ evl->v2->tmp.l,
+ evl->v3->tmp.l,
+ evl->v4->tmp.l,
+ kleur[evl->mat_nr]);
}
evl= evl->next;
}
Index: source/blender/blenlib/BLI_editVert.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenlib/BLI_editVert.h,v
retrieving revision 1.21.2.1
diff -u -p -r1.21.2.1 BLI_editVert.h
--- source/blender/blenlib/BLI_editVert.h 29 Dec 2005 23:26:48 -0000 1.21.2.1
+++ source/blender/blenlib/BLI_editVert.h 31 Dec 2005 03:56:17 -0000
@@ -43,7 +43,18 @@ struct DerivedMesh;
/* note; changing this also might affect the undo copy in editmesh.c */
typedef struct EditVert
{
- struct EditVert *next, *prev, *vn;
+ struct EditVert *next, *prev;
+ union {
+ /* some lean storage for temporary usage
+ * in editmesh routines
+ */
+ struct EditVert *v;
+ struct EditEdge *e;
+ struct EditFace *f;
+ float *fp;
+ void *p;
+ long l;
+ } tmp;
float no[3];
float co[3];
short xs, ys;
@@ -66,8 +77,17 @@ typedef struct HashEdge {
typedef struct EditEdge
{
struct EditEdge *next, *prev;
- /* Note: vn is for general purpose temporary storage */
- struct EditVert *v1, *v2, *vn;
+ struct EditVert *v1, *v2;
+ union {
+ /* some lean storage for temporary usage
+ * in editmesh routines
+ */
+ struct EditVert *v;
+ struct EditEdge *e;
+ struct EditFace *f;
+ void *p;
+ long l;
+ } tmp;
short f1, f2; /* short, f1 is (ab)used in subdiv */
unsigned char f, h, dir, seam;
float crease;
@@ -82,6 +102,16 @@ typedef struct EditFace
struct EditFace *next, *prev;
struct EditVert *v1, *v2, *v3, *v4;
struct EditEdge *e1, *e2, *e3, *e4;
+ union {
+ /* some lean storage for temporary usage
+ * in editmesh routines
+ */
+ struct EditVert *v;
+ struct EditEdge *e;
+ struct EditFace *f;
+ void *p;
+ long l;
+ } tmp;
float n[3], cent[3];
struct TFace tf; /* a copy of original tface. */
unsigned char mat_nr, flag;
Index: source/blender/blenlib/intern/scanfill.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/blenlib/intern/scanfill.c,v
retrieving revision 1.10
diff -u -p -r1.10 scanfill.c
--- source/blender/blenlib/intern/scanfill.c 14 Aug 2005 06:08:40 -0000 1.10
+++ source/blender/blenlib/intern/scanfill.c 31 Dec 2005 03:56:17 -0000
@@ -581,18 +581,18 @@ static void scanfill(PolyFill *pf, int m
if(eed->v1->co[coy]==eed->v2->co[coy]) {
if(eed->v1->f==255 && eed->v2->f!=255) {
eed->v2->f= 255;
- eed->v2->vn= eed->v1->vn;
+ eed->v2->tmp.v= eed->v1->tmp.v;
}
else if(eed->v2->f==255 && eed->v1->f!=255) {
eed->v1->f= 255;
- eed->v1->vn= eed->v2->vn;
+ eed->v1->tmp.v= eed->v2->tmp.v;
}
else if(eed->v2->f==255 && eed->v1->f==255) {
- eed->v1->vn= eed->v2->vn;
+ eed->v1->tmp.v= eed->v2->tmp.v;
}
else {
eed->v2->f= 255;
- eed->v2->vn= eed->v1;
+ eed->v2->tmp.v = eed->v1;
}
}
}
@@ -627,11 +627,13 @@ static void scanfill(PolyFill *pf, int m
BLI_remlink(&filledgebase,eed);
if(eed->v1->f==255) {
v1= eed->v1;
- while(eed->v1->f==255 && eed->v1->vn!=v1) eed->v1= eed->v1->vn;
+ while((eed->v1->f == 255) && (eed->v1->tmp.v != v1))
+ eed->v1 = eed->v1->tmp.v;
}
if(eed->v2->f==255) {
v2= eed->v2;
- while(eed->v2->f==255 && eed->v2->vn!=v2) eed->v2= eed->v2->vn;
+ while((eed->v2->f == 255) && (eed->v2->tmp.v != v2))
+ eed->v2 = eed->v2->tmp.v;
}
if(eed->v1!=eed->v2) addedgetoscanlist(eed,verts);
@@ -808,7 +810,7 @@ int BLI_edgefill(int mode, int mat_nr)
{
/*
- fill works with its own lists, so create that first (no faces!)
- - for vertices, put in ->vn the old pointer
+ - for vertices, put in ->tmp.v the old pointer
- struct elements xs en ys are not used here: don't hide stuff in it
- edge flag ->f becomes 2 when it's a new edge
- mode: & 1 is check for crossings, then create edges (TO DO )
@@ -980,10 +982,10 @@ int BLI_edgefill(int mode, int mat_nr)
/* CURRENT STATUS:
- - eve->f :1= availalble in edges
- - eve->xs :polynumber
- - eve->h :amount of edges connected to vertex
- - eve->vn :store! original vertex number
+ - eve->f :1= availalble in edges
+ - eve->xs :polynumber
+ - eve->h :amount of edges connected to vertex
+ - eve->tmp.v :store! original vertex number
- eed->f :
- eed->f1 :poly number
Index: source/blender/src/editmesh.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh.c,v
retrieving revision 1.164.2.3
diff -u -p -r1.164.2.3 editmesh.c
--- source/blender/src/editmesh.c 19 Dec 2005 18:56:07 -0000 1.164.2.3
+++ source/blender/src/editmesh.c 31 Dec 2005 03:56:17 -0000
@@ -567,7 +567,7 @@ static void edge_normal_compare(EditEdge
float cent1[3], cent2[3];
float inp;
- efa2= (EditFace *)eed->vn;
+ efa2 = eed->tmp.f;
if(efa1==efa2) return;
inp= efa1->n[0]*efa2->n[0] + efa1->n[1]*efa2->n[1] + efa1->n[2]*efa2->n[2];
@@ -611,7 +611,7 @@ static void edge_drawflags(void)
EditFace *efa;
/* - count number of times edges are used in faces: 0 en 1 time means draw edge
- * - edges more than 1 time used: in *vn is pointer to first face
+ * - edges more than 1 time used: in *tmp.f is pointer to first face
* - check all faces, when normal differs to much: draw (flag becomes 1)
*/
@@ -630,7 +630,7 @@ static void edge_drawflags(void)
eed= em->edges.first;
while(eed) {
eed->f2= eed->f1= 0;
- eed->vn= 0;
+ eed->tmp.f = 0;
eed= eed->next;
}
@@ -645,10 +645,10 @@ static void edge_drawflags(void)
if(e3->f2<4) e3->f2+= 1;
if(e4 && e4->f2<4) e4->f2+= 1;
- if(e1->vn==0) e1->vn= (EditVert *)efa;
- if(e2->vn==0) e2->vn= (EditVert *)efa;
- if(e3->vn==0) e3->vn= (EditVert *)efa;
- if(e4 && e4->vn==0) e4->vn= (EditVert *)efa;
+ if(e1->tmp.f == 0) e1->tmp.f = (void *) efa;
+ if(e2->tmp.f == 0) e2->tmp.f = (void *) efa;
+ if(e3->tmp.f ==0) e3->tmp.f = (void *) efa;
+ if(e4 && (e4->tmp.f == 0)) e4->tmp.f = (void *) efa;
efa= efa->next;
}
@@ -920,7 +920,7 @@ void load_editMesh(void)
me->mface= mface;
me->totface= G.totface;
- /* the vertices, abuse ->vn as counter */
+ /* the vertices, use ->tmp.l as counter */
eve= em->verts.first;
a= 0;
@@ -944,7 +944,7 @@ void load_editMesh(void)
}
}
- eve->vn= (EditVert *)(long)(a++); /* counter */
+ eve->tmp.l = a++; /* counter */
mvert->flag= 0;
if(eve->f1==1) mvert->flag |= ME_SPHERETEST;
@@ -959,8 +959,8 @@ void load_editMesh(void)
/* the edges */
eed= em->edges.first;
while(eed) {
- medge->v1= (unsigned int) eed->v1->vn;
- medge->v2= (unsigned int) eed->v2->vn;
+ medge->v1= (unsigned int) eed->v1->tmp.l;
+ medge->v2= (unsigned int) eed->v2->tmp.l;
medge->flag= (eed->f & SELECT) | ME_EDGERENDER;
if(eed->f2<2) medge->flag |= ME_EDGEDRAW;
@@ -981,10 +981,10 @@ void load_editMesh(void)
while(efa) {
mface= &((MFace *) me->mface)[i];
- mface->v1= (unsigned int) efa->v1->vn;
- mface->v2= (unsigned int) efa->v2->vn;
- mface->v3= (unsigned int) efa->v3->vn;
- if(efa->v4) mface->v4= (unsigned int) efa->v4->vn;
+ mface->v1= (unsigned int) efa->v1->tmp.l;
+ mface->v2= (unsigned int) efa->v2->tmp.l;
+ mface->v3= (unsigned int) efa->v3->tmp.l;
+ if (efa->v4) mface->v4 = (unsigned int) efa->v4->tmp.l;
mface->mat_nr= efa->mat_nr;
@@ -1107,7 +1107,7 @@ void load_editMesh(void)
eve = vertMap[hmd->indexar[i]];
if (eve) {
- hmd->indexar[j++] = (long) eve->vn;
+ hmd->indexar[j++] = eve->tmp.l;
}
}
else j++;
@@ -1175,10 +1175,10 @@ void load_editMesh(void)
if(oldverts) MEM_freeN(oldverts);
- /* to be sure: clear ->vn pointers */
+ /* to be sure: clear ->tmp.l pointers */
eve= em->verts.first;
while(eve) {
- eve->vn= 0;
+ eve->tmp.l = 0;
eve= eve->next;
}
@@ -1643,13 +1643,13 @@ static void *editMesh_to_undoMesh(void)
evec->totweight= eve->totweight;
evec->dw= MEM_dupallocN(eve->dw);
- eve->vn= (EditVert *)a;
+ eve->tmp.l = a;
}
/* copy edges */
for(eed=em->edges.first; eed; eed= eed->next, eedc++) {
- eedc->v1= (int)eed->v1->vn;
- eedc->v2= (int)eed->v2->vn;
+ eedc->v1= (int)eed->v1->tmp.l;
+ eedc->v2= (int)eed->v2->tmp.l;
eedc->f= eed->f;
eedc->h= eed->h;
eedc->seam= eed->seam;
@@ -1659,10 +1659,10 @@ static void *editMesh_to_undoMesh(void)
/* copy faces */
for(efa=em->faces.first; efa; efa= efa->next, efac++) {
- efac->v1= (int)efa->v1->vn;
- efac->v2= (int)efa->v2->vn;
- efac->v3= (int)efa->v3->vn;
- if(efa->v4) efac->v4= (int)efa->v4->vn;
+ efac->v1= (int)efa->v1->tmp.l;
+ efac->v2= (int)efa->v2->tmp.l;
+ efac->v3= (int)efa->v3->tmp.l;
+ if(efa->v4) efac->v4= (int)efa->v4->tmp.l;
else efac->v4= -1;
efac->mat_nr= efa->mat_nr;
Index: source/blender/src/editmesh_lib.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh_lib.c,v
retrieving revision 1.46.2.1
diff -u -p -r1.46.2.1 editmesh_lib.c
--- source/blender/src/editmesh_lib.c 30 Nov 2005 13:57:59 -0000 1.46.2.1
+++ source/blender/src/editmesh_lib.c 31 Dec 2005 03:56:17 -0000
@@ -604,9 +604,9 @@ short extrudeflag_edges_indiv(short flag
EditEdge *eed;
EditFace *efa;
- for(eve= em->verts.first; eve; eve= eve->next) eve->vn= NULL;
+ for(eve= em->verts.first; eve; eve= eve->next) eve->tmp.v = NULL;
for(eed= em->edges.first; eed; eed= eed->next) {
- eed->vn= NULL;
+ eed->tmp.f = NULL;
eed->f2= ((eed->f & flag)!=0);
}
@@ -614,24 +614,32 @@ short extrudeflag_edges_indiv(short flag
/* sample for next loop */
for(efa= em->faces.first; efa; efa= efa->next) {
- efa->e1->vn= (EditVert *)efa;
- efa->e2->vn= (EditVert *)efa;
- efa->e3->vn= (EditVert *)efa;
- if(efa->e4) efa->e4->vn= (EditVert *)efa;
+ efa->e1->tmp.f = efa;
+ efa->e2->tmp.f = efa;
+ efa->e3->tmp.f = efa;
+ if(efa->e4) efa->e4->tmp.f = efa;
}
/* make the faces */
for(eed= em->edges.first; eed; eed= eed->next) {
if(eed->f & flag) {
- if(eed->v1->vn==NULL) eed->v1->vn= addvertlist(eed->v1->co);
- if(eed->v2->vn==NULL) eed->v2->vn= addvertlist(eed->v2->co);
-
- if(eed->dir==1) addfacelist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, (EditFace *)eed->vn, NULL);
- else addfacelist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, (EditFace *)eed->vn, NULL);
+ if(eed->v1->tmp.v == NULL)
+ eed->v1->tmp.v = addvertlist(eed->v1->co);
+ if(eed->v2->tmp.v == NULL)
+ eed->v2->tmp.v = addvertlist(eed->v2->co);
+
+ if(eed->dir==1)
+ addfacelist(eed->v1, eed->v2,
+ eed->v2->tmp.v, eed->v1->tmp.v,
+ eed->tmp.f, NULL);
+ else
+ addfacelist(eed->v2, eed->v1,
+ eed->v1->tmp.v, eed->v2->tmp.v,
+ eed->tmp.f, NULL);
/* for transform */
- if(eed->vn) {
- efa= (EditFace *)eed->vn;
- if(efa->f & SELECT) add_normal_aligned(nor, efa->n);
+ if(eed->tmp.f) {
+ efa = eed->tmp.f;
+ if (efa->f & SELECT) add_normal_aligned(nor, efa->n);
}
}
}
@@ -640,8 +648,8 @@ short extrudeflag_edges_indiv(short flag
/* set correct selection */
EM_clear_flag_all(SELECT);
for(eve= em->verts.last; eve; eve= eve->prev) {
- if(eve->vn) {
- eve->vn->f |= flag;
+ if(eve->tmp.v) {
+ eve->tmp.v->f |= flag;
}
}
@@ -662,16 +670,18 @@ short extrudeflag_verts_indiv(short flag
/* make the edges */
for(eve= em->verts.first; eve; eve= eve->next) {
if(eve->f & flag) {
- eve->vn= addvertlist(eve->co);
- addedgelist(eve, eve->vn, NULL);
+ eve->tmp.v = addvertlist(eve->co);
+ addedgelist(eve, eve->tmp.v, NULL);
}
- else eve->vn= NULL;
+ else eve->tmp.v = NULL;
}
/* set correct selection */
EM_clear_flag_all(SELECT);
- for(eve= em->verts.last; eve; eve= eve->prev) if(eve->vn) eve->vn->f |= flag;
+ for(eve= em->verts.last; eve; eve= eve->prev)
+ if (eve->tmp.v)
+ eve->tmp.v->f |= flag;
return 'g'; // g is grab
}
@@ -706,7 +716,7 @@ static short extrudeflag_edge(short flag
recalc_editnormals();
for(eve= em->verts.first; eve; eve= eve->next) {
- eve->vn= NULL;
+ eve->tmp.v = NULL;
eve->f1= 0;
}
@@ -717,7 +727,7 @@ static short extrudeflag_edge(short flag
eed->v1->f1= 1; // we call this 'selected vertex' now
eed->v2->f1= 1;
}
- eed->vn= NULL; // here we tuck face pointer, as sample
+ eed->tmp.f = NULL; // here we tuck face pointer, as sample
}
for(efa= em->faces.first; efa; efa= efa->next) {
if(efa->f & SELECT) {
@@ -727,10 +737,10 @@ static short extrudeflag_edge(short flag
if(efa->e4) efa->e4->f2++;
// sample for next loop
- efa->e1->vn= (EditVert *)efa;
- efa->e2->vn= (EditVert *)efa;
- efa->e3->vn= (EditVert *)efa;
- if(efa->e4) efa->e4->vn= (EditVert *)efa;
+ efa->e1->tmp.f = efa;
+ efa->e2->tmp.f = efa;
+ efa->e3->tmp.f = efa;
+ if(efa->e4) efa->e4->tmp.f = efa;
}
else {
efa->e1->f1++;
@@ -756,14 +766,22 @@ static short extrudeflag_edge(short flag
for(eed= em->edges.last; eed; eed= eed->prev) {
if(eed->f & SELECT) {
if(eed->f2<2) {
- if(eed->v1->vn==NULL)
- eed->v1->vn= addvertlist(eed->v1->co);
- if(eed->v2->vn==NULL)
- eed->v2->vn= addvertlist(eed->v2->co);
+ if(eed->v1->tmp.v == NULL)
+ eed->v1->tmp.v = addvertlist(eed->v1->co);
+ if(eed->v2->tmp.v == NULL)
+ eed->v2->tmp.v = addvertlist(eed->v2->co);
- /* if del_old, the preferred normal direction is exact opposite as for keep old faces */
- if(eed->dir!=del_old) addfacelist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, (EditFace *)eed->vn, NULL);
- else addfacelist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, (EditFace *)eed->vn, NULL);
+ /* if del_old, the preferred normal direction is exact
+ * opposite as for keep old faces
+ */
+ if(eed->dir!=del_old)
+ addfacelist(eed->v1, eed->v2,
+ eed->v2->tmp.v, eed->v1->tmp.v,
+ eed->tmp.f, NULL);
+ else
+ addfacelist(eed->v2, eed->v1,
+ eed->v1->tmp.v, eed->v2->tmp.v,
+ eed->tmp.f, NULL);
}
}
}
@@ -771,22 +789,30 @@ static short extrudeflag_edge(short flag
/* step 3: make new faces from faces */
for(efa= em->faces.last; efa; efa= efa->prev) {
if(efa->f & SELECT) {
- if(efa->v1->vn==NULL) efa->v1->vn= addvertlist(efa->v1->co);
- if(efa->v2->vn==NULL) efa->v2->vn= addvertlist(efa->v2->co);
- if(efa->v3->vn==NULL) efa->v3->vn= addvertlist(efa->v3->co);
- if(efa->v4 && efa->v4->vn==NULL) efa->v4->vn= addvertlist(efa->v4->co);
+ if (efa->v1->tmp.v == NULL)
+ efa->v1->tmp.v = addvertlist(efa->v1->co);
+ if (efa->v2->tmp.v ==NULL)
+ efa->v2->tmp.v = addvertlist(efa->v2->co);
+ if (efa->v3->tmp.v ==NULL)
+ efa->v3->tmp.v = addvertlist(efa->v3->co);
+ if (efa->v4 && (efa->v4->tmp.v == NULL))
+ efa->v4->tmp.v = addvertlist(efa->v4->co);
if(del_old==0) { // keep old faces means flipping normal
if(efa->v4)
- addfacelist(efa->v4->vn, efa->v3->vn, efa->v2->vn, efa->v1->vn, efa, efa);
+ addfacelist(efa->v4->tmp.v, efa->v3->tmp.v,
+ efa->v2->tmp.v, efa->v1->tmp.v, efa, efa);
else
- addfacelist(efa->v3->vn, efa->v2->vn, efa->v1->vn, NULL, efa, efa);
+ addfacelist(efa->v3->tmp.v, efa->v2->tmp.v,
+ efa->v1->tmp.v, NULL, efa, efa);
}
else {
if(efa->v4)
- addfacelist(efa->v1->vn, efa->v2->vn, efa->v3->vn, efa->v4->vn, efa, efa);
+ addfacelist(efa->v1->tmp.v, efa->v2->tmp.v,
+ efa->v3->tmp.v, efa->v4->tmp.v, efa, efa);
else
- addfacelist(efa->v1->vn, efa->v2->vn, efa->v3->vn, NULL, efa, efa);
+ addfacelist(efa->v1->tmp.v, efa->v2->tmp.v,
+ efa->v3->tmp.v, NULL, efa, efa);
}
/* for transform */
@@ -837,7 +863,7 @@ static short extrudeflag_edge(short flag
nextve= eve->next;
if(eve->f1) {
// hack... but we need it for step 7, redoing selection
- if(eve->vn) eve->vn->vn= eve->vn;
+ if(eve->tmp.v) eve->tmp.v->tmp.v= eve->tmp.v;
BLI_remlink(&em->verts, eve);
free_editvert(eve);
@@ -852,8 +878,8 @@ static short extrudeflag_edge(short flag
EM_clear_flag_all(SELECT);
for(eve= em->verts.first; eve; eve= eve->next) {
- if(eve->vn) {
- eve->vn->f |= SELECT;
+ if(eve->tmp.v) {
+ eve->tmp.v->f |= SELECT;
}
}
@@ -893,7 +919,7 @@ short extrudeflag_vert(short flag, float
else eed->f2= 0;
eed->f1= 1; /* this indicates it is an 'old' edge (in this routine we make new ones) */
- eed->vn= NULL; /* abused as sample */
+ eed->tmp.f = NULL; /* used as sample */
eed= eed->next;
}
@@ -931,10 +957,10 @@ short extrudeflag_vert(short flag, float
}
// sample for next loop
- efa->e1->vn= (EditVert *)efa;
- efa->e2->vn= (EditVert *)efa;
- efa->e3->vn= (EditVert *)efa;
- if(efa->e4) efa->e4->vn= (EditVert *)efa;
+ efa->e1->tmp.f = efa;
+ efa->e2->tmp.f = efa;
+ efa->e3->tmp.f = efa;
+ if(efa->e4) efa->e4->tmp.f = efa;
efa= efa->next;
}
@@ -957,7 +983,7 @@ short extrudeflag_vert(short flag, float
*/
/* copy all selected vertices, */
- /* write pointer to new vert in old struct at eve->vn */
+ /* write pointer to new vert in old struct at eve->tmp.v */
eve= em->verts.last;
while(eve) {
eve->f &= ~128; /* clear, for later test for loose verts */
@@ -968,9 +994,9 @@ short extrudeflag_vert(short flag, float
VECCOPY(v1->co, eve->co);
v1->f= eve->f;
eve->f-= flag;
- eve->vn= v1;
+ eve->tmp.v = v1;
}
- else eve->vn= 0;
+ else eve->tmp.v = 0;
eve= eve->prev;
}
@@ -1007,11 +1033,17 @@ short extrudeflag_vert(short flag, float
if( (eed->f2==1 || eed->f2==2) ) {
/* if del_old, the preferred normal direction is exact opposite as for keep old faces */
- if(eed->dir!=del_old) efa2= addfacelist(eed->v1, eed->v2, eed->v2->vn, eed->v1->vn, NULL, NULL);
- else efa2= addfacelist(eed->v2, eed->v1, eed->v1->vn, eed->v2->vn, NULL, NULL);
+ if(eed->dir != del_old)
+ efa2 = addfacelist(eed->v1, eed->v2,
+ eed->v2->tmp.v, eed->v1->tmp.v,
+ NULL, NULL);
+ else
+ efa2 = addfacelist(eed->v2, eed->v1,
+ eed->v1->tmp.v, eed->v2->tmp.v,
+ NULL, NULL);
- if(eed->vn) {
- efa= (EditFace *)eed->vn;
+ if(eed->tmp.f) {
+ efa = eed->tmp.f;
efa2->mat_nr= efa->mat_nr;
efa2->tf= efa->tf;
efa2->flag= efa->flag;
@@ -1046,15 +1078,19 @@ short extrudeflag_vert(short flag, float
nextvl= efa->next;
if(efa->f1 & 1) {
- v1= efa->v1->vn;
- v2= efa->v2->vn;
- v3= efa->v3->vn;
- if(efa->v4) v4= efa->v4->vn; else v4= 0;
-
+ v1 = efa->v1->tmp.v;
+ v2 = efa->v2->tmp.v;
+ v3 = efa->v3->tmp.v;
+ if(efa->v4)
+ v4 = efa->v4->tmp.v;
+ else
+ v4= 0;
+
+ /* hmm .. not sure about edges here */
if(del_old==0) // if we keep old, we flip normal
- efa2= addfacelist(v3, v2, v1, v4, efa, efa); /* hmm .. not sure about edges here */
+ efa2= addfacelist(v3, v2, v1, v4, efa, efa);
else
- efa2= addfacelist(v1, v2, v3, v4, efa, efa); /* hmm .. not sure about edges here */
+ efa2= addfacelist(v1, v2, v3, v4, efa, efa);
/* for transform */
add_normal_aligned(nor, efa->n);
@@ -1069,15 +1105,15 @@ short extrudeflag_vert(short flag, float
Normalise(nor); // for grab
- /* for all vertices with eve->vn!=0
+ /* for all vertices with eve->tmp.v!=0
if eve->f1==1: make edge
if flag!=128 : if del_old==1: remove
*/
eve= em->verts.last;
while(eve) {
nextve= eve->prev;
- if(eve->vn) {
- if(eve->f1==1) addedgelist(eve, eve->vn, NULL);
+ if(eve->tmp.v) {
+ if(eve->f1==1) addedgelist(eve, eve->tmp.v, NULL);
else if( (eve->f & 128)==0) {
if(del_old) {
BLI_remlink(&em->verts,eve);
@@ -1168,7 +1204,7 @@ void adduplicateflag(int flag)
eve->f-= flag;
eve->f|= 128;
- eve->vn= v1;
+ eve->tmp.v = v1;
/* >>>>> FIXME: Copy deformation weight ? */
v1->totweight = eve->totweight;
@@ -1184,8 +1220,8 @@ void adduplicateflag(int flag)
/* copy edges */
for(eed= em->edges.last; eed; eed= eed->prev) {
if( eed->f & flag ) {
- v1= eed->v1->vn;
- v2= eed->v2->vn;
+ v1 = eed->v1->tmp.v;
+ v2 = eed->v2->tmp.v;
newed= addedgelist(v1, v2, eed);
newed->f= eed->f;
@@ -1197,10 +1233,10 @@ void adduplicateflag(int flag)
/* then dupicate faces */
for(efa= em->faces.last; efa; efa= efa->prev) {
if(efa->f & flag) {
- v1= efa->v1->vn;
- v2= efa->v2->vn;
- v3= efa->v3->vn;
- if(efa->v4) v4= efa->v4->vn; else v4= NULL;
+ v1 = efa->v1->tmp.v;
+ v2 = efa->v2->tmp.v;
+ v3 = efa->v3->tmp.v;
+ if(efa->v4) v4 = efa->v4->tmp.v; else v4= NULL;
newfa= addfacelist(v1, v2, v3, v4, efa, efa);
newfa->f= efa->f;
Index: source/blender/src/editmesh_mods.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh_mods.c,v
retrieving revision 1.72.2.2
diff -u -p -r1.72.2.2 editmesh_mods.c
--- source/blender/src/editmesh_mods.c 29 Dec 2005 23:26:48 -0000 1.72.2.2
+++ source/blender/src/editmesh_mods.c 31 Dec 2005 03:56:17 -0000
@@ -1517,7 +1517,7 @@ void select_sharp_edges(void)
EditFace *efa;
EditFace **efa1;
EditFace **efa2;
- long edgecount = 0, i, *vnptr;
+ long edgecount = 0, i;
static short sharpness = 135;
float fsharpness;
@@ -1533,12 +1533,11 @@ void select_sharp_edges(void)
fsharpness = ((180.0 - sharpness) * M_PI) / 180.0;
i=0;
- /* count edges, (ab)use vn to be a long */
+ /* count edges, use tmp.l */
eed= em->edges.first;
while(eed) {
edgecount++;
- vnptr = (long *) &eed->vn;
- *vnptr = i;
+ eed->tmp.l = i;
eed= eed->next;
++i;
}
@@ -1549,12 +1548,13 @@ void select_sharp_edges(void)
efa2 = MEM_callocN(edgecount*sizeof(EditFace *),
"pairs of edit face pointers");
-#define face_table_edge { \
- i = *vnptr; \
+#define face_table_edge(eed) { \
+ i = eed->tmp.l; \
if (i != -1) { \
if (efa1[i]) { \
if (efa2[i]) { \
- *vnptr = -1; /* bad, edge has more than two neighbors */ \
+ /* invalidate, edge has more than two neighbors */ \
+ eed->tmp.l = -1; \
} \
else { \
efa2[i] = efa; \
@@ -1569,25 +1569,20 @@ void select_sharp_edges(void)
/* find the adjacent faces of each edge, we want only two */
efa= em->faces.first;
while(efa) {
- vnptr = (long *) &efa->e1->vn;
- face_table_edge;
- vnptr = (long *) &efa->e2->vn;
- face_table_edge;
- vnptr = (long *) &efa->e3->vn;
- face_table_edge;
+ face_table_edge(efa->e1);
+ face_table_edge(efa->e2);
+ face_table_edge(efa->e3);
if (efa->e4) {
- vnptr = (long *) &efa->e4->vn;
- face_table_edge;
+ face_table_edge(efa->e4);
}
efa= efa->next;
}
#undef face_table_edge
- eed= em->edges.first;
+ eed = em->edges.first;
while(eed) {
- vnptr = (long *) &eed->vn;
- i = *vnptr;
+ i = eed->tmp.l;
if (i != -1) {
/* edge has two or less neighboring faces */
if ( (efa1[i]) && (efa2[i]) ) {
@@ -1623,7 +1618,7 @@ void select_linked_flat_faces(void)
EditFace *efa;
EditFace **efa1;
EditFace **efa2;
- long edgecount = 0, i, *vnptr, faceselcount=0, faceselcountold=0;
+ long edgecount = 0, i, faceselcount=0, faceselcountold=0;
static short sharpness = 135;
float fsharpness;
@@ -1639,12 +1634,11 @@ void select_linked_flat_faces(void)
fsharpness = ((180.0 - sharpness) * M_PI) / 180.0;
i=0;
- /* count edges, (ab)use vn to be a long */
+ /* count edges, use tmp.l */
eed= em->edges.first;
while(eed) {
edgecount++;
- vnptr = (long *) &eed->vn;
- *vnptr = i;
+ eed->tmp.l = i;
eed= eed->next;
++i;
}
@@ -1655,12 +1649,13 @@ void select_linked_flat_faces(void)
efa2 = MEM_callocN(edgecount*sizeof(EditFace *),
"pairs of edit face pointers");
-#define face_table_edge { \
- i = *vnptr; \
+#define face_table_edge(eed) { \
+ i = eed->tmp.l; \
if (i != -1) { \
if (efa1[i]) { \
if (efa2[i]) { \
- *vnptr = -1; /* bad, edge has more than two neighbors */ \
+ /* invalidate, edge has more than two neighbors */ \
+ eed->tmp.l = -1; \
} \
else { \
efa2[i] = efa; \
@@ -1675,15 +1670,11 @@ void select_linked_flat_faces(void)
/* find the adjacent faces of each edge, we want only two */
efa= em->faces.first;
while(efa) {
- vnptr = (long *) &efa->e1->vn;
- face_table_edge;
- vnptr = (long *) &efa->e2->vn;
- face_table_edge;
- vnptr = (long *) &efa->e3->vn;
- face_table_edge;
+ face_table_edge(efa->e1);
+ face_table_edge(efa->e2);
+ face_table_edge(efa->e3);
if (efa->e4) {
- vnptr = (long *) &efa->e4->vn;
- face_table_edge;
+ face_table_edge(efa->e4);
}
/* while were at it, count the selected faces */
@@ -1696,8 +1687,7 @@ void select_linked_flat_faces(void)
eed= em->edges.first;
while(eed) {
- vnptr = (long *) &eed->vn;
- i = *vnptr;
+ i = eed->tmp.l;
if (i != -1) {
/* edge has two or less neighboring faces */
if ( (efa1[i]) && (efa2[i]) ) {
@@ -1706,21 +1696,21 @@ void select_linked_flat_faces(void)
angle = saacos(efa1[i]->n[0]*efa2[i]->n[0] +
efa1[i]->n[1]*efa2[i]->n[1] +
efa1[i]->n[2]*efa2[i]->n[2]);
- /* flag sharp edges */
+ /* invalidate: edge too sharp */
if (fabs(angle) >= fsharpness)
- *vnptr = -1;
+ eed->tmp.l = -1;
}
else {
- /* less than two neighbors */
- *vnptr = -1;
+ /* invalidate: less than two neighbors */
+ eed->tmp.l = -1;
}
}
eed= eed->next;
}
-#define select_flat_neighbor { \
- i = *vnptr; \
+#define select_flat_neighbor(eed) { \
+ i = eed->tmp.l; \
if (i!=-1) { \
if (! (efa1[i]->f & SELECT) ) { \
EM_select_face(efa1[i], 1); \
@@ -1739,15 +1729,11 @@ void select_linked_flat_faces(void)
efa= em->faces.first;
while(efa) {
if (efa->f & SELECT) {
- vnptr = (long *) &efa->e1->vn;
- select_flat_neighbor;
- vnptr = (long *) &efa->e2->vn;
- select_flat_neighbor;
- vnptr = (long *) &efa->e3->vn;
- select_flat_neighbor;
+ select_flat_neighbor(efa->e1);
+ select_flat_neighbor(efa->e2);
+ select_flat_neighbor(efa->e3);
if (efa->e4) {
- vnptr = (long *) &efa->e4->vn;
- select_flat_neighbor;
+ select_flat_neighbor(efa->e4);
}
}
efa= efa->next;
@@ -2547,7 +2533,7 @@ void vertexsmooth(void)
eve= em->verts.first;
while(eve) {
if(eve->f & SELECT) {
- eve->vn= (EditVert *)adr;
+ eve->tmp.fp = adr;
eve->f1= 0;
eve->f2= 0;
adr+= 3;
@@ -2595,11 +2581,11 @@ void vertexsmooth(void)
if((eed->v1->f & SELECT) && eed->v1->f1<255) {
eed->v1->f1++;
- VecAddf((float *)eed->v1->vn, (float *)eed->v1->vn, fvec);
+ VecAddf(eed->v1->tmp.fp, eed->v1->tmp.fp, fvec);
}
if((eed->v2->f & SELECT) && eed->v2->f1<255) {
eed->v2->f1++;
- VecAddf((float *)eed->v2->vn, (float *)eed->v2->vn, fvec);
+ VecAddf(eed->v2->tmp.fp, eed->v2->tmp.fp, fvec);
}
}
eed= eed->next;
@@ -2609,7 +2595,7 @@ void vertexsmooth(void)
while(eve) {
if(eve->f & SELECT) {
if(eve->f1) {
- adr= (float *)eve->vn;
+ adr = eve->tmp.fp;
fac= 0.5/(float)eve->f1;
eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
@@ -2629,7 +2615,7 @@ void vertexsmooth(void)
}
}
}
- eve->vn= 0;
+ eve->tmp.fp= 0;
}
eve= eve->next;
}
Index: source/blender/src/editmesh_tools.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh_tools.c,v
retrieving revision 1.131.2.7
diff -u -p -r1.131.2.7 editmesh_tools.c
--- source/blender/src/editmesh_tools.c 24 Dec 2005 17:06:14 -0000 1.131.2.7
+++ source/blender/src/editmesh_tools.c 31 Dec 2005 03:56:18 -0000
@@ -259,7 +259,7 @@ int removedoublesflag(short flag, float
dist= (float)fabs(v1->co[2]-eve->co[2]);
if(dist<=limit) {
v1->f|= 128;
- v1->vn= eve;
+ v1->tmp.v = eve;
}
}
}
@@ -285,8 +285,8 @@ int removedoublesflag(short flag, float
if( (eed->v1->f & 128) || (eed->v2->f & 128) ) {
remedge(eed);
- if(eed->v1->f & 128) eed->v1= eed->v1->vn;
- if(eed->v2->f & 128) eed->v2= eed->v2->vn;
+ if(eed->v1->f & 128) eed->v1 = eed->v1->tmp.v;
+ if(eed->v2->f & 128) eed->v2 = eed->v2->tmp.v;
e1= addedgelist(eed->v1, eed->v2, eed);
if(e1) e1->f2= 1;
@@ -316,10 +316,10 @@ int removedoublesflag(short flag, float
nextvl= efa->next;
if(efa->f1==1) {
- if(efa->v1->f & 128) efa->v1= efa->v1->vn;
- if(efa->v2->f & 128) efa->v2= efa->v2->vn;
- if(efa->v3->f & 128) efa->v3= efa->v3->vn;
- if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->vn;
+ if(efa->v1->f & 128) efa->v1= efa->v1->tmp.v;
+ if(efa->v2->f & 128) efa->v2= efa->v2->tmp.v;
+ if(efa->v3->f & 128) efa->v3= efa->v3->tmp.v;
+ if(efa->v4 && (efa->v4->f & 128)) efa->v4= efa->v4->tmp.v;
test= 0;
if(efa->v1==efa->v2) test+=1;
@@ -1061,8 +1061,8 @@ void fill_mesh(void)
while(eve) {
if(eve->f & SELECT) {
v1= BLI_addfillvert(eve->co);
- eve->vn= v1;
- v1->vn= eve;
+ eve->tmp.v= v1;
+ v1->tmp.v= eve;
v1->xs= 0; // used for counting edges
}
eve= eve->next;
@@ -1071,7 +1071,7 @@ void fill_mesh(void)
eed= em->edges.first;
while(eed) {
if( (eed->v1->f & SELECT) && (eed->v2->f & SELECT) ) {
- e1= BLI_addfilledge(eed->v1->vn, eed->v2->vn);
+ e1= BLI_addfilledge(eed->v1->tmp.v, eed->v2->tmp.v);
e1->v1->xs++;
e1->v2->xs++;
}
@@ -1085,10 +1085,10 @@ void fill_mesh(void)
while(efa) {
nextvl= efa->next;
if( faceselectedAND(efa, 1) ) {
- efa->v1->vn->xs--;
- efa->v2->vn->xs--;
- efa->v3->vn->xs--;
- if(efa->v4) efa->v4->vn->xs--;
+ efa->v1->tmp.v->xs--;
+ efa->v2->tmp.v->xs--;
+ efa->v3->tmp.v->xs--;
+ if(efa->v4) efa->v4->tmp.v->xs--;
ok= 1;
}
@@ -1108,7 +1108,9 @@ void fill_mesh(void)
if(BLI_edgefill(0, (G.obedit && G.obedit->actcol)?(G.obedit->actcol-1):0)) {
efa= fillfacebase.first;
while(efa) {
- efan= addfacelist(efa->v3->vn, efa->v2->vn, efa->v1->vn, 0, NULL, NULL); // normals default pointing up
+ /* normals default pointing up */
+ efan= addfacelist(efa->v3->tmp.v, efa->v2->tmp.v,
+ efa->v1->tmp.v, 0, NULL, NULL);
EM_select_face(efan, 1);
efa= efa->next;
}
@@ -2626,7 +2628,7 @@ static int count_selected_edges(EditEdge
{
int totedge = 0;
while(ed) {
- ed->vn= 0;
+ ed->tmp.p = 0;
if( ed->f & SELECT ) totedge++;
ed= ed->next;
}
@@ -2653,10 +2655,10 @@ static int collect_quadedges(EVPTuple *e
eed->f2= 0;
eed->f1= 0;
if( eed->f & SELECT ) {
- eed->vn= (EditVert *) (&efaa[i]);
+ eed->tmp.p = (EditVert *) (&efaa[i]);
i++;
}
- else eed->vn= NULL;
+ else eed->tmp.p = NULL;
eed= eed->next;
}
@@ -2676,23 +2678,23 @@ static int collect_quadedges(EVPTuple *e
e1= efa->e1;
e2= efa->e2;
e3= efa->e3;
- if(e1->f2<3 && e1->vn) {
+ if(e1->f2<3 && e1->tmp.p) {
if(e1->f2<2) {
- evp= (EVPtr *) e1->vn;
- evp[(int)e1->f2]= efa;
+ evp= (EVPtr *) e1->tmp.p;
+ evp[(int)e1->f2] = efa;
}
e1->f2+= 1;
}
- if(e2->f2<3 && e2->vn) {
+ if(e2->f2<3 && e2->tmp.p) {
if(e2->f2<2) {
- evp= (EVPtr *) e2->vn;
+ evp= (EVPtr *) e2->tmp.p;
evp[(int)e2->f2]= efa;
}
e2->f2+= 1;
}
- if(e3->f2<3 && e3->vn) {
+ if(e3->f2<3 && e3->tmp.p) {
if(e3->f2<2) {
- evp= (EVPtr *) e3->vn;
+ evp= (EVPtr *) e3->tmp.p;
evp[(int)e3->f2]= efa;
}
e3->f2+= 1;
@@ -2904,7 +2906,7 @@ void beauty_fill(void)
/* f2 is set in collect_quadedges() */
if(eed->f2==2 && eed->h==0) {
- efaa = (EVPtr *) eed->vn;
+ efaa = (EVPtr *) eed->tmp.p;
/* none of the faces should be treated before, nor be part of fgon */
ok= 1;
@@ -3076,7 +3078,7 @@ void join_triangles(void)
if(eed->f2==2) { /* points to 2 faces */
- efaa= (EVPtr *) eed->vn;
+ efaa= (EVPtr *) eed->tmp.p;
/* don't do it if flagged */
@@ -3173,7 +3175,7 @@ void edge_flip(void)
if(eed->f2==2) { /* points to 2 faces */
- efaa= (EVPtr *) eed->vn;
+ efaa= (EVPtr *) eed->tmp.p;
/* don't do it if flagged */
@@ -4041,7 +4043,7 @@ static void bevel_mesh(float bsize, int
efa->f1-= 1;
v1= addvertlist(efa->v1->co);
v1->f= efa->v1->f & ~128;
- efa->v1->vn= v1;
+ efa->v1->tmp.v = v1;
#ifdef __NLA
v1->totweight = efa->v1->totweight;
if (efa->v1->totweight) {
@@ -4053,7 +4055,7 @@ static void bevel_mesh(float bsize, int
#endif
v1= addvertlist(efa->v2->co);
v1->f= efa->v2->f & ~128;
- efa->v2->vn= v1;
+ efa->v2->tmp.v = v1;
#ifdef __NLA
v1->totweight = efa->v2->totweight;
if (efa->v2->totweight) {
@@ -4065,7 +4067,7 @@ static void bevel_mesh(float bsize, int
#endif
v1= addvertlist(efa->v3->co);
v1->f= efa->v3->f & ~128;
- efa->v3->vn= v1;
+ efa->v3->tmp.v = v1;
#ifdef __NLA
v1->totweight = efa->v3->totweight;
if (efa->v3->totweight) {
@@ -4078,7 +4080,7 @@ static void bevel_mesh(float bsize, int
if (efa->v4) {
v1= addvertlist(efa->v4->co);
v1->f= efa->v4->f & ~128;
- efa->v4->vn= v1;
+ efa->v4->tmp.v = v1;
#ifdef __NLA
v1->totweight = efa->v4->totweight;
if (efa->v4->totweight) {
@@ -4091,21 +4093,29 @@ static void bevel_mesh(float bsize, int
}
/* Needs better adaption of creases? */
- addedgelist(efa->e1->v1->vn, efa->e1->v2->vn, efa->e1);
- addedgelist(efa->e2->v1->vn,efa->e2->v2->vn, efa->e2);
- addedgelist(efa->e3->v1->vn,efa->e3->v2->vn, efa->e3);
- if (efa->e4) addedgelist(efa->e4->v1->vn,efa->e4->v2->vn, efa->e4);
+ addedgelist(efa->e1->v1->tmp.v,
+ efa->e1->v2->tmp.v,
+ efa->e1);
+ addedgelist(efa->e2->v1->tmp.v,
+ efa->e2->v2->tmp.v,
+ efa->e2);
+ addedgelist(efa->e3->v1->tmp.v,
+ efa->e3->v2->tmp.v,
+ efa->e3);
+ if (efa->e4) addedgelist(efa->e4->v1->tmp.v,
+ efa->e4->v2->tmp.v,
+ efa->e4);
if(efa->v4) {
- v1= efa->v1->vn;
- v2= efa->v2->vn;
- v3= efa->v3->vn;
- v4= efa->v4->vn;
+ v1 = efa->v1->tmp.v;
+ v2 = efa->v2->tmp.v;
+ v3 = efa->v3->tmp.v;
+ v4 = efa->v4->tmp.v;
addfacelist(v1, v2, v3, v4, efa,NULL);
} else {
- v1= efa->v1->vn;
- v2= efa->v2->vn;
- v3= efa->v3->vn;
+ v1= efa->v1->tmp.v;
+ v2= efa->v2->tmp.v;
+ v3= efa->v3->tmp.v;
addfacelist(v1, v2, v3, 0, efa,NULL);
}
@@ -4141,8 +4151,9 @@ static void bevel_mesh(float bsize, int
eed= em->edges.first;
while(eed) {
eed->f2= eed->f1= 0;
- if ( ((eed->v1->f & eed->v2->f) & 1) || allfaces) eed->f1 |= 4; /* original edges */
- eed->vn= 0;
+ if ( ((eed->v1->f & eed->v2->f) & 1) || allfaces)
+ eed->f1 |= 4; /* original edges */
+ eed->tmp.v = 0;
eed= eed->next;
}
@@ -4220,7 +4231,7 @@ static void bevel_mesh(float bsize, int
eed->f1= 0;
eed->v1->f1 &= ~1;
eed->v2->f1 &= ~1;
- eed->vn= 0;
+ eed->tmp.v = 0;
eed= eed->next;
}
@@ -4233,11 +4244,11 @@ static void bevel_mesh(float bsize, int
eve= em->verts.first;
while (eve) {
eve->f &= ~(64|128);
- eve->vn= NULL;
+ eve->tmp.v = NULL;
eve= eve->next;
}
- /* eve->f: 128: first vertex in a list (->vn) */
+ /* eve->f: 128: first vertex in a list (->tmp.v) */
/* 64: vertex is in a list */
eve= em->verts.first;
@@ -4250,11 +4261,11 @@ static void bevel_mesh(float bsize, int
if ((eve->f & (128|64)) == 0) {
/* fprintf(stderr,"Found vertex cluster:\n *\n *\n"); */
eve->f |= 128;
- eve->vn= eve2;
+ eve->tmp.v = eve2;
eve3= eve2;
} else if ((eve->f & 64) == 0) {
/* fprintf(stderr," *\n"); */
- if (eve3) eve3->vn= eve2;
+ if (eve3) eve3->tmp.v = eve2;
eve2->f |= 64;
eve3= eve2;
}
@@ -4262,7 +4273,7 @@ static void bevel_mesh(float bsize, int
}
eve2= eve2->next;
if (!eve2) {
- if (eve3) eve3->vn= NULL;
+ if (eve3) eve3->tmp.v = NULL;
}
}
eve= eve->next;
@@ -4292,11 +4303,11 @@ static void bevel_mesh(float bsize, int
eve->f &= ~128;
a= 0;
neweve[a]= eve;
- eve2= eve->vn;
+ eve2 = eve->tmp.v;
while (eve2) {
a++;
neweve[a]= eve2;
- eve2= eve2->vn;
+ eve2 = eve2->tmp.v;
}
a++;
efa= NULL;
@@ -4379,7 +4390,7 @@ static void bevel_mesh(float bsize, int
while (eve) {
eve->f1= 0;
eve->f &= ~(128|64);
- eve->vn= NULL;
+ eve->tmp.v= NULL;
eve= eve->next;
}
@@ -5144,10 +5155,10 @@ static float mesh_rip_edgedist(float mat
static void mesh_rip_setface(EditFace *sefa)
{
/* put new vertices & edges in best face */
- if(sefa->v1->vn) sefa->v1= sefa->v1->vn;
- if(sefa->v2->vn) sefa->v2= sefa->v2->vn;
- if(sefa->v3->vn) sefa->v3= sefa->v3->vn;
- if(sefa->v4 && sefa->v4->vn) sefa->v4= sefa->v4->vn;
+ if(sefa->v1->tmp.v) sefa->v1= sefa->v1->tmp.v;
+ if(sefa->v2->tmp.v) sefa->v2= sefa->v2->tmp.v;
+ if(sefa->v3->tmp.v) sefa->v3= sefa->v3->tmp.v;
+ if(sefa->v4 && sefa->v4->tmp.v) sefa->v4= sefa->v4->tmp.v;
sefa->e1= addedgelist(sefa->v1, sefa->v2, sefa->e1);
sefa->e2= addedgelist(sefa->v2, sefa->v3, sefa->e2);
@@ -5213,11 +5224,11 @@ void mesh_rip(void)
/* duplicate vertices, new vertices get selected */
for(eve = em->verts.last; eve; eve= eve->prev) {
- eve->vn= NULL;
+ eve->tmp.v = NULL;
if(eve->f & SELECT) {
- eve->vn= addvertlist(eve->co);
+ eve->tmp.v = addvertlist(eve->co);
eve->f &= ~SELECT;
- eve->vn->f |= SELECT;
+ eve->tmp.v->f |= SELECT;
}
}
@@ -5231,29 +5242,37 @@ void mesh_rip(void)
/* or we do the distance trick */
if(seed==NULL) {
mindist= 1000000.0f;
- if(sefa->e1->v1->vn || sefa->e1->v2->vn) {
- dist= mesh_rip_edgedist(projectMat, sefa->e1->v1->co, sefa->e1->v2->co, mval);
+ if(sefa->e1->v1->tmp.v || sefa->e1->v2->tmp.v) {
+ dist = mesh_rip_edgedist(projectMat,
+ sefa->e1->v1->co,
+ sefa->e1->v2->co, mval);
if(dist<mindist) {
seed= sefa->e1;
mindist= dist;
}
}
- if(sefa->e2->v1->vn || sefa->e2->v2->vn) {
- dist= mesh_rip_edgedist(projectMat, sefa->e2->v1->co, sefa->e2->v2->co, mval);
+ if(sefa->e2->v1->tmp.v || sefa->e2->v2->tmp.v) {
+ dist = mesh_rip_edgedist(projectMat,
+ sefa->e2->v1->co,
+ sefa->e2->v2->co, mval);
if(dist<mindist) {
seed= sefa->e2;
mindist= dist;
}
}
- if(sefa->e3->v1->vn || sefa->e3->v2->vn) {
- dist= mesh_rip_edgedist(projectMat, sefa->e3->v1->co, sefa->e3->v2->co, mval);
+ if(sefa->e3->v1->tmp.v || sefa->e3->v2->tmp.v) {
+ dist= mesh_rip_edgedist(projectMat,
+ sefa->e3->v1->co,
+ sefa->e3->v2->co, mval);
if(dist<mindist) {
seed= sefa->e3;
mindist= dist;
}
}
- if(sefa->e4 && (sefa->e4->v1->vn || sefa->e4->v2->vn)) {
- dist= mesh_rip_edgedist(projectMat, sefa->e4->v1->co, sefa->e4->v2->co, mval);
+ if(sefa->e4 && (sefa->e4->v1->tmp.v || sefa->e4->v2->tmp.v)) {
+ dist= mesh_rip_edgedist(projectMat,
+ sefa->e4->v1->co,
+ sefa->e4->v2->co, mval);
if(dist<mindist) {
seed= sefa->e4;
mindist= dist;
@@ -5270,16 +5289,17 @@ void mesh_rip(void)
/* duplicate edges in the loop, with at least 1 vertex selected, needed for selection flip */
for(eed = em->edges.last; eed; eed= eed->prev) {
- eed->vn= NULL;
- if((eed->v1->vn) || (eed->v2->vn)) {
+ eed->tmp.v = NULL;
+ if((eed->v1->tmp.v) || (eed->v2->tmp.v)) {
EditEdge *newed;
- newed= addedgelist(eed->v1->vn?eed->v1->vn:eed->v1, eed->v2->vn?eed->v2->vn:eed->v2, eed);
+ newed= addedgelist(eed->v1->tmp.v?eed->v1->tmp.v:eed->v1,
+ eed->v2->tmp.v?eed->v2->tmp.v:eed->v2, eed);
if(eed->f & SELECT) {
eed->f &= ~SELECT;
newed->f |= SELECT;
}
- eed->vn= (EditVert *)newed;
+ eed->tmp.v = (EditVert *)newed;
}
}
@@ -5297,7 +5317,8 @@ void mesh_rip(void)
for(efa= em->faces.first; efa; efa=efa->next) {
/* new vert in face */
- if(efa->v1->vn || efa->v2->vn || efa->v3->vn || (efa->v4 && efa->v4->vn)) {
+ if (efa->v1->tmp.v || efa->v2->tmp.v ||
+ efa->v3->tmp.v || (efa->v4 && efa->v4->tmp.v)) {
/* face is tagged with loop */
if(efa->f1==1) {
mesh_rip_setface(efa);
@@ -5321,7 +5342,8 @@ void mesh_rip(void)
for(eed = em->edges.last; eed; eed= seed) {
seed= eed->prev;
if(eed->f1==0) {
- if(eed->v1->vn || eed->v2->vn || (eed->v1->f & SELECT) || (eed->v2->f & SELECT)) {
+ if(eed->v1->tmp.v || eed->v2->tmp.v ||
+ (eed->v1->f & SELECT) || (eed->v2->f & SELECT)) {
remedge(eed);
free_editedge(eed);
eed= NULL;
@@ -5336,7 +5358,7 @@ void mesh_rip(void)
/* and remove loose selected vertices, that got duplicated accidentally */
for(eve = em->verts.first; eve; eve= nextve) {
nextve= eve->next;
- if(eve->f1==0 && (eve->vn || (eve->f & SELECT))) {
+ if(eve->f1==0 && (eve->tmp.v || (eve->f & SELECT))) {
BLI_remlink(&em->verts,eve);
free_editvert(eve);
}
Index: source/blender/src/transform_conversions.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/transform_conversions.c,v
retrieving revision 1.70.2.5
diff -u -p -r1.70.2.5 transform_conversions.c
--- source/blender/src/transform_conversions.c 19 Dec 2005 18:56:08 -0000 1.70.2.5
+++ source/blender/src/transform_conversions.c 31 Dec 2005 03:56:18 -0000
@@ -1268,8 +1268,8 @@ static void createTransLatticeVerts(Tran
/* ********************* mesh ****************** */
/* proportional distance based on connectivity */
-#define E_VEC(a) (vectors + (3 * (int)(a)->vn))
-#define E_NEAR(a) (nears[((int)(a)->vn)])
+#define E_VEC(a) (vectors + (3 * (a)->tmp.l))
+#define E_NEAR(a) (nears[((a)->tmp.l)])
static void editmesh_set_connectivity_distance(int total, float *vectors, EditVert **nears)
{
EditMesh *em = G.editMesh;
@@ -1278,10 +1278,10 @@ static void editmesh_set_connectivity_di
int i= 0, done= 1;
/* f2 flag is used for 'selection' */
- /* vn is offset on scratch array */
+ /* tmp.l is offset on scratch array */
for(eve= em->verts.first; eve; eve= eve->next) {
if(eve->h==0) {
- eve->vn = (EditVert *)(i++);
+ eve->tmp.l = i++;
if(eve->f & SELECT) {
eve->f2= 2;
@@ -1423,13 +1423,13 @@ static float *get_mapped_editverts(void)
/* helper for below, interpolates or assigns and increments */
static float *crazy_quat_blend(EditVert *eve, float *quat)
{
- if(eve->vn==NULL) {
- eve->vn= (EditVert *)quat;
+ if(eve->tmp.fp == NULL) {
+ eve->tmp.fp = quat;
QUATCOPY(quat+4, quat);
return quat+4;
}
else {
- float *q1= (float *)eve->vn;
+ float *q1= eve->tmp.fp;
QuatInterpol(q1, q1, quat, 0.5f);
return quat;
}
@@ -1446,7 +1446,7 @@ static void set_crazyspace_quats(float *
/* 2 abused locations in vertices */
for(eve= em->verts.first; eve; eve= eve->next, index++) {
- eve->vn= NULL;
+ eve->tmp.fp = NULL;
eve->prev= (EditVert *)index;
}
@@ -1454,8 +1454,10 @@ static void set_crazyspace_quats(float *
for(efa= em->faces.first; efa; efa= efa->next) {
/* vertex f1 flags were set for transform */
- if( (efa->v1->f1 && efa->v1->vn==NULL) || (efa->v2->f1 && efa->v2->vn==NULL)
- || (efa->v3->f1 && efa->v3->vn==NULL) || (efa->v4 && efa->v4->f1 && efa->v4->vn==NULL) ) {
+ if( (efa->v1->f1 && efa->v1->tmp.fp==NULL) ||
+ (efa->v2->f1 && efa->v2->tmp.fp==NULL) ||
+ (efa->v3->f1 && efa->v3->tmp.fp==NULL) ||
+ (efa->v4 && efa->v4->f1 && efa->v4->tmp.fp==NULL) ) {
triatoquat(efa->v1->co, efa->v2->co, efa->v3->co, q1);
@@ -1589,10 +1591,10 @@ static void createTransEditVerts(TransIn
}
/* CrazySpace */
- if(quats && eve->vn) {
+ if(quats && eve->tmp.fp) {
float mat[3][3], imat[3][3], qmat[3][3];
- QuatToMat3((float *)eve->vn, qmat);
+ QuatToMat3(eve->tmp.fp, qmat);
Mat3MulMat3(mat, mtx, qmat);
Mat3Inv(imat, mat);

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c8/55/2fcf318db13ee889f8fd9b23ae9a

Event Timeline