diff options
author | Geoffrey Bantle <hairbat@yahoo.com> | 2008-02-24 01:46:55 +0300 |
---|---|---|
committer | Geoffrey Bantle <hairbat@yahoo.com> | 2008-02-24 01:46:55 +0300 |
commit | 0fb922ba94148c856621a33590149c9b932d808d (patch) | |
tree | ad9f969aa5a044cddc11ec8601d0733fcd50cf53 /source/blender/src/transform_conversions.c | |
parent | e03ab146ae673ec296e97f3c146c048417833521 (diff) |
-> Bevel tools and Bmesh kernel
more missed files!
Diffstat (limited to 'source/blender/src/transform_conversions.c')
-rw-r--r-- | source/blender/src/transform_conversions.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 5871a8a79ee..0266614da28 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -97,6 +97,7 @@ #include "BKE_particle.h" #include "BKE_softbody.h" #include "BKE_utildefines.h" +#include "BKE_bmesh.h" #include "BIF_editaction.h" #include "BIF_editview.h" @@ -386,8 +387,14 @@ static void createTransEdge(TransInfo *t) { td->ext = NULL; td->tdi = NULL; - td->val = &(eed->crease); - td->ival = eed->crease; + if (t->mode == TFM_BWEIGHT) { + td->val = &(eed->bweight); + td->ival = eed->bweight; + } + else { + td->val = &(eed->crease); + td->ival = eed->crease; + } td++; } @@ -1795,6 +1802,10 @@ static void VertsToTransData(TransData *td, EditVert *eve) td->tdi = NULL; td->val = NULL; td->tdmir= NULL; + if (BIF_GetTransInfo()->mode == TFM_BWEIGHT) { + td->val = &(eve->bweight); + td->ival = eve->bweight; + } #ifdef WITH_VERSE if(eve->vvert) { @@ -1947,6 +1958,31 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats) } +void createTransBMeshVerts(TransInfo *t, BME_Mesh *bm, BME_TransData_Head *td) { + BME_Vert *v; + BME_TransData *vtd; + TransData *tob; + int i; + + tob = t->data = MEM_callocN(td->len*sizeof(TransData), "TransObData(Bevel tool)"); + + for (i=0,v=bm->verts.first;v;v=v->next) { + if (vtd = BME_get_transdata(td,v)) { + tob->loc = vtd->loc; + tob->val = &vtd->factor; + VECCOPY(tob->iloc,vtd->co); + VECCOPY(tob->center,vtd->org); + VECCOPY(tob->axismtx[0],vtd->vec); + tob->axismtx[1][0] = vtd->max ? *vtd->max : 0; + tob++; + i++; + } + } + /* since td is a memarena, it can hold more transdata than actual elements + * (i.e. we can't depend on td->len to determine the number of actual elements) */ + t->total = i; +} + static void createTransEditVerts(TransInfo *t) { TransData *tob = NULL; @@ -3693,6 +3729,9 @@ void createTransData(TransInfo *t) sort_trans_data_dist(t); } } + else if (t->context == CTX_BMESH) { + createTransBMeshVerts(t, G.editBMesh->bm, G.editBMesh->td); + } else if (t->spacetype == SPACE_IMAGE) { t->flag |= T_POINTS|T_2D_EDIT; createTransUVs(t); |