[Bf-blender-cvs] [a2e4d81849d] blender-v2.93-release: Fix T87441: don't remove custom attributes automatically

Jacques Lucke noreply at git.blender.org
Fri Apr 16 11:28:37 CEST 2021


Commit: a2e4d81849d038fcfda9552479c9ce02b9aaf644
Author: Jacques Lucke
Date:   Fri Apr 16 11:28:23 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rBa2e4d81849d038fcfda9552479c9ce02b9aaf644

Fix T87441: don't remove custom attributes automatically

In the past, custom attributes were rarely used in practice, because the
only way to use them was from Python. Since geometry nodes, more
users started to add their own attributes. Those attributes should not
be removed automatically. It is still possible to remove them in
geometry nodes explictly to improve performance.

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

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

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

diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index b1ae4abd9bb..e6909127503 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -176,6 +176,13 @@ 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;
+      cddata_masks.fmask |= CD_MASK_PROP_ALL;
+      cddata_masks.pmask |= CD_MASK_PROP_ALL;
+      cddata_masks.lmask |= CD_MASK_PROP_ALL;
       /* Make sure Freestyle edge/face marks appear in DM for render (see T40315).
        * Due to Line Art implementation, edge marks should also be shown in viewport. */
 #ifdef WITH_FREESTYLE



More information about the Bf-blender-cvs mailing list