Support linked collections used as input in a Geometry Nodes modifier

Add support for linked collections that are used as input in a Geometry
Nodes modifier. This requires iterating over the geometry nodes modifier
settings, which consists of ID properties. If such an ID property is of
type `IDP_ID`, its pointer is followed and the pointed-to datablock +
its library are visited.

This following of pointers happens in the 'expand' phase, which was only
done for linked library blend files. Since this commit, the old
behaviour of simply looping over all non-`DATA` datablocks of the
to-be-packed blend file is not enough, and datablock expansion is done
for all local datablocks as well.
This commit is contained in:
Sybren A. Stüvel
2021-07-27 16:42:25 +02:00
parent 932283be65
commit 0bd18594f6
8 changed files with 69 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+28
View File
@@ -436,6 +436,34 @@ class DepsTest(AbstractTracerTest):
},
)
def test_geometry_nodes_modifier_input(self):
"""Test linked collection as input to geom nodes modifier.
Here a Geometry Nodes modifier references a collection that is not
instanced into the scene, which caused it to be missed.
"""
self.assert_deps(
"geometry-nodes-2/shot_file.blend",
{
b"LIset_file.blend": Expect(
type="Library",
full_field="name[1024]",
dirname_field=None,
basename_field=None,
asset_path=b"//set_file.blend",
is_sequence=False,
),
b"LIlib_trash.blend": Expect(
type="Library",
full_field="name[1024]",
dirname_field=None,
basename_field=None,
asset_path=b"//lib_trash.blend",
is_sequence=False,
),
},
)
def test_usage_abspath(self):
deps = [
dep