[Bf-blender-cvs] [382b06c80ca] blender-v2.93-release: Fix T85691: attributes used by geometry nodes were removed automatically

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


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

Fix T85691: attributes used by geometry nodes were removed automatically

This has technically been fixed by rB3e87d8a4315d794efff659e40f0bb9e34e2aec8a,
but the fix there is questionable, because it disables an optimization for vertex groups
entirely. This fix is a little bit more precise in that it only disables the optimization when
the object is used by some geometry nodes modifier.

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

M	source/blender/modifiers/intern/MOD_nodes.cc

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

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 4a384063571..02a1dc07c93 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -179,6 +179,14 @@ static void add_object_relation(const ModifierUpdateDepsgraphContext *ctx, Objec
     }
     else if (ELEM(object.type, OB_MESH, OB_POINTCLOUD, OB_VOLUME)) {
       DEG_add_object_relation(ctx->node, &object, DEG_OB_COMP_GEOMETRY, "Nodes Modifier");
+      /* We don't know exactly what attributes from the other object we will need. */
+      CustomData_MeshMasks mask;
+      mask.vmask = CD_MASK_PROP_ALL | CD_MASK_MDEFORMVERT;
+      mask.pmask = CD_MASK_PROP_ALL;
+      mask.lmask = CD_MASK_PROP_ALL;
+      mask.fmask = CD_MASK_PROP_ALL;
+      mask.emask = CD_MASK_PROP_ALL;
+      DEG_add_customdata_mask(ctx->node, &object, &mask);
     }
   }
 }



More information about the Bf-blender-cvs mailing list