46 uiTemplateID(layout,
C,
ptr,
"texture",
"texture.new",
nullptr,
nullptr, 0, ICON_NONE,
nullptr);
57 if (result_attribute) {
58 return result_attribute->domain();
64 return map_attribute->domain();
79 const std::string result_attribute_name =
params.get_input<std::string>(
"Result");
80 const std::string mapping_name =
params.get_input<std::string>(
"Mapping");
81 if (!
component.attribute_exists(mapping_name)) {
86 component, result_attribute_name, mapping_name);
95 mapping_name, result_domain, {0, 0, 0});
98 for (
const int i :
IndexRange(mapping_attribute.size())) {
100 const float3 position = mapping_attribute[i];
102 const float3 remapped_position = position * 2.0f -
float3(1.0f);
104 colors[i] = {texture_result.
tr, texture_result.
tg, texture_result.
tb, texture_result.
ta};
122 params.set_output(
"Geometry", geometry_set);
133 "Attribute Sample Texture",
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
#define NODE_CLASS_ATTRIBUTE
void nodeRegisterType(struct bNodeType *ntype)
void BKE_texture_get_value(const struct Scene *scene, struct Tex *texture, const float *tex_co, struct TexResult *texres, bool use_color_management)
static uint8 component(Color32 c, uint i)
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 Attribute Attribute Vector Point GEO_NODE_ATTRIBUTE_SAMPLE_TEXTURE
void uiTemplateID(uiLayout *layout, const struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter, const bool live_icon, const char *text)
void apply_span_and_save()
fn::GMutableSpan get_span()
TypedReadAttribute< float3 > Float3ReadAttribute
GeometrySet geometry_set_realize_instances(const GeometrySet &geometry_set)
std::unique_ptr< ReadAttribute > ReadAttributePtr
static void geo_node_attribute_sample_texture_exec(GeoNodeExecParams params)
static void execute_on_component(const GeoNodeExecParams ¶ms, GeometryComponent &component)
static AttributeDomain get_result_domain(const GeometryComponent &component, StringRef source_name, StringRef result_name)
static bNodeSocketTemplate geo_node_attribute_sample_texture_out[]
static bNodeSocketTemplate geo_node_attribute_sample_texture_in[]
void register_node_type_geo_sample_texture()
static void geo_node_attribute_sample_texture_layout(uiLayout *layout, bContext *C, PointerRNA *ptr)
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
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)