49 node_tree.ensure_interface_cache();
51 node_tree.interface_inputs()[socket_index]->socket_typeinfo();
58 *node_tree.
runtime->field_inferencing_interface;
65 int idprop_items_num = 0;
70 idprop_items_num = items.
size();
82 idprop_item.
icon = ICON_NONE;
88 if (idprop_items_num == 0) {
91 idprop_items->
value = 0;
95 idprop_items->
icon = ICON_NONE;
107 if (use_name_for_ids) {
118 const nodes::StructureType structure_type,
119 const bool use_name_for_ids)
121 if (structure_type == StructureType::Grid) {
178 ui_data->default_array_len = 4;
181 ui_data->soft_min = 0.0;
182 ui_data->soft_max = 1.0;
184 ui_data->default_array[
i] = double(value->
value[
i]);
233 ID *
id =
reinterpret_cast<ID *
>(value->
value);
240 ID *
id =
reinterpret_cast<ID *
>(value->
value);
246 ID *
id =
reinterpret_cast<ID *
>(value->
value);
252 ID *
id =
reinterpret_cast<ID *
>(value->
value);
258 ID *
id =
reinterpret_cast<ID *
>(value->
value);
297 switch (old_property.
subtype) {
300 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
301 for (
int i = 0;
i <
len;
i++) {
302 if (
i < old_property.
len) {
303 new_value[
i] =
float(old_value[
i]);
313 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
314 for (
int i = 0;
i <
len;
i++) {
315 if (
i < old_property.
len) {
316 new_value[
i] =
float(old_value[
i]);
326 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
327 for (
int i = 0;
i <
len;
i++) {
328 if (
i < old_property.
len) {
329 new_value[
i] = old_value[
i];
367 const bool use_name_for_ids)
378 switch (old_property.
type) {
397 old_property, new_property, value->
dimensions);
401 old_property, new_property, 3);
404 old_property, new_property, 4);
417 switch (old_property.
type) {
436 if (use_name_for_ids) {
464 const bool use_name_for_ids)
467 socket, property,
nullptr, use_name_for_ids);
473 switch (socket_value_type) {
494 for (
int i = 0;
i <
property.len;
i++) {
495 values[
i] =
static_cast<const float *
>(property_array)[
i];
499 for (
int i = 0;
i <
property.len;
i++) {
500 values[
i] =
float(
static_cast<const int *
>(property_array)[
i]);
504 for (
int i = 0;
i <
property.len;
i++) {
505 values[
i] =
float(
static_cast<const double *
>(property_array)[
i]);
519 vec =
float4(
static_cast<const float *
>(property_array));
522 vec =
float4(
int4(
static_cast<const int *
>(property_array)));
526 vec =
float4(
double4(
static_cast<const double *
>(property_array)));
539 vec =
float3(
static_cast<const float *
>(property_array));
542 vec =
float3(
int3(
static_cast<const int *
>(property_array)));
546 vec =
float3(
double3(
static_cast<const double *
>(property_array)));
596 if (!use_attribute) {
618 const int input_index)
624 if (property ==
nullptr) {
645 fn::GField selection_field(std::make_shared<bke::NamedLayerSelectionFieldInput>(layer_name),
671 const bNode &output_node = *
tree.group_output_node();
673 for (
const bNodeSocket *socket : output_node.input_sockets().drop_front(1).drop_back(1)) {
680 if (prop ==
nullptr) {
691 const int index = socket->index();
698 output_info.
field = std::move(field);
699 output_info.
name = attribute_name;
700 outputs_by_domain.
add(domain, std::move(output_info));
702 return outputs_by_domain;
715 for (
const auto component_type : component_types) {
716 if (!
geometry.has(component_type)) {
721 for (
const auto item : outputs_by_domain.
items()) {
727 const int domain_size = attributes.
domain_size(domain);
731 const CPPType &type = output_info.field.cpp_type();
743 attributes_to_store.
append(store);
748 return attributes_to_store;
759 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
764 if (meta_data.has_value() &&
765 (meta_data->domain != store.domain || meta_data->data_type != data_type))
767 attributes.
remove(store.name);
772 if (attributes.
add(store.name,
781 store.name, store.domain, data_type);
788 store.data.type().destruct_n(store.data.data(), store.data.size());
802 if (outputs_by_domain.
size() == 0) {
813 const bool only_instance_attributes = outputs_by_domain.
size() == 1 &&
814 *outputs_by_domain.
keys().begin() ==
816 if (only_instance_attributes) {
845 const int num_inputs = lazy_function.
inputs().size();
846 const int num_outputs = lazy_function.
outputs().size();
869 btree.ensure_interface_cache();
872 for (
const int i : btree.interface_inputs().index_range()) {
878 value.
set(std::move(input_geometry));
879 param_inputs[function.
inputs.
main[0]] = &value;
889 Array<bool> output_used_inputs(btree.interface_outputs().size(),
true);
890 for (
const int i : btree.interface_outputs().index_range()) {
897 for (
const int i : references_to_propagate.
index_range()) {
905 void *buffer = allocator.
allocate(type);
906 param_outputs[
i] = {type, buffer};
920 lazy_function.
execute(lf_params, lf_context);
929 if (param_set_outputs[
i]) {
935 return output_geometry;
941 const bool use_name_for_ids)
943 tree.ensure_interface_cache();
946 tree.runtime->structure_type_interface->inputs;
953 socket, input_structure_types[
i], use_name_for_ids)
955 if (new_prop ==
nullptr) {
966 if (old_properties !=
nullptr) {
968 if (old_prop !=
nullptr) {
972 socket, *old_prop, new_prop, use_name_for_ids);
988 if (old_properties ==
nullptr) {
997 if (old_prop_use_attribute !=
nullptr) {
1003 if (old_attribute_name_prop !=
nullptr) {
1015 tree.ensure_topology_cache();
1034 if (old_properties ==
nullptr) {
1041 if (old_prop !=
nullptr) {
1047 if (new_prop->
ui_data !=
nullptr) {
1064 btree.ensure_interface_cache();
1065 for (
const int input_i : btree.interface_inputs().index_range()) {
1100 return inference_values;
void IDP_ui_data_free(IDProperty *prop)
#define IDP_float_get(prop)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, blender::StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_EnumItemsValidate(const IDPropertyUIDataEnumItem *items, int items_num, void(*error_fn)(const char *))
void IDP_CopyPropertyContent(IDProperty *dst, const IDProperty *src) ATTR_NONNULL()
#define IDP_array_voidp_get(prop)
#define IDP_bool_set(prop, value)
void IDP_AssignString(IDProperty *prop, const char *st) ATTR_NONNULL()
void IDP_AssignStringMaxSize(IDProperty *prop, const char *st, size_t st_maxncpy) ATTR_NONNULL()
#define IDP_int_get(prop)
#define IDP_array_double_get(prop)
#define IDP_int_set(prop, value)
IDProperty * IDP_GetPropertyFromGroup_null(const IDProperty *prop, blender::StringRef name) ATTR_WARN_UNUSED_RESULT
#define IDP_string_get(prop)
#define IDP_double_get(prop)
#define IDP_array_int_get(prop)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_NewStringMaxSize(const char *st, size_t st_maxncpy, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
#define IDP_float_set(prop, value)
IDPropertyUIData * IDP_ui_data_ensure(IDProperty *prop)
#define IDP_array_float_get(prop)
#define IDP_bool_get(prop)
#define BLI_assert_unreachable()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strdup_null(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
@ IDP_FLAG_OVERRIDABLE_LIBRARY
__forceinline float extract(const int4 &b)
MutableSpan< T > as_mutable_span()
IndexRange index_range() const
const CPPType * type() const
void set_all(const void *src)
void * allocate(const int64_t size, const int64_t alignment)
MapType::KeyIterator keys() const
MapType::ItemIterator items() const
void add(const Key &key, const Value &value)
T & construct(Args &&...args)
LinearAllocator & allocator()
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr Span take_front(int64_t n) const
constexpr bool is_empty() const
void append(const T &value)
AttributeValidator lookup_validator(const StringRef attribute_id) const
bool domain_supported(const AttrDomain domain) const
int domain_size(const AttrDomain domain) const
std::optional< AttributeMetaData > lookup_meta_data(StringRef attribute_id) const
virtual std::optional< AttributeAccessor > attributes() const
virtual std::optional< MutableAttributeAccessor > attributes_for_write()
bool add(const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
bool remove(const StringRef attribute_id)
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
static SocketValueVariant From(T &&value)
GPointer get_single_ptr() const
int add_with_destination(GField field, GVMutableArray dst)
virtual void * init_storage(LinearAllocator<> &allocator) const
Span< Input > inputs() const
Span< Output > outputs() const
virtual void destruct_storage(void *storage) const
void execute(Params ¶ms, const Context &context) const
static InferenceValue from_primitive(const void *value)
static InferenceValue Unknown()
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_mallocN_aligned(size_t len, size_t alignment, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_bool(StringRef prop_name, bool value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_BOOLEAN, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRef prop_name, int32_t value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_INT, set its name and value.
bool allow_procedural_attribute_access(StringRef attribute_name)
AttrType cpp_type_to_attribute_type(const CPPType &type)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
EulerXYZBase< float > EulerXYZ
static void store_computed_output_attributes(bke::GeometrySet &geometry, const Span< OutputAttributeToStore > attributes_to_store)
std::optional< StringRef > input_attribute_name_get(const IDProperty *properties, const bNodeTreeInterfaceSocket &io_input)
static bke::SocketValueVariant init_socket_cpp_value_from_property(const IDProperty &property, const eNodeSocketDatatype socket_value_type)
static bool old_id_property_type_matches_socket_convert_to_new_string(const IDProperty &old_property, IDProperty *new_property)
static void store_output_attributes(bke::GeometrySet &geometry, const bNodeTree &tree, const IDProperty *properties, Span< GMutablePointer > output_values)
std::unique_ptr< IDProperty, bke::idprop::IDPropertyDeleter > id_property_create_from_socket(const bNodeTreeInterfaceSocket &socket, const nodes::StructureType structure_type, const bool use_name_for_ids)
void update_input_properties_from_node_tree(const bNodeTree &tree, const IDProperty *old_properties, IDProperty &properties, const bool use_name_for_ids)
bool input_has_attribute_toggle(const bNodeTree &node_tree, const int socket_index)
static std::unique_ptr< IDProperty, bke::idprop::IDPropertyDeleter > id_name_or_value_prop(const StringRefNull identifier, ID *id, const ID_Type id_type, const bool use_name_for_ids)
static void id_property_int_update_enum_items(const bNodeSocketValueMenu *value, IDPropertyUIDataInt *ui_data)
static bke::SocketValueVariant initialize_group_input(const bNodeTree &tree, const IDProperty *properties, const int input_index)
bool id_property_type_matches_socket(const bNodeTreeInterfaceSocket &socket, const IDProperty &property, const bool use_name_for_ids)
bke::GeometrySet execute_geometry_nodes_on_geometry(const bNodeTree &btree, const IDProperty *properties, const ComputeContext &base_compute_context, GeoNodesCallData &call_data, bke::GeometrySet input_geometry)
static Vector< OutputAttributeToStore > compute_attributes_to_store(const bke::GeometrySet &geometry, const MultiValueMap< bke::AttrDomain, OutputAttributeInfo > &outputs_by_domain, const Span< const bke::GeometryComponent::Type > component_types)
const GeometryNodesLazyFunctionGraphInfo * ensure_geometry_nodes_lazy_function_graph(const bNodeTree &btree)
bool socket_type_supports_fields(const eNodeSocketDatatype socket_type)
void update_output_properties_from_node_tree(const bNodeTree &tree, const IDProperty *old_properties, IDProperty &properties)
static bool old_id_property_type_matches_socket_convert_to_new_float_vec(const IDProperty &old_property, IDProperty *new_property, const int len)
Vector< InferenceValue > get_geometry_nodes_input_inference_values(const bNodeTree &btree, const IDProperty *properties, ResourceScope &scope)
static MultiValueMap< bke::AttrDomain, OutputAttributeInfo > find_output_attributes_to_store(const bNodeTree &tree, const IDProperty *properties, Span< GMutablePointer > output_values)
bool socket_type_has_attribute_toggle(const eNodeSocketDatatype type)
constexpr StringRef input_attribute_name_suffix
constexpr StringRef input_use_attribute_suffix
static bool old_id_property_type_matches_socket_convert_to_new(const bNodeTreeInterfaceSocket &socket, const IDProperty &old_property, IDProperty *new_property, const bool use_name_for_ids)
static bool old_id_property_type_matches_socket_convert_to_new_int(const IDProperty &old_property, IDProperty *new_property)
VecBase< int32_t, 4 > int4
VecBase< float, 4 > float4
VecBase< int32_t, 3 > int3
VecBase< double, 3 > double3
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
VecBase< double, 4 > double4
bool is_layer_selection_field(const bNodeTreeInterfaceSocket &socket)
IDPropertyUIDataEnumItem * enum_items
IDPropertyUIData * ui_data
struct Collection * value
char * default_attribute_name
bNodeTreeRuntimeHandle * runtime
fn::GField validate_field_if_necessary(const fn::GField &field) const
SocketGetGeometryNodesCPPValueFunction get_geometry_nodes_cpp_value
const SocketValueVariant * geometry_nodes_default_value
const blender::CPPType * base_cpp_type
Array< InputSocketFieldType > inputs
const bNodeTree * root_ntree
const ComputeContext * compute_context
const GeoNodesCallData * call_data
Vector< int > geometry_outputs
struct blender::nodes::GeometryNodesGroupFunction::@232110204243006334063226161314302053011300272310 outputs
struct blender::nodes::GeometryNodesGroupFunction::@176034106072117145033162003214300177076220367077 inputs
const LazyFunction * function
struct blender::nodes::GeometryNodesGroupFunction::@176034106072117145033162003214300177076220367077::@201205044241144324034052062053171123334141114245 references_to_propagate
GeometryNodesGroupFunction function
bke::GeometryComponent::Type component_type