27 {
SOCK_FLOAT,
N_(
"A"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
29 {
SOCK_FLOAT,
N_(
"B"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
31 {
SOCK_FLOAT,
N_(
"C"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
43 return ELEM(operation,
107 uiItemR(layout,
ptr,
"operation", 0,
"", ICON_NONE);
161 span_result[i] = math_function(span_a[i], span_b[i], span_c[i]);
176 span_result[i] = math_function(span_a[i], span_b[i]);
190 span_result[i] = math_function(span_input[i]);
204 if (result_attribute) {
205 return result_attribute->domain();
224 const std::string result_name =
params.get_input<std::string>(
"Result");
232 result_name, result_domain, result_type);
233 if (!attribute_result) {
238 "A",
component, result_domain, result_type,
nullptr);
247 "B",
component, result_domain, result_type,
nullptr);
253 "C",
component, result_domain, result_type,
nullptr);
258 attribute_b->get_span<
float>(),
259 attribute_c->get_span<
float>(),
265 attribute_b->get_span<
float>(),
292 params.set_output(
"Geometry", geometry_set);
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)
#define UNUSED_VARS_NDEBUG(...)
static uint8 component(Color32 c, uint i)
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 GEO_NODE_ATTRIBUTE_MATH
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 std::string default_domain
void apply_span_and_save()
constexpr int64_t size() const
fn::GMutableSpan get_span_for_write_only()
void *(* MEM_callocN)(size_t len, const char *str)
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
std::unique_ptr< ReadAttribute > ReadAttributePtr
static void geo_node_attribute_math_exec(GeoNodeExecParams params)
bool try_dispatch_float_math_fl_fl_to_fl(const int operation, Callback &&callback)
void update_attribute_input_socket_availabilities(bNode &node, const StringRef name, const GeometryNodeAttributeInputMode mode, const bool name_is_available)
bool try_dispatch_float_math_fl_to_fl(const int operation, Callback &&callback)
static void geo_node_attribute_math_update(bNodeTree *UNUSED(ntree), bNode *node)
static void attribute_math_calc(GeometryComponent &component, const GeoNodeExecParams ¶ms)
static AttributeDomain get_result_domain(const GeometryComponent &component, StringRef source_name, StringRef result_name)
bool try_dispatch_float_math_fl_fl_fl_to_fl(const int operation, Callback &&callback)
static void do_math_operation(const FloatReadAttribute &input_a, const FloatReadAttribute &input_b, const FloatCompareOperation operation, MutableSpan< bool > span_result)
static void geo_node_attribute_math_init(bNodeTree *UNUSED(tree), bNode *node)
static bool operation_use_input_c(const NodeMathOperation operation)
static bNodeSocketTemplate geo_node_attribute_math_in[]
void register_node_type_geo_attribute_math()
static bool operation_use_input_b(const NodeMathOperation operation)
static bNodeSocketTemplate geo_node_attribute_math_out[]
static void geo_node_attribute_math_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
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)