2
$\begingroup$

Using Geometry Node Tools, how can I detect the domain of my selection? For example, how do I know if what I selected are Points, Edges, or Faces?

Here is my first attempt. enter image description here

It works for individual domains and subsets of individual domains however it does not work for multiple domains.

enter image description here

Does anyone have a more efficient solution for this problem?


Blender 4.2.2


Edit

Although, the example above was only a first step experiment, my main objective for this question was to Store a Named Attribute (I was using index for the named attribute) on all points of the mesh from the given selection. For example, if I had selected points whose indices were 2, 5, 7 and determined the Maximum of the selected, I would store the index, 7 on all points of the geometry.

I had made separate tools for this respectively with Points, Edges, and Faces. However, I grew curious to see if I could combine them together and store named attributes according to which ever domain my elements were in.

enter image description here

If faces were included in a selection of points, then two different named attributes would be stored for both the domain of points and the domain of faces.

Of course, it was brought to my attention that selecting a face or an edge automatically selects the points connected so, I will leave a new condition of subsetting selections to non-connected elements.

$\endgroup$
1
  • $\begingroup$ You can use a menu to choose the domain in the operator. It's sad that there isn't an option to detect the selection mode, just like "sort elements" operator detects it and selects the right option for you. $\endgroup$ Commented Oct 21 at 15:23

1 Answer 1

1
$\begingroup$

The selection is always in all domains. You choose what you want in your tool.

If user selects two connected vertices, the selection is:

  • Two vertices
  • One edge

If user selects four vertices that form a face, the selection is:

  • Four vertices
  • Four edges
  • One face

If user selects a face, the selection is:

  • Four vertices
  • Four edges
  • One face

And so on. You don't have to worry about this at all. Pick the domain your tool is supposed to work with.

If you need different behavior for each selection mode, then you should create three different tools.

$\endgroup$
3
  • $\begingroup$ "If you need different behavior for each selection mode, then you should create three different tools." Oooohh, that last piece simply means that it is not possible for me to select different elements. What about unconnected points, unconnected edges, or unconnected faces? $\endgroup$
    – Obfuscate
    Commented Oct 20 at 23:11
  • $\begingroup$ @Obfuscate, can you describe what you want to achieve? The selection brings you connected and unconnected selections, you just choose in the tool which type you want. If you want vertices, it brings vertices, if you want edges, it brings edges and discards unconnected vertices. If you want faces, it brings faces and discards unconnected edges and vertices. $\endgroup$ Commented Oct 21 at 0:47
  • $\begingroup$ I made an edit to my question. Let me know if you want more details. $\endgroup$
    – Obfuscate
    Commented Oct 21 at 3:18

You must log in to answer this question.

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