Page MenuHome

Nodes: Add Compare node operations to link drag search menu
ClosedPublic

Authored by Charlie Jolly (charlie) on Dec 31 2021, 3:13 AM.

Details

Summary

Exposes compare operations via rna emums.
This uses the rna enum to build the search list using
named operations linked to socket A.
This also weighs the Math Node comparison operations lower
for geometry node trees.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 19707
Build 19707: arc lint + arc unit

Event Timeline

Charlie Jolly (charlie) requested review of this revision.Dec 31 2021, 3:13 AM
Charlie Jolly (charlie) created this revision.

Rebase after commiting D13691.

Great! This is so useful!

What do you think about removing the "A" "B" and "C" items completely? I think these will serve the same purpose, and that would be more consistent with the other nodes we exposed the search enums for.

In the future we might want to hide the comparisons from the math node completely, but I like that it's still consistent with what's shown in the enum drop-down here.

Remove A, B and C items.
Limit Darker and Brighter to float/vector/rgba type sockets.

Use correct empty const char check.

source/blender/nodes/function/nodes/node_fn_compare.cc
136

In the original patch adding the searching, Jacques and I discussed this sort of filtering (hiding some result that would technically be valid but doesn't make much sense). My initial thought was similar to hear: hide the "bad" results to make the list shorter. But what we ended up deciding is that any link that has an implicit conversion should be displayed. That's because any other behavior is very hard to explain in a general way to the user-- trying to define what "sensible" connection is makes all of this stuff much more complicated.

So I think the "float_type" check should be removed here, and below the angle socket should just check if the type isn't string.

Charlie Jolly (charlie) marked an inline comment as done.Dec 31 2021, 9:09 PM

Add back Boolean support.

This revision is now accepted and ready to land.Dec 31 2021, 9:19 PM