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:
authorJoshua Leung <aligorith@gmail.com>2009-09-29 06:19:27 +0400
committerJoshua Leung <aligorith@gmail.com>2009-09-29 06:19:27 +0400
commit3198ff876b835fd9f933b670cb4e6377b1f860b1 (patch)
tree5cd99bf115575a31f634f74280e44f8fc58cd0ce
parent52b28fddeca3a2fe1e2f0d415109b433226c29e8 (diff)
Bugfix #19490: Adding UV texture, adds Vertex color instead
Seems to have been a copy+paste error (code for Vertex Color adding was pasted in place of texture paint). Restored the code from an earlier revision (from another file).
-rw-r--r--source/blender/editors/mesh/mesh_data.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 4d2e5d357f1..43e1dd417a6 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -159,36 +159,30 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
int ED_mesh_uv_texture_add(bContext *C, Scene *scene, Object *ob, Mesh *me)
{
EditMesh *em;
- MCol *mcol;
int layernum;
if(me->edit_mesh) {
em= me->edit_mesh;
- layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL);
- if(layernum >= MAX_MCOL)
- return 0;
+ layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
+ if(layernum >= MAX_MTFACE)
+ return OPERATOR_CANCELLED;
- EM_add_data_layer(em, &em->fdata, CD_MCOL);
- CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum);
+ EM_add_data_layer(em, &em->fdata, CD_MTFACE);
+ CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum);
}
else {
- layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL);
- if(layernum >= MAX_MCOL)
- return 0;
+ layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE);
+ if(layernum >= MAX_MTFACE)
+ return OPERATOR_CANCELLED;
- mcol= me->mcol;
-
- if(me->mcol)
- CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface);
+ if(me->mtface)
+ CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface);
else
- CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface);
+ CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface);
- CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
+ CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum);
mesh_update_customdata_pointers(me);
-
- if(!mcol && ob)
- shadeMeshMCol(scene, ob, me);
}
DAG_id_flush_update(&me->id, OB_RECALC_DATA);