[Bf-blender-cvs] [2ff5d42cd3b] master: Sculpt: Fix bug with allocating duplicate attribute layers

Joseph Eagar noreply at git.blender.org
Sat Sep 24 19:04:33 CEST 2022


Commit: 2ff5d42cd3b41cc1412d4a896d8f9e8d2977686f
Author: Joseph Eagar
Date:   Sat Sep 24 10:03:10 2022 -0700
Branches: master
https://developer.blender.org/rB2ff5d42cd3b41cc1412d4a896d8f9e8d2977686f

Sculpt: Fix bug with allocating duplicate attribute layers

Sculpt attribute API was incorrectly allocating duplicate
attribute layers.

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

M	source/blender/blenkernel/intern/paint.cc

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

diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc
index 298ca8fff8c..171a7b41373 100644
--- a/source/blender/blenkernel/intern/paint.cc
+++ b/source/blender/blenkernel/intern/paint.cc
@@ -2553,13 +2553,11 @@ static bool sculpt_attr_update(Object *ob, SculptAttribute *attr)
 
     if (cdata) {
       int layer_index = CustomData_get_named_layer_index(cdata, attr->proptype, attr->name);
+      bad = layer_index == -1;
 
-      if (layer_index != -1 && attr->data_for_bmesh) {
+      if (ss->bm) {
         attr->bmesh_cd_offset = cdata->layers[layer_index].offset;
       }
-      else {
-        bad = true;
-      }
     }
   }



More information about the Bf-blender-cvs mailing list