Page MenuHome

Geometry Nodes: Point separate and attribute compare nodes
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Dec 16 2020, 9:11 PM.

Details

Summary

This patch adds two related nodes, a node for separating points
and mesh vertices based on a boolean attribute input, and a node
for creating boolean attributes with comparisons.

Here is a simple result on a subdivided sphere:

Point Separate T83059
The output in both geometries is just point data, contained in the mesh
and point cloud components, depending which components had data in the
input geometry. Any points with the mask attribute set to true will be
moved from the first geometry output to the second. This means that
for meshes, all edge and face data will be removed. Any point domain
attributes are moved to the correct output geometry as well.

Attribute Compare T83057
The attribute compare does the "Equal" and "Not Equal" operations by
comparing vectors and colors based on their distance from each other.
For other operations, the comparison is between the lengths of the
vector inputs. In general, the highest complexity data type is used
for the operation, and a new function to determine that is added.

Here is a more complicated use-case-like test file:

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Dec 16 2020, 9:11 PM
Dalai Felinto (dfelinto) requested changes to this revision.Dec 17 2020, 1:00 PM

There is a strange bug, I finally managed to pin down:

  • Delete the Point Separate node
  • Now the nodetree is working

The point separate node is not connected to the Group Output, so it is really strange that it is affecting the tree.

This revision now requires changes to proceed.Dec 17 2020, 1:00 PM

This bug can be fixed by adding CD_PROP_BOOL to CD_MASK_PROP_ALL.
The issue was that in one case, the mesh was copied and in the other was not (it would be correct to say that there should be no copy in both cases, but that is not yet implemented).
The bool attribute was not copied, because it was missing from CD_MASK_PROP_ALL.

  • Add boolean prop to CD_MASK_PROP_ALL

This fix seems to work, thanks for figuring out the bug @Jacques Lucke (JacquesLucke)

This revision is now accepted and ready to land.Dec 17 2020, 3:38 PM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/makesrna/intern/rna_nodetree.c
8495

Did you remove that on purpose?

source/blender/nodes/geometry/nodes/node_geo_attribute_compare.cc
62

operation_tests_equality maybe?

Hans Goudey (HooglyBoogly) marked 2 inline comments as done.Dec 17 2020, 7:21 PM
Hans Goudey (HooglyBoogly) added inline comments.
source/blender/makesrna/intern/rna_nodetree.c
8495

Nope, oops! The diff looks quite weird here. I fixed this locally but didn't update the patch for.