[Bf-blender-cvs] [57ea827bfb2] master: Fix: Incorrect handling for crease layers

Hans Goudey noreply at git.blender.org
Mon Sep 26 22:42:41 CEST 2022


Commit: 57ea827bfb28eb697b74dbc606facbc133e10fab
Author: Hans Goudey
Date:   Mon Sep 26 15:42:20 2022 -0500
Branches: master
https://developer.blender.org/rB57ea827bfb28eb697b74dbc606facbc133e10fab

Fix: Incorrect handling for crease layers

First, there can only be one crease layer, so remove the "default name",
since apparently that's how CustomData tests for that
(see `CustomData_layertype_is_singleton`).

Second, always propagate crease data because it can be used in arbitrary
situations by geometry nodes. That also has to be done for all generic
attribute layers.

Fixes T101340, T101373

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

M	source/blender/blenkernel/intern/customdata.cc
M	source/blender/blenkernel/intern/object_update.c

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

diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc
index 3acd7bb0c80..66b929d7c55 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -1869,7 +1869,7 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
     /* 29: CD_BWEIGHT */
     {sizeof(MFloatProperty), "MFloatProperty", 1, nullptr, nullptr, nullptr, layerInterp_bweight},
     /* 30: CD_CREASE */
-    {sizeof(float), "", 0, N_("SubSurfCrease"), nullptr, nullptr, layerInterp_propFloat},
+    {sizeof(float), "", 0, nullptr, nullptr, nullptr, layerInterp_propFloat},
     /* 31: CD_ORIGSPACE_MLOOP */
     {sizeof(OrigSpaceLoop),
      "OrigSpaceLoop",
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 91170060fee..3fe8b95e656 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -141,9 +141,10 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
       CustomData_MeshMasks cddata_masks = scene->customdata_mask;
       CustomData_MeshMasks_update(&cddata_masks, &CD_MASK_BAREMESH);
       /* Custom attributes should not be removed automatically. They might be used by the render
-       * engine or scripts. They can still be removed explicitly using geometry nodes. */
-      cddata_masks.vmask |= CD_MASK_PROP_ALL;
-      cddata_masks.emask |= CD_MASK_PROP_ALL;
+       * engine or scripts. They can still be removed explicitly using geometry nodes.
+       * Crease can be be used in generic situations with geometry nodes as well. */
+      cddata_masks.vmask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
+      cddata_masks.emask |= CD_MASK_PROP_ALL | CD_MASK_CREASE;
       cddata_masks.fmask |= CD_MASK_PROP_ALL;
       cddata_masks.pmask |= CD_MASK_PROP_ALL;
       cddata_masks.lmask |= CD_MASK_PROP_ALL;



More information about the Bf-blender-cvs mailing list