[Bf-blender-cvs] [b2a5da96b7f] refactor-mesh-remove-pointers: Fix active layer retrieval

Hans Goudey noreply at git.blender.org
Thu Sep 1 00:01:56 CEST 2022


Commit: b2a5da96b7fb14997a1c69809ec55861ec62e61d
Author: Hans Goudey
Date:   Wed Aug 31 17:01:49 2022 -0500
Branches: refactor-mesh-remove-pointers
https://developer.blender.org/rBb2a5da96b7fb14997a1c69809ec55861ec62e61d

Fix active layer retrieval

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

M	source/blender/editors/mesh/mesh_data.cc

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

diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc
index f41a5128c5c..09673b3d7ad 100644
--- a/source/blender/editors/mesh/mesh_data.cc
+++ b/source/blender/editors/mesh/mesh_data.cc
@@ -404,7 +404,7 @@ int ED_mesh_color_add(Mesh *me,
   else {
     layernum = CustomData_number_of_layers(&me->ldata, CD_PROP_BYTE_COLOR);
 
-    if (CustomData_get_active_layer(&me->ldata, CD_PROP_BYTE_COLOR) && do_init) {
+    if (CustomData_get_active_layer(&me->ldata, CD_PROP_BYTE_COLOR) != -1 && do_init) {
       CustomData_add_layer_named(&me->ldata,
                                  CD_PROP_BYTE_COLOR,
                                  CD_DUPLICATE,



More information about the Bf-blender-cvs mailing list