diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-12-13 00:29:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-12-13 00:29:09 +0300 |
commit | 80ee52e444f05a6fd7a45f2ddfe72720648fbab8 (patch) | |
tree | 577238b0fdb738813ca560f0c5fc08dd6b945956 /source/blender/src/editmesh_lib.c | |
parent | 47adee414c7848f6ad898e9029205e804b9d6601 (diff) |
Multiple UV and vertex color layers: (still work in progress)
These can be created and deleted in the Mesh panel in the same place as
before. There is always one active UV and vertex color layer, that is
edited and displayed.
Important things to do:
- Render engine, material support
- Multires and NMesh now lose non active layers
Also CustomData changes to support muliple layers of the same type, and
changes to layer allocation, updated documentation is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData
Diffstat (limited to 'source/blender/src/editmesh_lib.c')
-rw-r--r-- | source/blender/src/editmesh_lib.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/src/editmesh_lib.c b/source/blender/src/editmesh_lib.c index 6e9fc7260f6..5732b30b664 100644 --- a/source/blender/src/editmesh_lib.c +++ b/source/blender/src/editmesh_lib.c @@ -775,6 +775,7 @@ static void update_data_blocks(CustomData *olddata, CustomData *data) if (data == &G.editMesh->vdata) { for(eve= em->verts.first; eve; eve= eve->next) { block = NULL; + CustomData_em_set_default(data, &block); CustomData_em_copy_data(olddata, data, eve->data, &block); CustomData_em_free_block(olddata, &eve->data); eve->data= block; @@ -783,6 +784,7 @@ static void update_data_blocks(CustomData *olddata, CustomData *data) else if (data == &G.editMesh->fdata) { for(efa= em->faces.first; efa; efa= efa->next) { block = NULL; + CustomData_em_set_default(data, &block); CustomData_em_copy_data(olddata, data, efa->data, &block); CustomData_em_free_block(olddata, &efa->data); efa->data= block; @@ -794,12 +796,9 @@ void EM_add_data_layer(CustomData *data, int type) { CustomData olddata; - if (CustomData_has_layer(data, type)) - return; - olddata= *data; olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL; - CustomData_add_layer(data, type, 0, NULL, 0); + CustomData_add_layer(data, type, CD_CALLOC, NULL, 0); update_data_blocks(&olddata, data); if (olddata.layers) MEM_freeN(olddata.layers); @@ -809,9 +808,6 @@ void EM_free_data_layer(CustomData *data, int type) { CustomData olddata; - if (!CustomData_has_layer(data, type)) - return; - olddata= *data; olddata.layers= (olddata.layers)? MEM_dupallocN(olddata.layers): NULL; CustomData_free_layer(data, type, 0); |