diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-20 07:28:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-20 07:28:02 +0300 |
commit | e435fbc3c5a00e5b63c1cd2609ab6828187660d3 (patch) | |
tree | 3f1da9c51451dee55a203cd001d37f8774d2582f /source/blender/src/header_view3d.c | |
parent | 0a7c43c6e5fc7d5d75a4645eca1164cede2d03a6 (diff) |
Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.
Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Replaced TFace by MTFace:
This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.
Removed DispListMesh:
This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.
Removed ssDM and meshDM DerivedMesh backends:
The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.
This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
Diffstat (limited to 'source/blender/src/header_view3d.c')
-rw-r--r-- | source/blender/src/header_view3d.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 18bd611ba4e..b282e861ec7 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -302,7 +302,7 @@ static void do_view3d_view_alignviewmenu(void *arg, int event) if (obact && obact->type==OB_MESH) { Mesh *me= obact->data; - if (me->tface) { + if (me->mtface) { faceselect_align_view_to_selected(v3d, me, event); addqueue(v3d->area->win, REDRAW, 1); } @@ -3971,7 +3971,7 @@ uiBlock *view3d_sculptmenu(void *arg_unused_so_why_have_it/*?*/) static void do_view3d_facesel_propertiesmenu(void *arg, int event) { - TFace *tf = get_active_tface(); + MTFace *tf = get_active_tface(NULL); if (tf) { switch(event) { @@ -4028,7 +4028,7 @@ static void do_view3d_facesel_propertiesmenu(void *arg, int event) static uiBlock *view3d_facesel_propertiesmenu(void *arg_unused) { - TFace *tf = get_active_tface(); + MTFace *tf = get_active_tface(NULL); uiBlock *block; short yco = 20, menuwidth = 120; @@ -4129,7 +4129,8 @@ static void do_view3d_faceselmenu(void *arg, int event) /* code copied from buttons.c :( would be nice if it was split up into functions */ Mesh *me; - TFace *tf, *activetf; + MTFace *tf, *activetf; + MCol *activemcol; int a; switch(event) { @@ -4137,10 +4138,10 @@ static void do_view3d_faceselmenu(void *arg, int event) case 1: /* copy UVs */ case 2: /* copy vertex colors */ me= get_mesh(OBACT); - activetf = get_active_tface(); + activetf = get_active_tface(&activemcol); if (me && activetf) { - for (a=0, tf=me->tface; a < me->totface; a++, tf++) { + for (a=0, tf=me->mtface; a < me->totface; a++, tf++) { if(tf!=activetf && (tf->flag & TF_SELECT)) { if(event==0) { tf->mode= activetf->mode; @@ -4153,8 +4154,9 @@ static void do_view3d_faceselmenu(void *arg, int event) if(activetf->mode & TF_TILES) tf->mode |= TF_TILES; else tf->mode &= ~TF_TILES; - } else if(event==2) - memcpy(tf->col, activetf->col, sizeof(tf->col)); + } + else if(event==2 && activemcol) + memcpy(&me->mcol[a], activemcol, sizeof(MCol)*4); } } |