Page MenuHome

Geometry Nodes: Add utility to process all instances separately.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Sep 27 2021, 5:06 PM.

Details

Summary

This adds a new GeometrySet::modify_geometry_sets method that can be used to update each sub-geometry-set separately.

There are a couple of ways in which this can be improved:

  • Multi-threading.
  • Deduplicate more instances. E.g. if two geometry sets reference the same object, the object will currently be processed twice.

I have to put some more thought into this to figure out how to do it well. However, the general interface should work already and can be used to update nodes.
Also I had to use std::unique_ptr<GeometrySet> in InstanceReference again for correctness. Otherwise we might accidentally modify a geometry set that is also used somewhere else. This can also be improved a bit later.

Part of T91672.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Sep 27 2021, 5:06 PM
Jacques Lucke (JacquesLucke) created this revision.

+1 for keeping instances around that can't be converted to geometry sets.

I assume you've thought more about this, but I guess one reason not to just add multi-threading now is that there might need to be some way to handle different grain sizes for different nodes?

source/blender/blenkernel/intern/geometry_set.cc
462

than to realize -> than realizing

source/blender/blenkernel/intern/geometry_set_instances.cc
676

Typo (constains)

This revision is now accepted and ready to land.Sep 27 2021, 5:27 PM

I assume you've thought more about this, but I guess one reason not to just add multi-threading now is that there might need to be some way to handle different grain sizes for different nodes?

I think the grain size should be for all nodes actually, unless we find that this is a problem.
Main reason I didn't add it yet is that I wanted to keep it simple right now, so that the other refactor I mentioned is easier to implement.
However, some simple multi-threading capabilities might be easy to add right now anyway, will do that afterwards in a separate patch.