27 {
SOCK_FLOAT,
N_(
"A"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
28 {
SOCK_VECTOR,
N_(
"A"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
31 {
SOCK_FLOAT,
N_(
"B"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
32 {
SOCK_VECTOR,
N_(
"B"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
34 {
SOCK_FLOAT,
N_(
"Threshold"), 0.01f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX},
48 uiItemR(layout,
ptr,
"operation", 0,
"", ICON_NONE);
89 const int size = input_a.size();
97 const float a = span_a[i];
98 const float b = span_b[i];
99 const bool out = math_function(
a, b);
100 span_result[i] = out;
112 const float threshold,
115 const int size = input_a.size();
117 const float a = input_a[i];
118 const float b = input_b[i];
125 const float threshold,
128 const float threshold_squared =
pow2f(threshold);
129 const int size = input_a.size();
132 const float3 b = input_b[i];
139 const float threshold,
142 const float threshold_squared =
pow2f(threshold);
143 const int size = input_a.size();
153 const float UNUSED(threshold),
156 const int size = input_a.size();
158 const bool a = input_a[i];
159 const bool b = input_b[i];
160 span_result[i] =
a == b;
166 const float threshold,
169 const int size = input_a.size();
171 const float a = input_a[i];
172 const float b = input_b[i];
179 const float threshold,
182 const float threshold_squared =
pow2f(threshold);
183 const int size = input_a.size();
186 const float3 b = input_b[i];
193 const float threshold,
196 const float threshold_squared =
pow2f(threshold);
197 const int size = input_a.size();
207 const float UNUSED(threshold),
210 const int size = input_a.size();
212 const bool a = input_a[i];
213 const bool b = input_b[i];
214 span_result[i] =
a != b;
241 if (result_attribute) {
242 return result_attribute->domain();
255 const std::string result_name =
params.get_input<std::string>(
"Result");
261 result_name, result_domain, result_type);
262 if (!attribute_result) {
269 "A",
component, result_domain, input_data_type,
nullptr);
271 "B",
component, result_domain, input_data_type,
nullptr);
273 if (!attribute_a || !attribute_b) {
283 const float threshold =
params.get_input<
float>(
"Threshold");
333 params.set_output(
"Geometry", geometry_set);
void nodeSetSocketAvailability(struct bNodeSocket *sock, bool is_available)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
#define NODE_CLASS_ATTRIBUTE
void nodeRegisterType(struct bNodeType *ntype)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int compare_ff(float a, float b, const float max_diff)
MINLINE float pow2f(float x)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT
static uint8 component(Color32 c, uint i)
@ NODE_FLOAT_COMPARE_GREATER_THAN
@ NODE_FLOAT_COMPARE_EQUAL
@ NODE_FLOAT_COMPARE_NOT_EQUAL
GeometryNodeAttributeInputMode
@ GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume Image Sky Noise Wave Voronoi Brick Texture Vector Combine Vertex Separate Vector White RGB Map Separate Set Z Dilate Combine Combine Color Channel Split ID Combine Luminance Directional Alpha Distance Hue Movie Ellipse Bokeh View Corner Anti Mix RGB Hue Separate TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC TEX_NODE_PROC Boolean Random Edge Subdivision Point Object Attribute Attribute Attribute Color GEO_NODE_ATTRIBUTE_COMPARE
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void apply_span_and_save()
fn::GMutableSpan get_span_for_write_only()
void *(* MEM_callocN)(size_t len, const char *str)
TypedReadAttribute< Color4f > Color4fReadAttribute
TypedReadAttribute< float > FloatReadAttribute
TypedReadAttribute< float3 > Float3ReadAttribute
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
TypedReadAttribute< bool > BooleanReadAttribute
std::unique_ptr< ReadAttribute > ReadAttributePtr
CustomDataType attribute_data_type_highest_complexity(Span< CustomDataType > data_types)
static void do_not_equal_operation_color4f(const Color4fReadAttribute &input_a, const Color4fReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
bool try_dispatch_float_math_fl_fl_to_bool(const FloatCompareOperation operation, Callback &&callback)
static void do_not_equal_operation_float3(const Float3ReadAttribute &input_a, const Float3ReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
static void geo_node_attribute_compare_update(bNodeTree *UNUSED(ntree), bNode *node)
void update_attribute_input_socket_availabilities(bNode &node, const StringRef name, const GeometryNodeAttributeInputMode mode, const bool name_is_available)
static void attribute_compare_calc(GeometryComponent &component, const GeoNodeExecParams ¶ms)
static void do_equal_operation_float(const FloatReadAttribute &input_a, const FloatReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
static void geo_node_attribute_compare_exec(GeoNodeExecParams params)
static CustomDataType get_data_type(GeometryComponent &component, const GeoNodeExecParams ¶ms, const NodeAttributeCompare &node_storage)
static AttributeDomain get_result_domain(const GeometryComponent &component, StringRef source_name, StringRef result_name)
static void do_equal_operation_float3(const Float3ReadAttribute &input_a, const Float3ReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
static void do_equal_operation_color4f(const Color4fReadAttribute &input_a, const Color4fReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
static void do_not_equal_operation_float(const FloatReadAttribute &input_a, const FloatReadAttribute &input_b, const float threshold, MutableSpan< bool > span_result)
static void do_equal_operation_bool(const BooleanReadAttribute &input_a, const BooleanReadAttribute &input_b, const float UNUSED(threshold), MutableSpan< bool > span_result)
static void do_math_operation(const FloatReadAttribute &input_a, const FloatReadAttribute &input_b, const FloatCompareOperation operation, MutableSpan< bool > span_result)
static void do_not_equal_operation_bool(const BooleanReadAttribute &input_a, const BooleanReadAttribute &input_b, const float UNUSED(threshold), MutableSpan< bool > span_result)
void register_node_type_geo_attribute_compare()
static void geo_node_attribute_compare_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static bNodeSocketTemplate geo_node_attribute_compare_out[]
static bNodeSocketTemplate geo_node_attribute_compare_in[]
static bool operation_tests_equality(const NodeAttributeCompare &node_storage)
static void geo_node_attribute_compare_init(bNodeTree *UNUSED(tree), bNode *node)
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has(const GeometryComponentType component_type) const
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)