1
$\begingroup$

In this simplified example, the following setup will allow for a curve endpoint to have its position set to the nearest point of a cube from the same instancer point:


enter image description here


enter image description here

However, should the cubes be moved/scaled so that another cube's points are closer, those points are naturally used by the "Geometry Proximity" node, producing the undesirable result where the two curves on the left are not connected to the cubes that share their instancer point:


enter image description here


Because the actual application of this setup is using multiple instances with a vareity of point counts, the "Geometry Proximity" node would be ideal should the limitation of only using matching instancer index values be possible. Any help would be greatly appreciated.


Edit to show a scaling example for clarity:

Should all or any selection of instances be scaled past a certain point, the setup won't work:


enter image description here


Likewise, if after being realized the instances are edited past a certain point the setup wont work:


enter image description here

or enter image description here

$\endgroup$
7
  • $\begingroup$ I think it would be wise to include details about your real-life problem rather than just the abstracted version. For example, here, I'd be inclined to "bind" the corners to particular indices of the target, by "sample nearest" and applying that modifier (or reading from a duplicate), and then doing a second pass where I read the actual, current position of the previously sampled index. But I might be misunderstanding the real life problem. $\endgroup$
    – Nathan
    Aug 21 at 18:19
  • $\begingroup$ Thank you for the comment @Nathan. Basically, I'd like all the instances from the above plane's "0" index to only take proximity data from other instances that share the plane's "0" index, instances on "1" to only reference "1," etc. The example file I included is the exact same problem I have in the working file, minus all irrelevant node groups. $\endgroup$ Aug 21 at 19:13
  • 1
    $\begingroup$ I have a feeling that file doesn't demonstrate your real problem-- for example, all we have to do is to offset the selected geo by the same offset we give the cubes: pasteboard.co/L5raLA4bexPs.png . This is basically the same thing that ugorek is doing in their answer. But I have a feeling that's not what you're after.... $\endgroup$
    – Nathan
    Aug 21 at 19:41
  • $\begingroup$ @Nathan Thank you for the idea, but you are right. I included more examples for clarity. $\endgroup$ Aug 21 at 19:58
  • $\begingroup$ How many instances? Because with 4, we can reasonably repeat a node group with different parameters, but not with 1000.... I don't believe there's any reasonable way to run proximity (or sample nearest) targeting a large number of arbitrary geometries. (But there can be a less general solution to the problem for specific cases.) $\endgroup$
    – Nathan
    Aug 21 at 20:19

1 Answer 1

2
$\begingroup$

Blender 3.6 added a great node for this: Index of Nearest - in particular, notice the Group ID input, which allows to specify the group of interest. Since it operates on current geometry, you need to work within the sampled geometry, multiple ways to do it, but the simplest is to spawn another point, at index 0, and then just read the calculated data from that point:

$\endgroup$
3
  • $\begingroup$ Thank you so much for the node setup and explanation. Do you think it would be possible to then use the position of the nearest point within the (in this case 3) nearest indices? imgur.com/a/ADjXgWH $\endgroup$ Aug 22 at 18:33
  • $\begingroup$ @bobhasajetpack sorry I don't understand :D The cylinders (beveled curves) in my example go from the corner, to the nearest point of a triangle instanced on this corner. It may not look like this ,but it is the nearest point (within the limitation that it has to be the same group=color). $\endgroup$ Aug 22 at 20:59
  • $\begingroup$ You're right- the setup works perfectly. Apologies for a mistake on my part and thank you again. $\endgroup$ Aug 23 at 0:31

You must log in to answer this question.

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