Combine selections

Hey guys quick question. For some reason I’m having trouble combining multiple selections. Let’s say I have one KCM that outputs a selection of particles. Then I add another KCM on top of that inputs the selection channel (from below) and now I want to add more particles to that. My problem is with that “add” operation. For some reason the add node does not give the result I want. Which node should I use to do that? I know it’s right under my nose, but can’t figure it out :neutral_face:

Can you explain what behavior you are getting that is unexpected?

Particle selection is equivalent to Soft Selection in meshes, except that it is not explicitly clamped to 0.0-1.0 range.
So in theory your flow should mostly work except for the case where the sum of the two selection values is greater than 1.0 (which is allowed, but can cause strange results if used to control modifiers).

You can make a few modifications to your flow depending on how you want your flow to behave.

One way to approach it would be to insert a Function>Clamp operator between the Add and the OUTPUT and set the limits to 0.0 and 1.0 (which it defaults to anyway). The result is that where the sum of two selections exceeds 1.0, it will be clamped to 1.0. So if one modifier sets the selection of a particle to 0.1 and another to 0.5, you will get 0.6, but if one sets it to 0.7 and the other to 0.55, instead of getting 1.25, you will get 1.0.

Another approach would be to use a Max operation instead of Add. To do so, create a Logic>Greater operator and pass the original selection and the new selection into its two sockets. Then create a Switch operator and put the incoming selection into its first socket, the new selection into the second and the output of the result of the Greater op into the third. So if the original selection is greater than the new one, it will be used as the result; if the new selection is greater, it will be used instead. In other words, in the above cases of 0.1 and 0.5 you will always get 0.5 instead of 0.6, and in the other case you will get 0.7 instead of 1.0 (clamped) or 1.25.

Hope this helps.

Bobo, here’s what I’m getting with the add: more of an intersection than an add…

As per your suggestions the clamp doesn’t seem to change anything, and the switch is not really what I’m looking for. I need to apply the same modifiers to the combined particles not just one or the other.
sel1.jpg
sel2.jpg
add.jpg

It is doing exactly what you told it to do:

The Magma flow sets the selection to be VERY selected away from the center of the Gizmo. Only in the precise center of the gizmo the particle will be not selected at all and thus NOT deleted. If the Krakatoa Delete modifier is set to “Soft-Selection+ID Channel” mode, it will delete anything outside the gizmo’s radius, and with an exponent of 45.0, will keep most of the particles inside the radius. So the particles you see are the ones that are LEFT because they are LESS selected. The deleted particles are the selected ones!

When you add a second modifier with the same rules, it deletes all other paticles outside of its own gizmo, so the only particles left are the ones in the intersection of the two gizmos because they are barely selected!

Now the question is what you expected to get :slight_smile: Depending on what you wanted to get, you might have to rethink what your flow is doing…

Btw, if you Clamp the selection in both modifiers right after the Power operator and then Multiply in the top modifier instead of adding, you will get a logical AND behavior that you are probably after.
Where the selection is 0.0 (the center of either gizmo), the output value will remain 0.0 (because anything multiplied by 0 is 0). At the edge of the gizmo both will produce a value of 1.0.
Between the radius and the center both modifiers will produce values < 1.0, and two values that are less than 0.0 multiplied by each other will always produce a smaller value than either of them. Thus, the particles will be less likely to be deleted where the two gizmos overlap because the Soft-Selection value will be closer to 0.0.

Right… I just wan’t thinking 4th dimentionally :wink: I wasn’t thinking the selection is the the outside for some reason… I just had to invert all the selections with a -1 power to get what i wanted! I knew it was just some small lame thing I was doing…add_right.jpg

Thanks a lot Bobo!!