3

My goal is to use serial of specific list of numbers as vertex selection.

For example if I have a numbers 1,3,17 and I want to distribute instances on a grid at vertex number 1,3,17.

Since I don't see an option to use String node as source I imported CSV text file via addon. It generates an object and stores values as Attribute per vertex. No problem for Loc/Rot/Scale like here, but what about selection?

I can see the attribute (named vertices) is there ...

enter image description here

... but attribute is not seen as vertices by Selection socket.

enter image description here

Ideas how to solve the issue?

vklidu
  • 36,165
  • 1
  • 61
  • 135
  • 1
    maybe i misunderstood, but shouldn't be the selection a boolean than an integer? so if they are all > 0 ...they are all true – Chris Dec 11 '22 at 15:22
  • 1
    Chris is right, since it's a boolean field, it's only looking if they're greater than 0 or not, and they're all positive so it selects all first 7 points. You need to compare the sampled index numbers to the context's (grid). However, while that works for me if I sample a single index, it doesn't when I look at all indices so I'm a bit stumped as well: https://i.imgur.com/k1QQrzj.mp4 – Kuboå Dec 11 '22 at 15:25
  • 1
    @Chris Thanks for contribution, but I'm and I will be a geonode looser (I do very elementary progress full of pain, so If you want to help just hints are not helping me, sorry ... use answer or screen to illustrate please. Transfer Attribute > Boolean the output is 1 for all. – vklidu Dec 11 '22 at 16:01
  • @Kuboå Thanks for try ... I can't even try it since at home my Mac can't open last Blender 3.4 based on Metal, so no "Sample Index" node available ... – vklidu Dec 11 '22 at 16:18
  • Just a few thoughts 1) your "vertices" attribute is actually the indexes of the verts that your want to select/mark. That means you need to compare these numbers with the index of the grid, which results in a boolean value (true/false = selected/not selected). -- 2) The Transfer Attribute node loops through all verts of the grid (destination) & adds the attribute of the sources mesh. If there are not enough values it repeats the last value. This means you cannot match the indexes because the Index node only gives you the index of the source mesh, not the destination. You need both indexes – Blunder Dec 11 '22 at 16:20
  • @Blunder ad1 thanks, yes, thats what I understood from Kuboå that he tried and failed ... I was naive thinking Selections reads just a numbers without comparing real vertex number. ad2) I noticed that in Viewer ... any solution on your mind ... Thanks – vklidu Dec 11 '22 at 16:37
  • Sample Index is basically the same as Transfer Att. with an Integer inserted into its Index slot: https://i.imgur.com/bYUBjU5.png Here you can see it's correctly working for a single index, but when you leave at just "Index" it stops working. Interestingly, in the old Transfer Att. node it seems to work like @Blunder says, repeating the last value after it runs out of index: https://i.imgur.com/N7tRQJ6.png but it simply gives 0 in the new Sample nodes instead: https://i.imgur.com/H43Ptco.png It still should work for the first 7 points I feel, but it doesn't. I don't know why. – Kuboå Dec 11 '22 at 17:07
  • Last time I was confused about a similar situation I had to ask @quellenform : https://blender.stackexchange.com/questions/264857/how-can-i-re-sort-the-points-indexes-of-an-object-in-geometry-nodes?noredirect=1#comment481949_264857 Maybe he can point to the solution again here. – Kuboå Dec 11 '22 at 17:11
  • Can you point us in the direction of the add-on? I would expect the CSV to be something like , \n for all vertices.. or you (we) could write your (our) own script.. – Robin Betts Dec 11 '22 at 17:36
  • Here is a very similar question: https://blender.stackexchange.com/q/262146/107598 - the answer was to expand the input set and specify for each vert if it is selected or not. It's the same Robin Betts just suggested. It is a working solution (https://i.stack.imgur.com/4HMMr.jpg), but very inefficient for a small selection with a large number of vertices. If you select 10 of 1000 vertices you need 10 true and 990 false values. Here is a script that expands the input values (https://i.stack.imgur.com/2gjAN.jpg). Make sure you have the objects selected before you run it. – Blunder Dec 11 '22 at 18:30
  • https://github.com/simonbroggi/blender_spreadsheet_import @RobinBetts Sorry ... addon was linked in my answer mentioned in this Q ... Thank you. – vklidu Dec 11 '22 at 19:10
  • I was just writing a comment to your deleted A :) in short ... Tired now to test it ... I appreciate your attention and help guys ... Robin - CSV or addon doesn't matter, if you know a way how to feed Selection socket by a bunch of numbers referring to vertex index directly copy-paste or blenders Text editor even better. It sounds to interesting topic in general, but the first impuls was Q mentioned in my Q here. – vklidu Dec 11 '22 at 19:38
  • Hi, @vklidu ! i was doing the washing-up when i realized (doooooooh!) I'd done the whole thing upside-down :) See revision. – Robin Betts Dec 11 '22 at 19:40
  • @Blunder even node tree looks simple I would like to avoid additional script in process ... And like in comment to Robin, I don't want to you assign to the CSV or Attribute if you think there is easier way to feed Selection socket by numbers. Thanks. – vklidu Dec 11 '22 at 19:42
  • OK, I withdraw my question above (why my setup would work with a single index but not the Index node). After finally having had my dinner my brain started working a bit and I realized that the compare ("Equal") node is not saying "get me the points with these index numbers", it's saying "compare this list of numbers with the indices of my points, going down the list one by one, and if they're the same, select them". Single index works because you write the same one value to all points so it inevitably finds one that's equal to it. Duh. – Kuboå Dec 11 '22 at 19:50
  • @Kuboå :) Thanks for investigation ... – vklidu Dec 11 '22 at 20:12

1 Answers1

5

You can sample the grid at the indices in the Named Attribute 'vertices', set the Test Vertices object's vertices to those points, and instance on those:

enter image description here

with this result:

enter image description here

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
  • Ha ... it took me from a bed now! Thanks ... I went by this way at the beginning, but I failed - so close / so far :) Thanks a lot. Before I leave this topic - Am I right with my comment under my Q? There is not any simpler way to feed Selection socket without addon (to generate attribute from CSV) ... like from Text editor or what ever ... String node? – vklidu Dec 11 '22 at 20:13
  • @vklidu have to sleep on that one... being a bit dim this pm. Maybe our quellenform will come up with something :) – Robin Betts Dec 11 '22 at 20:59