diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 14:41:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-24 14:41:42 +0400 |
commit | d7b9127e5fa2f83ba11ad483ca4438a67b1c48c1 (patch) | |
tree | d434fbaf35e64e7c925d80e23503b8b55562083f /source/blender | |
parent | b8a71efeba70d6c3ebc579f5043daa4162da86e8 (diff) |
fix for crash removing vertex colors in editmode.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index a8836b466a8..985924c5a5e 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -448,11 +448,12 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes int ED_mesh_color_remove(bContext *C, Object *ob, Mesh *me) { + CustomData *ldata = GET_CD_DATA(me, ldata); CustomDataLayer *cdl; int index; - index= CustomData_get_active_layer_index(&me->ldata, CD_MLOOPCOL); - cdl= (index == -1)? NULL: &me->ldata.layers[index]; + index= CustomData_get_active_layer_index(ldata, CD_MLOOPCOL); + cdl= (index == -1)? NULL: &ldata->layers[index]; if (!cdl) return 0; @@ -466,11 +467,12 @@ int ED_mesh_color_remove(bContext *C, Object *ob, Mesh *me) int ED_mesh_color_remove_named(bContext *C, Object *ob, Mesh *me, const char *name) { + CustomData *ldata = GET_CD_DATA(me, ldata); CustomDataLayer *cdl; int index; - index= CustomData_get_named_layer_index(&me->ldata, CD_MLOOPCOL, name); - cdl= (index == -1)? NULL: &me->ldata.layers[index]; + index= CustomData_get_named_layer_index(ldata, CD_MLOOPCOL, name); + cdl = (index == -1) ? NULL : &ldata->layers[index]; if (!cdl) return 0; |