From 382b06c80cacb0ee940f2783f4619580b04aa502 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 16 Apr 2021 11:23:28 +0200 Subject: 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. --- source/blender/modifiers/intern/MOD_nodes.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source') 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); } } } -- cgit v1.2.3