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:
authorJoseph Eagar <joeedh@gmail.com>2009-08-12 07:51:28 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-08-12 07:51:28 +0400
commit927e03cf1660b62e606329d3c0c6a43938ec8813 (patch)
tree80f2ec6cc6d15081d0fc94d78b6d0c11e7d81b85 /source/blender/editors/mesh
parente4f0c65bf3533a51760101c465771aad4dc91b27 (diff)
fixed some problems in weld, collapse, and collapse uvs
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/mesh_layers.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/mesh_layers.c b/source/blender/editors/mesh/mesh_layers.c
index 703af03b010..302251dde9f 100644
--- a/source/blender/editors/mesh/mesh_layers.c
+++ b/source/blender/editors/mesh/mesh_layers.c
@@ -60,14 +60,21 @@
#include "mesh_intern.h"
#include "bmesh.h"
-static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
+static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer, int loop)
{
- CustomData *data= (me->edit_btmesh)? &me->edit_btmesh->bm->pdata: &me->pdata;
+ CustomData *data;
void *actlayerdata, *rndlayerdata, *clonelayerdata, *masklayerdata, *layerdata=layer->data;
int type= layer->type;
- int index= CustomData_get_layer_index(data, type);
+ int index;
int i, actindex, rndindex, cloneindex, maskindex;
+ if (loop)
+ data = (me->edit_btmesh)? &me->edit_btmesh->bm->ldata: &me->ldata;
+ else
+ data = (me->edit_btmesh)? &me->edit_btmesh->bm->pdata: &me->pdata;
+
+ index = CustomData_get_layer_index(data, type);
+
/* ok, deleting a non-active layer needs to preserve the active layer indices.
to do this, we store a pointer to the .data member of both layer and the active layer,
(to detect if we're deleting the active layer or not), then use the active
@@ -85,7 +92,7 @@ static void delete_customdata_layer(Mesh *me, CustomDataLayer *layer)
BM_free_data_layer(me->edit_btmesh->bm, data, type);
}
else {
- CustomData_free_layer_active(data, type, me->totface);
+ CustomData_free_layer_active(data, type, loop ? me->totloop : me->totpoly);
mesh_update_customdata_pointers(me);
}
@@ -234,8 +241,8 @@ static int uv_texture_remove_exec(bContext *C, wmOperator *op)
if(!cdl)
return OPERATOR_CANCELLED;
- delete_customdata_layer(me, cdl);
- delete_customdata_layer(me, cdl2);
+ delete_customdata_layer(me, cdl, 0);
+ delete_customdata_layer(me, cdl2, 1);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);
@@ -338,7 +345,7 @@ static int vertex_color_remove_exec(bContext *C, wmOperator *op)
if(!cdl)
return OPERATOR_CANCELLED;
- delete_customdata_layer(me, cdl);
+ delete_customdata_layer(me, cdl, 1);
DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob);