1
$\begingroup$

Let's say I have a collection named Collection original and inside of it two cubes and two spheres.

Then in a separate collection I have a monkey and another object with geometry nodes. Within the geometry nodes, I'm instancing the Collection original with all of it's objects as separate. I can then view those instanced objects within the spreadsheet which includes their id, object name and basic transforms.

Next I want to replace every instance of the cube object (Cube and Cube.001) with an instance of a monkey object.

enter image description here

I was thinking that the workflow could include selecting the instances via their name (the new string system) or id (objects are alphabeticaly sorted) and then replacing the selected instances.

I don't even know if this is possible in the current implementation of Geometry nodes. I was thinking that it might be useful in reusing the same modular object layout that people make themselves and quickly replacing one modular piece with another that is compatible.

$\endgroup$

2 Answers 2

4
$\begingroup$

If you set an id attribute (which defaults to index, not what we want here,) it appears you can pass it on implicitly, and it is automatically transferred from points to instances.

So the key to this approach is to determine which collection members are instanced on points according to the point's id. Here, the id is set randomly on a grid, but most applications would have a more rational method:

enter image description here

The id us used to pick from the collection.

To substitute an pick from another collection for one of this collection's picks:

enter image description here

The id is used to select points on which to instance the new pick. It's also used to scale whatever was on there before, to 0. I wish I could find a less hacky way of dispensing with the original instances. Maybe a reader can come up with something.

The interfaces for grid creation and element substitution look like this:

enter image description here

The Substitute Instance node can be daisy-chained...

enter image description here

(Blender 3.0 stable)

$\endgroup$
2
$\begingroup$

Here is a possible solution to eliminate the original collection instance instead of scaling to 0. This works by using two Instance on Points with inverted boolean selections. This eliminates the original instance but still retains the original point info for the alternate instance placement.

enter image description here

$\endgroup$
4
  • $\begingroup$ Was I going nuts when I answered? This is the 'less whacky' way I was hoping for. I think I might delete my answer.. $\endgroup$
    – Robin Betts
    Jan 10, 2022 at 16:54
  • 1
    $\begingroup$ @RobinBetts Don't, there's still value in it. It may still be useful to someone, or at least for historical purposes $\endgroup$ Jan 10, 2022 at 17:54
  • $\begingroup$ @Duarte OK... however embarrassing it is :D $\endgroup$
    – Robin Betts
    Jan 10, 2022 at 17:56
  • $\begingroup$ A working answer is never embarrassing ;) $\endgroup$ Jan 10, 2022 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .