← All ideas
  • Published 23 Nov 2023

Object ID in geometry nodes

I'd like to make several objects with the same geometry nodes setup, which should all have different randomly generated shapes.

This sort of thing is easy to do in shader nodes using the Object Info node, but currently geometry nodes doesn't have the same kind of feature.

It is possible to do this currently, but it requires more work than it should. In the threads below you can find people proposing solutions of varying degrees of complexity, but none of them are ideal. (e.g. most of them rely on the object's position, and hence don't work for moving objects.) Blender Artists thread , Blender Stack Exchange thread .

So I propose a simple "object ID" node in geometry nodes, which returns a distinct ID for each object. It would behave the same as the "Object ID" output of the "Object Info" node in shader nodes.

I'm fairly sure this feature doesn't already exist. Some notes on that:

  • using the "id" input of a random value node works, but you have to manually give each object a separate id, which can be impractical depending on how many objects you have. This is why I'm asking for something with an ID output to pass into this node.

  • the ID or index nodes do not work here, as they return an id per vertex, not per object

  • the mesh island node does not work here, because it returns the same result for each object

  • although there is an Object Info node in geometry nodes it doesn't behave the same as the shader nodes one and doesn't have the Object ID output

88.9%

Development Status: Open

Upvote 8 Downvote 1
nathaniel
23 Nov 2023

4 Comments

stib1

I'm working on a scene that could absolutely use this. Every object has a procedurally generated random transform and rotation offset, created using a simulation zone in GN. To make them all different I have to manually set a seed value for every. Single. One. If I could just plug an object ID into my random seed I'd be going home by now.

nathaniel Author

I don't understand why this got a downvote and no upvotes. It seems an obvious missing feature, and an easy thing to add. Have I made a mistake somehow? Any insights would be greatly appreciated.

modormoder

I just don't see the use case of such thing. Usually, you will not copy object with geometry node tree, but have object with one tree that will process all objects in some collection.

nathaniel Author

Imagine, say, a randomly generated tree, such that if you select that tree and press Alt-D you will get a different tree of the same size and type, which you can then position where you like. You can then change that tree's size and other parameters, then copy that tree to get another tree of the same size and type as that one, and so on. This sounds like a pretty convenient thing to me.

For trees you can do this using hacks involving their position, but it's awkward because the trees will change shape whenever you move them. If you want to do it for moving animals etc. then it's basically impossible as far as I can tell.

You can also look at the two threads I linked for other use cases. Lots of people want to do this for multiple different reasons, and I did take the time to include evidence for that in my original post.