42 b.add_input<
decl::Float>(
N_(
"Epsilon")).default_value(0.001).min(-10000.0f).max(10000.0f);
50 uiItemR(layout,
ptr,
"data_type", 0,
"", ICON_NONE);
52 uiItemR(layout,
ptr,
"mode", 0,
"", ICON_NONE);
54 uiItemR(layout,
ptr,
"operation", 0,
"", ICON_NONE);
120 const std::string socket_name =
params.in_out() ==
SOCK_IN ?
"A" :
"Result";
125 if (item->name !=
nullptr && item->identifier[0] !=
'\0') {
133 else if ((!string_type) ||
167 return (
a.x +
a.y +
a.z) / 3.0f;
177 switch (
data->data_type) {
179 switch (
data->operation) {
182 "Less Than", [](
float a,
float b) {
return a <
b; }, exec_preset_all};
187 "Less Equal", [](
float a,
float b) {
return a <=
b; }, exec_preset_all};
192 "Greater Than", [](
float a,
float b) {
return a >
b; }, exec_preset_all};
197 "Greater Equal", [](
float a,
float b) {
return a >=
b; }, exec_preset_all};
204 exec_preset_first_two};
211 exec_preset_first_two};
216 switch (
data->operation) {
219 "Less Than", [](
int a,
int b) {
return a <
b; }, exec_preset_all};
224 "Less Equal", [](
int a,
int b) {
return a <=
b; }, exec_preset_all};
229 "Greater Than", [](
int a,
int b) {
return a >
b; }, exec_preset_all};
234 "Greater Equal", [](
int a,
int b) {
return a >=
b; }, exec_preset_all};
239 "Equal", [](
int a,
int b) {
return a ==
b; }, exec_preset_all};
244 "Not Equal", [](
int a,
int b) {
return a !=
b; }, exec_preset_all};
250 switch (
data->operation) {
252 switch (
data->mode) {
255 "Less Than - Average",
262 "Less Than - Dot Product",
264 exec_preset_first_two};
269 "Less Than - Direction",
271 exec_preset_first_two};
276 "Less Than - Element-wise",
283 "Less Than - Length",
291 switch (
data->mode) {
294 "Less Equal - Average",
301 "Less Equal - Dot Product",
303 exec_preset_first_two};
308 "Less Equal - Direction",
310 exec_preset_first_two};
315 "Less Equal - Element-wise",
322 "Less Equal - Length",
330 switch (
data->mode) {
333 "Greater Than - Average",
340 "Greater Than - Dot Product",
342 exec_preset_first_two};
347 "Greater Than - Direction",
349 exec_preset_first_two};
354 "Greater Than - Element-wise",
361 "Greater Than - Length",
369 switch (
data->mode) {
372 "Greater Equal - Average",
379 "Greater Equal - Dot Product",
381 exec_preset_first_two};
386 "Greater Equal - Direction",
388 exec_preset_first_two};
393 "Greater Equal - Element-wise",
400 "Greater Equal - Length",
408 switch (
data->mode) {
415 exec_preset_first_two};
420 "Equal - Dot Product",
424 exec_preset_first_two};
433 exec_preset_first_two};
438 "Equal - Element-wise",
443 exec_preset_first_two};
452 exec_preset_first_two};
458 switch (
data->mode) {
461 "Not Equal - Average",
465 exec_preset_first_two};
470 "Not Equal - Dot Product",
474 exec_preset_first_two};
479 "Not Equal - Direction",
483 exec_preset_first_two};
488 "Not Equal - Element-wise",
493 exec_preset_first_two};
498 "Not Equal - Length",
502 exec_preset_first_two};
510 switch (
data->operation) {
518 exec_preset_first_two};
528 exec_preset_first_two};
552 switch (
data->operation) {
555 "Equal", [](std::string
a, std::string
b) {
return a ==
b; }};
560 "Not Equal", [](std::string
a, std::string
b) {
return a !=
b; }};
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
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))
void nodeRegisterType(struct bNodeType *ntype)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float rgb_to_grayscale(const float rgb[3])
float angle_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
@ NODE_COMPARE_MODE_ELEMENT
@ NODE_COMPARE_MODE_LENGTH
@ NODE_COMPARE_MODE_DOT_PRODUCT
@ NODE_COMPARE_MODE_AVERAGE
@ NODE_COMPARE_MODE_DIRECTION
@ NODE_COMPARE_LESS_EQUAL
@ NODE_COMPARE_COLOR_BRIGHTER
@ NODE_COMPARE_GREATER_EQUAL
@ NODE_COMPARE_GREATER_THAN
@ NODE_COMPARE_COLOR_DARKER
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void set_matching_fn(const MultiFunction *fn)
void operator()(LinkSearchOpParams ¶ms)
NodeCompareOperation operation
eNodeSocketDatatype data_type
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T length(const vec_base< T, Size > &a)
static void fn_node_compare_declare(NodeDeclarationBuilder &b)
static void node_compare_init(bNodeTree *UNUSED(tree), bNode *node)
static void node_compare_update(bNodeTree *ntree, bNode *node)
static const fn::MultiFunction * get_multi_function(bNode &node)
static void node_compare_label(const bNodeTree *UNUSED(ntree), const bNode *node, char *label, int maxlen)
static void geo_node_compare_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_compare_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static float component_average(float3 a)
static void fn_node_compare_build_multi_function(NodeMultiFunctionBuilder &builder)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_fn_compare()
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
const EnumPropertyItem rna_enum_node_compare_operation_items[]
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
void(* labelfunc)(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeMultiFunctionBuildFunction build_multi_function
NodeDeclareFunction declare