44 node_tree.ensure_interface_cache();
46 node_tree.interface_inputs()[socket_index]->socket_typeinfo();
53 *node_tree.
runtime->field_inferencing_interface;
60 int idprop_items_num = 0;
65 idprop_items_num = items.
size();
77 idprop_item.
icon = ICON_NONE;
83 if (idprop_items_num == 0) {
86 idprop_items->
value = 0;
90 idprop_items->
icon = ICON_NONE;
102 if (use_name_for_ids) {
113 const nodes::StructureType structure_type,
114 const bool use_name_for_ids)
116 if (structure_type == StructureType::Grid) {
173 ui_data->default_array_len = 4;
176 ui_data->soft_min = 0.0;
177 ui_data->soft_max = 1.0;
179 ui_data->default_array[
i] = double(value->
value[
i]);
228 ID *
id =
reinterpret_cast<ID *
>(value->
value);
235 ID *
id =
reinterpret_cast<ID *
>(value->
value);
241 ID *
id =
reinterpret_cast<ID *
>(value->
value);
247 ID *
id =
reinterpret_cast<ID *
>(value->
value);
253 ID *
id =
reinterpret_cast<ID *
>(value->
value);
292 switch (old_property.
subtype) {
294 double *
const old_value =
static_cast<double *const
>(
IDP_Array(&old_property));
295 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
296 for (
int i = 0;
i <
len;
i++) {
297 if (
i < old_property.
len) {
298 new_value[
i] = float(old_value[
i]);
307 int *
const old_value =
static_cast<int *const
>(
IDP_Array(&old_property));
308 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
309 for (
int i = 0;
i <
len;
i++) {
310 if (
i < old_property.
len) {
311 new_value[
i] = float(old_value[
i]);
320 float *
const old_value =
static_cast<float *const
>(
IDP_Array(&old_property));
321 float *new_value =
static_cast<float *
>(new_property->
data.
pointer);
322 for (
int i = 0;
i <
len;
i++) {
323 if (
i < old_property.
len) {
324 new_value[
i] = old_value[
i];
362 const bool use_name_for_ids)
373 switch (old_property.
type) {
392 old_property, new_property, value->
dimensions);
396 old_property, new_property, 3);
399 old_property, new_property, 4);
412 switch (old_property.
type) {
431 if (use_name_for_ids) {
459 const bool use_name_for_ids)
462 socket, property,
nullptr, use_name_for_ids);
482 switch (socket_value_type) {
495 int value =
IDP_Int(&property);
500 const void *property_array =
IDP_Array(&property);
505 for (
int i = 0;
i <
property.len;
i++) {
506 values[
i] =
static_cast<const float *
>(property_array)[
i];
510 for (
int i = 0;
i <
property.len;
i++) {
511 values[
i] = float(
static_cast<const int *
>(property_array)[
i]);
515 for (
int i = 0;
i <
property.len;
i++) {
516 values[
i] = float(
static_cast<const double *
>(property_array)[
i]);
528 const void *property_array =
IDP_Array(&property);
531 vec =
float4(
static_cast<const float *
>(property_array));
534 vec =
float4(
int4(
static_cast<const int *
>(property_array)));
538 vec =
float4(
double4(
static_cast<const double *
>(property_array)));
545 const bool value =
IDP_Bool(&property);
550 const void *property_array =
IDP_Array(&property);
553 vec =
float3(
static_cast<const float *
>(property_array));
556 vec =
float3(
int3(
static_cast<const int *
>(property_array)));
560 vec =
float3(
double3(
static_cast<const double *
>(property_array)));
572 int value =
IDP_Int(&property);
579 *(
Object **)r_value =
object;
597 *(
Image **)r_value = image;
618 if (!use_attribute) {
622 if (
IDP_Int(use_attribute) == 0) {
640 const int input_index,
647 if (property ==
nullptr) {
671 std::make_shared<bke::NamedLayerSelectionFieldInput>(layer_name), 0);
700 const bNode &output_node = *
tree.group_output_node();
702 for (
const bNodeSocket *socket : output_node.input_sockets().drop_front(1).drop_back(1)) {
709 if (prop ==
nullptr) {
720 const int index = socket->index();
727 output_info.
field = std::move(field);
728 output_info.
name = attribute_name;
729 outputs_by_domain.
add(domain, std::move(output_info));
731 return outputs_by_domain;
741 const bool do_instances)
749 if (!
geometry.has(component_type)) {
757 for (
const auto item : outputs_by_domain.
items()) {
763 const int domain_size = attributes.
domain_size(domain);
767 const CPPType &type = output_info.field.cpp_type();
779 attributes_to_store.
append(store);
784 return attributes_to_store;
795 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
800 if (meta_data.has_value() &&
801 (meta_data->domain != store.domain || meta_data->data_type != data_type))
803 attributes.
remove(store.name);
808 if (attributes.
add(store.name,
817 store.name, store.domain, data_type);
824 store.data.type().destruct_n(store.data.data(), store.data.size());
838 if (outputs_by_domain.
size() == 0) {
841 const bool only_instance_attributes = outputs_by_domain.
size() == 1 &&
842 *outputs_by_domain.
keys().begin() ==
844 if (only_instance_attributes) {
856 const bool do_instances = &
geometry == &instance_geometry;
858 instance_geometry, outputs_by_domain, do_instances);
873 const int num_inputs = lazy_function.
inputs().size();
874 const int num_outputs = lazy_function.
outputs().size();
897 btree.ensure_interface_cache();
900 for (
const int i : btree.interface_inputs().index_range()) {
905 param_inputs[function.
inputs.
main[0]] = &input_geometry;
911 void *value = allocator.
allocate(*type);
913 param_inputs[function.
inputs.
main[
i]] = {type, value};
914 inputs_to_destruct.
append({type, value});
918 Array<bool> output_used_inputs(btree.interface_outputs().size(),
true);
919 for (
const int i : btree.interface_outputs().index_range()) {
926 for (
const int i : references_to_propagate.
index_range()) {
934 void *buffer = allocator.
allocate(type);
935 param_outputs[
i] = {type, buffer};
949 lazy_function.
execute(lf_params, lf_context);
957 bke::GeometrySet output_geometry = std::move(*param_outputs[0].get<bke::GeometrySet>());
961 if (param_set_outputs[
i]) {
967 return output_geometry;
973 const bool use_name_for_ids)
975 tree.ensure_interface_cache();
978 tree.runtime->structure_type_interface->inputs;
985 socket, input_structure_types[
i], use_name_for_ids)
987 if (new_prop ==
nullptr) {
998 if (old_properties !=
nullptr) {
1000 if (old_prop !=
nullptr) {
1004 socket, *old_prop, new_prop, use_name_for_ids);
1020 if (old_properties ==
nullptr) {
1023 IDP_Int(use_attribute_prop) = 1;
1029 if (old_prop_use_attribute !=
nullptr) {
1035 if (old_attribute_name_prop !=
nullptr) {
1047 tree.ensure_topology_cache();
1066 if (old_properties ==
nullptr) {
1073 if (old_prop !=
nullptr) {
1079 if (new_prop->
ui_data !=
nullptr) {
1094 r_values.
fill(
nullptr);
1096 btree.ensure_interface_cache();
1097 for (
const int input_i : btree.interface_inputs().index_range()) {
1137 r_values[input_i] = single_value;
void IDP_ui_data_free(IDProperty *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()
void IDP_AssignString(IDProperty *prop, const char *st) ATTR_NONNULL()
void IDP_AssignStringMaxSize(IDProperty *prop, const char *st, size_t st_maxncpy) ATTR_NONNULL()
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
IDPropertyUIData * IDP_ui_data_ensure(IDProperty *prop)
#define BLI_assert_unreachable()
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
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
MutableSpan< T > as_mutable_span()
IndexRange index_range() const
static const CPPType & get()
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)
constexpr void fill(const T &value) const
void * allocate_owned(const CPPType &type)
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr Span take_front(int64_t n) const
constexpr bool is_empty() const
const Key & lookup_key_as(const ForwardKey &key) const
void reserve(const int64_t n)
Key lookup_key_default_as(const ForwardKey &key, ForwardDefault &&...default_key) const
void add_new(const Key &key)
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()
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef attribute_id)
bool add(const StringRef attribute_id, const AttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer)
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
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)
eCustomDataType cpp_type_to_custom_data_type(const CPPType &type)
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)
static bool old_id_property_type_matches_socket_convert_to_new_string(const IDProperty &old_property, IDProperty *new_property)
bke::GeometrySet execute_geometry_nodes_on_geometry(const bNodeTree &btree, const PropertiesVectorSet &properties_set, const ComputeContext &base_compute_context, GeoNodesCallData &call_data, bke::GeometrySet input_geometry)
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)
PropertiesVectorSet build_properties_vector_set(const IDProperty *properties)
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 void initialize_group_input(const bNodeTree &tree, const PropertiesVectorSet &properties, const int input_index, void *r_value)
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)
bool id_property_type_matches_socket(const bNodeTreeInterfaceSocket &socket, const IDProperty &property, const bool use_name_for_ids)
CustomIDVectorSet< IDProperty *, IDPropNameGetter, 16 > PropertiesVectorSet
const GeometryNodesLazyFunctionGraphInfo * ensure_geometry_nodes_lazy_function_graph(const bNodeTree &btree)
static void store_output_attributes(bke::GeometrySet &geometry, const bNodeTree &tree, const PropertiesVectorSet &properties, Span< GMutablePointer > output_values)
bool socket_type_supports_fields(const eNodeSocketDatatype socket_type)
static Vector< OutputAttributeToStore > compute_attributes_to_store(const bke::GeometrySet &geometry, const MultiValueMap< bke::AttrDomain, OutputAttributeInfo > &outputs_by_domain, const bool do_instances)
void update_output_properties_from_node_tree(const bNodeTree &tree, const IDProperty *old_properties, IDProperty &properties)
static MultiValueMap< bke::AttrDomain, OutputAttributeInfo > find_output_attributes_to_store(const bNodeTree &tree, const PropertiesVectorSet &properties, Span< GMutablePointer > output_values)
static bool old_id_property_type_matches_socket_convert_to_new_float_vec(const IDProperty &old_property, IDProperty *new_property, const int len)
void get_geometry_nodes_input_base_values(const bNodeTree &btree, const PropertiesVectorSet &properties, ResourceScope &scope, MutableSpan< GPointer > r_values)
static void init_socket_cpp_value_from_property(const IDProperty &property, const eNodeSocketDatatype socket_value_type, void *r_value)
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)
std::optional< StringRef > input_attribute_name_get(const PropertiesVectorSet &properties, const bNodeTreeInterfaceSocket &io_input)
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
const blender::CPPType * geometry_nodes_cpp_type
SocketGetGeometryNodesCPPValueFunction get_geometry_nodes_cpp_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::@311217322151273055243347055333132220230004041004 inputs
struct blender::nodes::GeometryNodesGroupFunction::@311217322151273055243347055333132220230004041004::@376313040076355172126342102314323105254352264056 references_to_propagate
const LazyFunction * function
struct blender::nodes::GeometryNodesGroupFunction::@132153240164066211264033224237254060060001355126 outputs
GeometryNodesGroupFunction function
bke::GeometryComponent::Type component_type