31 {
SOCK_FLOAT,
N_(
"A"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
32 {
SOCK_VECTOR,
N_(
"A"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
35 {
SOCK_FLOAT,
N_(
"B"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
36 {
SOCK_VECTOR,
N_(
"B"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX},
51 uiItemR(layout,
ptr,
"blend_type", 0,
"", ICON_NONE);
66 const int size = results.size();
68 const float factor = factors[i];
70 const float3 b{inputs_b[i]};
83 const int size = results.size();
85 const float factor = factors[i];
87 const float3 b = inputs_b[i];
99 const int size = results.size();
101 const float factor = factors[i];
118 blend_mode, attribute_factor, attribute_a, attribute_b, attribute_result);
122 blend_mode, attribute_factor, attribute_a, attribute_b, attribute_result);
126 blend_mode, attribute_factor, attribute_a, attribute_b, attribute_result);
136 if (result_attribute) {
137 return result_attribute->domain();
148 const std::string result_name =
params.get_input<std::string>(
"Result");
162 result_name, result_domain, result_type);
163 if (!attribute_result) {
168 "Factor",
component, result_domain, 0.5f);
170 "A",
component, result_domain, result_type,
nullptr);
172 "B",
component, result_domain, result_type,
nullptr);
180 attribute_result.
save();
196 params.set_output(
"Geometry", geometry_set);
202 "attribute mix node");
General operations, lookup, etc. for materials.
void ramp_blend(int type, float r_col[3], const float fac, const float col[3])
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 GEO_NODE_ATTRIBUTE_MIX
#define NODE_CLASS_ATTRIBUTE
void nodeRegisterType(struct bNodeType *ntype)
static uint8 component(Color32 c, uint i)
GeometryNodeAttributeInputMode
@ GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE
@ GEO_NODE_ATTRIBUTE_INPUT_FLOAT
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
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 *(* MEM_callocN)(size_t len, const char *str)
TypedReadAttribute< Color4f > Color4fReadAttribute
TypedWriteAttribute< float3 > Float3WriteAttribute
TypedWriteAttribute< Color4f > Color4fWriteAttribute
TypedReadAttribute< float > FloatReadAttribute
TypedReadAttribute< float3 > Float3ReadAttribute
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
TypedWriteAttribute< float > FloatWriteAttribute
std::unique_ptr< ReadAttribute > ReadAttributePtr
CustomDataType attribute_data_type_highest_complexity(Span< CustomDataType > data_types)
static void do_mix_operation_float3(const int blend_mode, const FloatReadAttribute &factors, const Float3ReadAttribute &inputs_a, const Float3ReadAttribute &inputs_b, Float3WriteAttribute results)
void update_attribute_input_socket_availabilities(bNode &node, const StringRef name, const GeometryNodeAttributeInputMode mode, const bool name_is_available)
static void do_mix_operation_color4f(const int blend_mode, const FloatReadAttribute &factors, const Color4fReadAttribute &inputs_a, const Color4fReadAttribute &inputs_b, Color4fWriteAttribute results)
static void do_mix_operation(const CustomDataType result_type, int blend_mode, const FloatReadAttribute &attribute_factor, const ReadAttribute &attribute_a, const ReadAttribute &attribute_b, WriteAttribute &attribute_result)
static AttributeDomain get_result_domain(const GeometryComponent &component, StringRef source_name, StringRef result_name)
static void attribute_mix_calc(GeometryComponent &component, const GeoNodeExecParams ¶ms)
static void geo_node_attribute_mix_init(bNodeTree *UNUSED(ntree), bNode *node)
static void geo_node_attribute_mix_update(bNodeTree *UNUSED(ntree), bNode *node)
static void geo_node_attribute_mix_exec(GeoNodeExecParams params)
static void do_mix_operation_float(const int blend_mode, const FloatReadAttribute &factors, const FloatReadAttribute &inputs_a, const FloatReadAttribute &inputs_b, FloatWriteAttribute results)
static bNodeSocketTemplate geo_node_attribute_mix_in[]
static bNodeSocketTemplate geo_node_mix_attribute_out[]
void register_node_type_geo_attribute_mix()
static void geo_node_attribute_mix_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
uint8_t input_type_factor
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)