6
$\begingroup$

In the following scenario within geometry nodes I try to get control over the attributes of the individual objects within the used collection info node (eg position, rotation, normals, scale etc.). I know that I can adjust some of these attributes of the original object itself and that this continues to work in the instance, but can I also control this within geometry nodes? For convenience, say: all cubes up and all cylinders down. The tori must remain in place. De tori must rotate 90 degrees. Is it maybe possible to control individual instances?

Example

Node tree

Blend file of this scenario.

$\endgroup$
3
  • 1
    $\begingroup$ Please always try to stick to the content/title of your original question. The answers you can see below address it very well. If you now expand the topic too much to another individual problem, you run the risk that the question will be closed, because it simply can no longer be answered in a targeted manner, and others will have a hard time figuring it out. To be honest, it is difficult for me to study your nodes and try to understand what exactly you want to achieve in the end, and what the problem is. Please possibly consider opening another question instead. $\endgroup$
    – quellenform
    Jun 6, 2022 at 19:04
  • $\begingroup$ Tnx for your reply, I will start a new question. $\endgroup$
    – EwSa
    Jun 6, 2022 at 19:14
  • $\begingroup$ Agree with @quellenform. If you could describe your desired final effect clearly, and reduce the problem as far as possible to its essence, that helps to give a good answer. $\endgroup$
    – Robin Betts
    Jun 6, 2022 at 19:27

3 Answers 3

6
$\begingroup$

As is so often the case in Geometry Nodes, you don't know for sure if it's a bug or if you've done something wrong.

In any case, you can't capture the original index of an object after it has been instantiated. Why is probably in some unfinished part of the Geometry Nodes source code.

But...

But you can, conversely, capture a random value for an index on the geometry at which an instantiation is to occur and use those values for further processing afterwards:

enter image description here

$\endgroup$
2
  • $\begingroup$ I was expecting to be able to capture the index of collection instances, too. But on second thoughts, it's simpler to let the point's ID pick the instance? The one-to-many relationship is the right way round.. you don't have to make a relationship between two sets of numbers. (There'd be no harm in being able to capture the instance-index as well, though.) $\endgroup$
    – Robin Betts
    Jun 5, 2022 at 19:58
  • 1
    $\begingroup$ @RobinBetts Hm, not a bad consideration, you are right! But I think that both variants are equally semi-optimal, since in both cases something has to be calculated with additional nodes (either Substract -> Random Value, or Random Value -> Floor). ...and actually one would expect that in some form the original ID/Index is preserved. $\endgroup$
    – quellenform
    Jun 5, 2022 at 20:14
6
$\begingroup$

You need to know the ID of the targeted instances, using it as a selection.

In the example below you could plug the Compare (Equal) node output directly into the Rotate Instances, but not every manipulation you'll do will have a node with selection input. In these cases you use a Switch node.

rotate instances w/ id 3

$\endgroup$
6
$\begingroup$

For identifying instances after distribution on points.

When you instance on points, the points take charge of the identity of the instances on them.

  • If you check 'Pick Instance', the point's ID is used to select which instance from a collection is picked for that point.
  • If the integer ID exceeds the highest index in the collection, then the pick loops through the collection. (The selection is ID mod (collection size) )
  • The ID of a GN entity defaults to its Index, if it has not been explicitly set.

Here's an example where ID is set on the points, randomly, between 0 and collection size:

enter image description here

.. and the instances are selected by the ID of the points.

(You could not set an ID, plug (the point's) Index into 'Instance Index' instead. Then you could select all index-2 instances, for example, by selecting all whose point index, modulo the size of the collection, equals 2.)

Since we've set an ID on the points, and the points have used their ID to pick their instances, we can select instances by ID:

enter image description here

Your example usage:

enter image description here

$\endgroup$
2
  • $\begingroup$ Ooops, I should have selected a random integer value for the ID. The floored float is a leftover from some experiments, adjusting the relative frequencies of the instances. $\endgroup$
    – Robin Betts
    Jun 5, 2022 at 20:02
  • 1
    $\begingroup$ Even with the float output of the Random node, the Floor node is not required, as the conversion to integer will truncate the fraction, which is equivalent to flooring for positive values. $\endgroup$ Jun 5, 2022 at 23:53

You must log in to answer this question.

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