[Bf-blender-cvs] [8df66731656] master: Cleanup: skip adding tessface loop & color layers

Campbell Barton noreply at git.blender.org
Sun Aug 25 09:03:20 CEST 2019


Commit: 8df66731656b9141f2b3df673422f25e321b2300
Author: Campbell Barton
Date:   Sun Aug 25 15:12:31 2019 +1000
Branches: master
https://developer.blender.org/rB8df66731656b9141f2b3df673422f25e321b2300

Cleanup: skip adding tessface loop & color layers

Also correct check in unused poll function

===================================================================

M	source/blender/editors/mesh/mesh_data.c
M	source/blender/editors/uvedit/uvedit_ops.c

===================================================================

diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 6347aed1631..569994bead1 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -289,18 +289,14 @@ int ED_mesh_uv_texture_add(Mesh *me, const char *name, const bool active_set, co
     if (me->mloopuv && do_init) {
       CustomData_add_layer_named(
           &me->ldata, CD_MLOOPUV, CD_DUPLICATE, me->mloopuv, me->totloop, name);
-      CustomData_add_layer_named(
-          &me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface, name);
       is_init = true;
     }
     else {
       CustomData_add_layer_named(&me->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, me->totloop, name);
-      CustomData_add_layer_named(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface, name);
     }
 
     if (active_set || layernum_dst == 0) {
       CustomData_set_layer_active(&me->ldata, CD_MLOOPUV, layernum_dst);
-      CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum_dst);
     }
 
     BKE_mesh_update_customdata_pointers(me, true);
@@ -418,16 +414,13 @@ int ED_mesh_color_add(Mesh *me, const char *name, const bool active_set, const b
     if (me->mloopcol && do_init) {
       CustomData_add_layer_named(
           &me->ldata, CD_MLOOPCOL, CD_DUPLICATE, me->mloopcol, me->totloop, name);
-      CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface, name);
     }
     else {
       CustomData_add_layer_named(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop, name);
-      CustomData_add_layer_named(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface, name);
     }
 
     if (active_set || layernum == 0) {
       CustomData_set_layer_active(&me->ldata, CD_MLOOPCOL, layernum);
-      CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
     }
 
     BKE_mesh_update_customdata_pointers(me, true);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index dcf1d04ffb3..cd7e5f9ba09 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -138,7 +138,7 @@ static int UNUSED_FUNCTION(ED_operator_uvmap_mesh)(bContext *C)
   if (ob && ob->type == OB_MESH) {
     Mesh *me = ob->data;
 
-    if (CustomData_get_layer(&me->fdata, CD_MTFACE) != NULL) {
+    if (CustomData_get_layer(&me->ldata, CD_MLOOPUV) != NULL) {
       return 1;
     }
   }



More information about the Bf-blender-cvs mailing list