Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-06-03 00:52:40 +0400
committerGeoffrey Bantle <hairbat@yahoo.com>2008-06-03 00:52:40 +0400
commit8a5f36219214b4a5b8348b8e200ef5aac2297963 (patch)
treed59bc097566e1cd226f0827126fa54b0528b5b6f /source/blender/blenkernel/intern/BME_structure.c
parent1cc61f633fb16a4aca576bccef365f8e515c5a3d (diff)
-> More Bmesh Custom Data stuff
Some more Bmesh custom data functions and structures. This still does not do anything yet because the various conversion functions don't bother making use of the new custom data functions. Hooking them up should be fairly simple though. Also note that the custom data code is mostly copy/pasted from the existing custom data functions for editmode with a few modifications. Duplicating code like this isn't nice, but I felt it was better to keep things for Bmesh 'standalone' for the moment and take only what is immediatly needed instead of creating a tangle of interdependant code.
Diffstat (limited to 'source/blender/blenkernel/intern/BME_structure.c')
-rw-r--r--source/blender/blenkernel/intern/BME_structure.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/BME_structure.c b/source/blender/blenkernel/intern/BME_structure.c
index 8f885d6c2cb..cbf780c6467 100644
--- a/source/blender/blenkernel/intern/BME_structure.c
+++ b/source/blender/blenkernel/intern/BME_structure.c
@@ -193,12 +193,12 @@ BME_Vert *BME_addvertlist(BME_Mesh *bm, BME_Vert *example){
bm->nextv++;
bm->totvert++;
- if(example)
+ if(example){
VECCOPY(v->co,example->co);
- //if(example)
- // CustomData_em_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data);
- //else
- // CustomData_em_set_default(&bm->vdata, &v->data);
+ BME_CD_copy_data(&bm->vdata, &bm->vdata, example->data, &v->data);
+ }
+ else
+ BME_CD_set_default(&bm->vdata, &v->data);
return v;
}
@@ -221,16 +221,15 @@ BME_Edge *BME_addedgelist(BME_Mesh *bm, BME_Vert *v1, BME_Vert *v2, BME_Edge *ex
bm->totedge++;
BLI_addtail(&(bm->edges), e);
- //if(example)
- // CustomData_em_copy_data(&bm->edata, &bm->edata, example->data, &e->data);
- //else
- // CustomData_em_set_default(&bm->edata, &e->data);
+ if(example)
+ BME_CD_copy_data(&bm->edata, &bm->edata, example->data, &e->data);
+ else
+ BME_CD_set_default(&bm->edata, &e->data);
return e;
}
BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, BME_Loop *example){
- /*allocate a BME_Loop and add it to the loophash*/
BME_Loop *l=NULL;
l = BME_mempool_alloc(bm->lpool);
l->next = l->prev = NULL;
@@ -246,12 +245,11 @@ BME_Loop *BME_create_loop(BME_Mesh *bm, BME_Vert *v, BME_Edge *e, BME_Poly *f, B
bm->nextl++;
bm->totloop++;
-
-/* if(example)
- BME_CustomData_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data);
+ if(example)
+ BME_CD_copy_data(&bm->ldata, &bm->ldata, example->data, &l->data);
else
- BME_CustomData_set_default(&bm->ldata, &l->data);
-*/
+ BME_CD_set_default(&bm->ldata, &l->data);
+
return l;
}
@@ -269,10 +267,10 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){
bm->nextp++;
bm->totpoly++;
- //if(example)
- // CustomData_em_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data);
- //else
- // CustomData_em_set_default(&bm->pdata, &f->data);
+ if(example)
+ BME_CD_copy_data(&bm->pdata, &bm->pdata, example->data, &f->data);
+ else
+ BME_CD_set_default(&bm->pdata, &f->data);
return f;
@@ -283,22 +281,22 @@ BME_Poly *BME_addpolylist(BME_Mesh *bm, BME_Poly *example){
*/
void BME_free_vert(BME_Mesh *bm, BME_Vert *v){
bm->totvert--;
- //CustomData_em_free_block(&bm->vdata, &v->data);
+ BME_CD_free_block(&bm->vdata, &v->data);
BME_mempool_free(bm->vpool, v);
}
void BME_free_edge(BME_Mesh *bm, BME_Edge *e){
bm->totedge--;
- //CustomData_em_free_block(&bm->edata, &e->data);
+ BME_CD_free_block(&bm->edata, &e->data);
BME_mempool_free(bm->epool, e);
}
void BME_free_poly(BME_Mesh *bm, BME_Poly *f){
bm->totpoly--;
- //CustomData_em_free_block(&bm->pdata, &f->data);
+ BME_CD_free_block(&bm->pdata, &f->data);
BME_mempool_free(bm->ppool, f);
}
void BME_free_loop(BME_Mesh *bm, BME_Loop *l){
bm->totloop--;
- //CustomData_em_free_block(&bm->ldata, &l->data);
+ BME_CD_free_block(&bm->ldata, &l->data);
BME_mempool_free(bm->lpool, l);
}
/**