67 node_tree.ensure_interface_cache();
69 node_tree.interface_inputs()[socket_index]->socket_typeinfo();
74 const StructureType structure_type =
76 return ELEM(structure_type, StructureType::Field, StructureType::Dynamic);
83 const std::string attribute_name =
RNA_string_get(&input_props_ptr,
"attribute_name");
100 const std::string name =
RNA_string_get(&input_props_ptr,
"value");
110 T *data_block = id_cast<T *>(
RNA_pointer_get(&input_props_ptr,
"value").owner_id);
122 const int input_index = ntree.interface_input_index(io_socket);
140 switch (socket_type) {
143 input_props_ptr, ntree, io_socket);
152 return std::move(*value);
159 input_props_ptr, ntree, io_socket);
171 return std::move(*value);
178 input_props_ptr, ntree, io_socket);
185 if (std::optional<bke::SocketValueVariant> value =
188 return std::move(*value);
195 input_props_ptr, ntree, io_socket);
204 return std::move(*value);
208 const std::string layer_name =
RNA_string_get(input_props_ptr,
"layer_name");
216 input_props_ptr, ntree, io_socket);
218 const int value =
RNA_int_get(input_props_ptr,
"value");
225 return std::move(*value);
232 input_props_ptr, ntree, io_socket);
240 if (std::optional<bke::SocketValueVariant> value =
243 return std::move(*value);
250 input_props_ptr, ntree, io_socket);
252 const int value =
RNA_enum_get(input_props_ptr,
"value");
259 input_props_ptr, ntree, io_socket);
261 const std::string value =
RNA_string_get(input_props_ptr,
"value");
268 input_props_ptr, ntree, io_socket);
276 input_props_ptr, ntree, io_socket);
284 input_props_ptr, ntree, io_socket);
292 input_props_ptr, ntree, io_socket);
300 input_props_ptr, ntree, io_socket);
308 input_props_ptr, ntree, io_socket);
316 input_props_ptr, ntree, io_socket);
324 input_props_ptr, ntree, io_socket);
332 input_props_ptr, ntree, io_socket);
340 input_props_ptr, ntree, io_socket);
386 const bNode &output_node = *tree.group_output_node();
388 for (
const bNodeSocket *socket : output_node.input_sockets().drop_front(1).drop_back(1)) {
393 const std::string attribute_name =
RNA_string_get(&output_props_ptr,
"attribute_name");
394 if (attribute_name.empty()) {
401 const int index = socket->index();
408 outputs_by_domain.
add(domain, std::move(output_info));
410 return outputs_by_domain;
423 for (
const auto component_type : component_types) {
424 if (!
geometry.has(component_type)) {
429 for (
const auto item : outputs_by_domain.
items()) {
435 const int domain_size = attributes.
domain_size(domain);
439 const CPPType &type = output_info.field.cpp_type();
448 attributes_to_store.
append(std::move(store));
453 return attributes_to_store;
460 return attributes.has_anonymous();
463 attributes.remove_anonymous();
467 params.check_AttributeAccessor = has_anonymous_attributes;
480 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
485 if (meta_data.has_value() &&
486 (meta_data->domain != store.domain || meta_data->data_type != data_type))
488 attributes.
remove(store.name);
496 if (attributes.
add(store.name,
505 store.name, store.domain, data_type);
522 if (outputs_by_domain.
size() == 0) {
533 const bool only_instance_attributes = outputs_by_domain.
size() == 1 &&
534 *outputs_by_domain.
keys().begin() ==
536 if (only_instance_attributes) {
565 const lf::LazyFunction &lazy_function = *function.
function;
566 const int num_inputs = lazy_function.inputs().size();
567 const int num_outputs = lazy_function.outputs().size();
578 .slice(function.
outputs.input_usages)
579 .fill(lf::ValueUsage::Unused);
592 btree.ensure_interface_cache();
597 for (
const int i : btree.interface_inputs().index_range()) {
604 param_inputs[function.
inputs.main[0]] = &value;
610 &call_data, &input_props_ptr, btree, interface_socket);
616 Array<bool> output_used_inputs(btree.interface_outputs().size(),
true);
617 for (
const int i : btree.interface_outputs().index_range()) {
618 param_inputs[function.
inputs.output_usages[i]] = &output_used_inputs[i];
623 function.
inputs.references_to_propagate.geometry_outputs.size());
624 for (
const int i : references_to_propagate.
index_range()) {
625 param_inputs[function.
inputs.references_to_propagate.range[i]] = &references_to_propagate[i];
630 const lf::Output &lf_output = lazy_function.outputs()[i];
631 const CPPType &type = *lf_output.type;
632 void *buffer = allocator.
allocate(type);
633 param_outputs[i] = {type, buffer};
638 lf::Context lf_context(lazy_function.init_storage(allocator), &user_data, &local_user_data);
639 lf::BasicParams lf_params{lazy_function,
647 lazy_function.execute(lf_params, lf_context);
649 lazy_function.destruct_storage(lf_context.storage);
656 if (param_set_outputs[i]) {
672 return output_geometry;
685 btree.ensure_interface_cache();
686 for (
const int input_i : btree.interface_inputs().index_range()) {
697 &socket_props_ptr, btree, io_input);
711 return inference_values;
Object groups, one object can be in many groups at once.
#define PRF_scope(category)
__forceinline float extract(const int4 &b)
MutableSpan< T > as_mutable_span()
IndexRange index_range() const
GMutableSpan as_mutable_span()
GArray(Allocator allocator={}) noexcept
const CPPType * type() const
constexpr IndexRange()=default
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()
void append(const T &value)
AttributeValidator lookup_validator(const StringRef name) const
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
bool domain_supported(const AttrDomain domain) const
int domain_size(const AttrDomain domain) const
virtual std::optional< AttributeAccessor > attributes() const
virtual std::optional< MutableAttributeAccessor > attributes_for_write()
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
bool remove(const StringRef name)
GAttributeWriter lookup_or_add_for_write(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
static SocketValueVariant from(T &&value)
std::unique_ptr< nodes::StructureTypeInterface > structure_type_interface
int add_with_destination(GField field, GVMutableArray dst)
static GField from_input(Args &&...args)
void ensure_owns_direct_data()
static InferenceValue from_primitive(const void *value)
static InferenceValue Unknown()
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< float > Quaternion
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
EulerXYZBase< float > EulerXYZ
Vector< InferenceValue > get_geometry_nodes_input_inference_values(const bNodeTree &btree, const PointerRNA &properties_ptr, ResourceScope &scope)
static void store_output_attributes(bke::GeometrySet &geometry, const bNodeTree &tree, const PointerRNA &properties_ptr, Span< GMutablePointer > output_values)
bool input_has_attribute_toggle(const bNodeTree &node_tree, const int socket_index)
static MultiValueMap< bke::AttrDomain, OutputAttributeInfo > find_output_attributes_to_store(const bNodeTree &tree, const PointerRNA &properties_ptr, Span< GMutablePointer > output_values)
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)
bool socket_type_supports_attributes(const eNodeSocketDatatype socket_type)
static GeometryNodesInputType get_effective_input_type(PointerRNA *input_props_ptr, const bNodeTree &ntree, const bNodeTreeInterfaceSocket &io_socket)
const std::shared_ptr< const GeometryNodesLazyFunctionGraphInfo > & ensure_geometry_nodes_lazy_function_graph(const bNodeTree &btree)
static void store_computed_output_attributes(bke::GeometrySet &geometry, const MutableSpan< OutputAttributeToStore > attributes_to_store)
static bke::SocketValueVariant load_data_block_input(const GeoNodesCallData *call_data, PointerRNA &input_props_ptr)
static void remove_anonymous_attributes(bke::GeometrySet &geometry)
static std::optional< bke::SocketValueVariant > load_attribute_field_input(PointerRNA &input_props_ptr)
static bke::SocketValueVariant init_socket_cpp_value(const GeoNodesCallData *call_data, PointerRNA *input_props_ptr, const bNodeTree &ntree, const bNodeTreeInterfaceSocket &io_socket)
bool socket_type_has_attribute_toggle(const eNodeSocketDatatype type)
bke::GeometrySet execute_geometry_nodes_on_geometry(const bNodeTree &btree, const PointerRNA &properties_ptr, const ComputeContext &base_compute_context, GeoNodesCallData &call_data, bke::GeometrySet input_geometry)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
VecBase< float, 4 > float4
PropertyType RNA_property_type(PropertyRNA *prop)
BMesh const char void * data
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
std::string RNA_string_get(PointerRNA *ptr, const char *name)
VecBase< float, 3 > float3
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
bke::bNodeTreeRuntime * runtime
fn::GField validate_field_if_necessary(const fn::GField &field) const
nodes::Bundle & bundle_for_write()
const CPPType * base_cpp_type
const SocketValueVariant * geometry_nodes_default_value
const bNodeTree * root_ntree
GeoNodesOperatorData * operator_data
const Map< std::string, ID * > * input_ids
const GeoNodesOperatorDepsgraphs * depsgraphs
const ID * get_evaluated_id(const ID &id_orig) const
const ComputeContext * compute_context
const GeoNodesCallData * call_data
struct blender::nodes::GeometryNodesGroupFunction::@172250372114350111302221310316304130074374314150 inputs
struct blender::nodes::GeometryNodesGroupFunction::@275230106163054033107343230045175116316373002223 outputs
const LazyFunction * function
GeometryNodesGroupFunction function
bke::GeometryComponent::Type component_type