Page MenuHome

Geometry Nodes: Support randomly picking elements from collection in instancer.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Dec 17 2020, 7:42 PM.

Details

Summary

I did not figure out, how to setup the dependency on the collection correctly yet. The modifier should execute again, when a object is added or removed from the collection (currently it doesn't).
After discussing this issue in Blender chat, I think we can merge this even with this bug. The boolean modifier and collision collections have the same problem. We'll have to look into properly solving it at some point, but it does not necessarily have to block this patch.

Ref T82372.

Diff Detail

Repository
rB Blender
Branch
temp-geometry-nodes-instance-from-collection (branched from master)
Build Status
Buildable 11806
Build 11806: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Dec 17 2020, 7:42 PM
Jacques Lucke (JacquesLucke) created this revision.

Awesome! It feels like there needs to be a way to choose using a weighted random for feature parity with particle based scatter. Maybe a good solution is to allow users to manually specify per point variant index using an integer attribute?

In D9884#246726, @astrand130 wrote:

Awesome! It feels like there needs to be a way to choose using a weighted random for feature parity with particle based scatter. Maybe a good solution is to allow users to manually specify per point variant index using an integer attribute?

Yes, this the solution I'd go for as well. Either this or another solution will be implemented in a future patch.

In D9884#246726, @astrand130 wrote:

Awesome! It feels like there needs to be a way to choose using a weighted random for feature parity with particle based scatter. Maybe a good solution is to allow users to manually specify per point variant index using an integer attribute?

Yes, this the solution I'd go for as well. Either this or another solution will be implemented in a future patch.

What about lists like Animation Nodes?

Looks good to me!

This revision is now accepted and ready to land.Dec 18 2020, 3:13 PM

Tested here, and it looks great. Just check the remarks.

source/blender/makesrna/intern/rna_nodetree.c
8469

-whole_collection
+use_whole_collection

source/blender/nodes/geometry/nodes/node_geo_point_instance.cc
68

Switches are handy because they throw a warning

96

Add a comment to say that we only add the first level of objects present in the collection. (that can be mentioned in the manual / tooltip as well)

103

And for sub-collections mention that we are instancing the subcollections.