Blender V5.3
geometry_nodes_execute.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cfloat>
10
11#include "BLI_generic_array.hh"
13#include "BLI_listbase.hh"
14#include "BLI_math_euler.hh"
15#include "BLI_string.hh"
16
17#include "PRF_profile.hh"
18
19#include "NOD_geometry.hh"
24#include "NOD_menu_value.hh"
26#include "NOD_socket.hh"
27
29
32#include "BKE_geometry_set.hh"
33#include "BKE_idprop.hh"
34#include "BKE_lib_id.hh"
35#include "BKE_node_enum.hh"
36#include "BKE_node_runtime.hh"
39
41
43#include "DNA_mask_types.h"
44#include "DNA_material_types.h"
45#include "DNA_scene_types.h"
46#include "DNA_sound_types.h"
47#include "DNA_text_types.h"
48#include "DNA_vfont_types.h"
49
50#include "RNA_access.hh"
51
52#include "UI_resources.hh"
53
54namespace blender {
55
56namespace lf = fn::lazy_function;
57
58namespace nodes {
59
64
65bool input_has_attribute_toggle(const bNodeTree &node_tree, const int socket_index)
66{
67 node_tree.ensure_interface_cache();
68 const bke::bNodeSocketType *typeinfo =
69 node_tree.interface_inputs()[socket_index]->socket_typeinfo();
70 if (!typeinfo || !socket_type_has_attribute_toggle(typeinfo->type)) {
71 return false;
72 }
74 const StructureType structure_type =
75 node_tree.runtime->structure_type_interface->inputs[socket_index];
76 return ELEM(structure_type, StructureType::Field, StructureType::Dynamic);
77}
78
79template<typename T>
80[[nodiscard]] static std::optional<bke::SocketValueVariant> load_attribute_field_input(
81 PointerRNA &input_props_ptr)
82{
83 const std::string attribute_name = RNA_string_get(&input_props_ptr, "attribute_name");
84 if (!bke::allow_procedural_attribute_access(attribute_name)) {
85 return std::nullopt;
86 }
88}
89
90template<typename T>
92 PointerRNA &input_props_ptr)
93{
94 PropertyRNA &prop = *RNA_struct_find_property(&input_props_ptr, "value");
95 if (RNA_property_type(&prop) == PROP_STRING) {
96 if (!call_data) {
97 return bke::SocketValueVariant::from(static_cast<T *>(nullptr));
98 }
99 BLI_assert(call_data->operator_data);
100 const std::string name = RNA_string_get(&input_props_ptr, "value");
101 const ID *id_orig = call_data->operator_data->input_ids->lookup_default(name, nullptr);
102 if (!id_orig) {
103 return bke::SocketValueVariant::from(static_cast<T *>(nullptr));
104 }
105 const ID *id_eval = call_data->operator_data->depsgraphs->get_evaluated_id(*id_orig);
106 return bke::SocketValueVariant::from(id_cast<T *>(const_cast<ID *>(id_eval)));
107 }
108
110 T *data_block = id_cast<T *>(RNA_pointer_get(&input_props_ptr, "value").owner_id);
111 return bke::SocketValueVariant::from(data_block);
112}
113
115 const bNodeTree &ntree,
116 const bNodeTreeInterfaceSocket &io_socket)
117{
118 if (ntree.type == NTREE_COMPOSIT) {
120 }
121
122 const int input_index = ntree.interface_input_index(io_socket);
123 if (PropertyRNA *prop = RNA_struct_find_property(input_props_ptr, "type")) {
124 if (nodes::input_has_attribute_toggle(ntree, input_index)) {
125 return GeometryNodesInputType(RNA_property_enum_get(input_props_ptr, prop));
126 }
128 }
129
131}
132
134 PointerRNA *input_props_ptr,
135 const bNodeTree &ntree,
136 const bNodeTreeInterfaceSocket &io_socket)
137{
138 const bke::bNodeSocketType *stype = io_socket.socket_typeinfo();
139 const eNodeSocketDatatype socket_type = stype->type;
140 switch (socket_type) {
141 case SOCK_FLOAT: {
143 input_props_ptr, ntree, io_socket);
144 if (type == GeometryNodesInputType::Value) {
145 const float value = RNA_float_get(input_props_ptr, "value");
146 return bke::SocketValueVariant(value);
147 }
149 if (std::optional<bke::SocketValueVariant> value = load_attribute_field_input<float>(
150 *input_props_ptr))
151 {
152 return std::move(*value);
153 }
154 }
155 break;
156 }
157 case SOCK_VECTOR: {
159 input_props_ptr, ntree, io_socket);
160 if (type == GeometryNodesInputType::Value) {
161 /* Vector can have variable length. Use a large enough value to read all components.
162 * Zero initialize to in case length is below 3. */
163 float4 value = float4(0.0f);
164 RNA_float_get_array(input_props_ptr, "value", value);
165 return bke::SocketValueVariant(float3(value));
166 }
168 if (std::optional<bke::SocketValueVariant> value = load_attribute_field_input<float3>(
169 *input_props_ptr))
170 {
171 return std::move(*value);
172 }
173 }
174 break;
175 }
176 case SOCK_RGBA: {
178 input_props_ptr, ntree, io_socket);
179 if (type == GeometryNodesInputType::Value) {
180 ColorGeometry4f value;
181 RNA_float_get_array(input_props_ptr, "value", value);
182 return bke::SocketValueVariant(value);
183 }
185 if (std::optional<bke::SocketValueVariant> value =
187 {
188 return std::move(*value);
189 }
190 }
191 break;
192 }
193 case SOCK_BOOLEAN: {
195 input_props_ptr, ntree, io_socket);
196 if (type == GeometryNodesInputType::Value) {
197 const bool value = RNA_boolean_get(input_props_ptr, "value");
198 return bke::SocketValueVariant(value);
199 }
201 if (std::optional<bke::SocketValueVariant> value = load_attribute_field_input<bool>(
202 *input_props_ptr))
203 {
204 return std::move(*value);
205 }
206 }
207 if (type == GeometryNodesInputType::Layer) {
208 const std::string layer_name = RNA_string_get(input_props_ptr, "layer_name");
211 }
212 break;
213 }
214 case SOCK_INT: {
216 input_props_ptr, ntree, io_socket);
217 if (type == GeometryNodesInputType::Value) {
218 const int value = RNA_int_get(input_props_ptr, "value");
219 return bke::SocketValueVariant(value);
220 }
222 if (std::optional<bke::SocketValueVariant> value = load_attribute_field_input<int>(
223 *input_props_ptr))
224 {
225 return std::move(*value);
226 }
227 }
228 break;
229 }
230 case SOCK_ROTATION: {
232 input_props_ptr, ntree, io_socket);
233 if (type == GeometryNodesInputType::Value) {
234 float3 value_euler;
235 RNA_float_get_array(input_props_ptr, "value", value_euler);
236 math::Quaternion value_rotation = math::to_quaternion(math::EulerXYZ(value_euler));
237 return bke::SocketValueVariant(value_rotation);
238 }
240 if (std::optional<bke::SocketValueVariant> value =
242 {
243 return std::move(*value);
244 }
245 }
246 break;
247 }
248 case SOCK_MENU: {
250 input_props_ptr, ntree, io_socket);
251 if (type == GeometryNodesInputType::Value) {
252 const int value = RNA_enum_get(input_props_ptr, "value");
254 }
255 break;
256 }
257 case SOCK_STRING: {
259 input_props_ptr, ntree, io_socket);
260 if (type == GeometryNodesInputType::Value) {
261 const std::string value = RNA_string_get(input_props_ptr, "value");
262 return bke::SocketValueVariant(value);
263 }
264 break;
265 }
266 case SOCK_OBJECT: {
268 input_props_ptr, ntree, io_socket);
269 if (type == GeometryNodesInputType::Value) {
270 return load_data_block_input<Object>(call_data, *input_props_ptr);
271 }
272 break;
273 }
274 case SOCK_IMAGE: {
276 input_props_ptr, ntree, io_socket);
277 if (type == GeometryNodesInputType::Value) {
278 return load_data_block_input<Image>(call_data, *input_props_ptr);
279 }
280 break;
281 }
282 case SOCK_COLLECTION: {
284 input_props_ptr, ntree, io_socket);
285 if (type == GeometryNodesInputType::Value) {
286 return load_data_block_input<Collection>(call_data, *input_props_ptr);
287 }
288 break;
289 }
290 case SOCK_TEXTURE: {
292 input_props_ptr, ntree, io_socket);
293 if (type == GeometryNodesInputType::Value) {
294 return load_data_block_input<Tex>(call_data, *input_props_ptr);
295 }
296 break;
297 }
298 case SOCK_MATERIAL: {
300 input_props_ptr, ntree, io_socket);
301 if (type == GeometryNodesInputType::Value) {
302 return load_data_block_input<Material>(call_data, *input_props_ptr);
303 }
304 break;
305 }
306 case SOCK_FONT: {
308 input_props_ptr, ntree, io_socket);
309 if (type == GeometryNodesInputType::Value) {
310 return load_data_block_input<VFont>(call_data, *input_props_ptr);
311 }
312 break;
313 }
314 case SOCK_SCENE: {
316 input_props_ptr, ntree, io_socket);
317 if (type == GeometryNodesInputType::Value) {
318 return load_data_block_input<Scene>(call_data, *input_props_ptr);
319 }
320 break;
321 }
322 case SOCK_TEXT_ID: {
324 input_props_ptr, ntree, io_socket);
325 if (type == GeometryNodesInputType::Value) {
326 return load_data_block_input<Text>(call_data, *input_props_ptr);
327 }
328 break;
329 }
330 case SOCK_MASK: {
332 input_props_ptr, ntree, io_socket);
333 if (type == GeometryNodesInputType::Value) {
334 return load_data_block_input<Mask>(call_data, *input_props_ptr);
335 }
336 break;
337 }
338 case SOCK_SOUND: {
340 input_props_ptr, ntree, io_socket);
341 if (type == GeometryNodesInputType::Value) {
342 return load_data_block_input<bSound>(call_data, *input_props_ptr);
343 }
344 break;
345 }
346 case SOCK_GEOMETRY:
347 case SOCK_MATRIX:
348 case SOCK_BUNDLE:
349 case SOCK_CLOSURE:
350 case SOCK_SHADER:
351 case SOCK_CUSTOM:
352 case SOCK_INT_VECTOR:
353 break;
354 }
355
356 return *stype->geometry_nodes_default_value;
357}
358
363
370
376 const bNodeTree &tree, const PointerRNA &properties_ptr, Span<GMutablePointer> output_values)
377{
378 PropertyRNA *outputs_prop = RNA_struct_find_property(const_cast<PointerRNA *>(&properties_ptr),
379 "outputs");
380 if (!outputs_prop) {
381 return {};
382 }
383 PointerRNA outputs_ptr = RNA_property_pointer_get(const_cast<PointerRNA *>(&properties_ptr),
384 outputs_prop);
385
386 const bNode &output_node = *tree.group_output_node();
388 for (const bNodeSocket *socket : output_node.input_sockets().drop_front(1).drop_back(1)) {
389 if (!socket_type_has_attribute_toggle(socket->type)) {
390 continue;
391 }
392 PointerRNA output_props_ptr = RNA_pointer_get(&outputs_ptr, socket->identifier);
393 const std::string attribute_name = RNA_string_get(&output_props_ptr, "attribute_name");
394 if (attribute_name.empty()) {
395 continue;
396 }
397 if (!bke::allow_procedural_attribute_access(attribute_name)) {
398 continue;
399 }
400
401 const int index = socket->index();
402 bke::SocketValueVariant &value_variant = *output_values[index].get<bke::SocketValueVariant>();
403 const fn::GField &field = value_variant.ensure_type<fn::GField>();
404
405 const bNodeTreeInterfaceSocket *interface_socket = tree.interface_outputs()[index];
406 const bke::AttrDomain domain = bke::AttrDomain(interface_socket->attribute_domain);
407 OutputAttributeInfo output_info{.field = std::move(field), .name = attribute_name};
408 outputs_by_domain.add(domain, std::move(output_info));
409 }
410 return outputs_by_domain;
411}
412
420 const Span<const bke::GeometryComponent::Type> component_types)
421{
422 Vector<OutputAttributeToStore> attributes_to_store;
423 for (const auto component_type : component_types) {
424 if (!geometry.has(component_type)) {
425 continue;
426 }
427 const bke::GeometryComponent &component = *geometry.get_component(component_type);
428 const bke::AttributeAccessor attributes = *component.attributes();
429 for (const auto item : outputs_by_domain.items()) {
430 const bke::AttrDomain domain = item.key;
431 const Span<OutputAttributeInfo> outputs_info = item.value;
432 if (!attributes.domain_supported(domain)) {
433 continue;
434 }
435 const int domain_size = attributes.domain_size(domain);
436 bke::GeometryFieldContext field_context{component, domain};
437 fn::FieldEvaluator field_evaluator{field_context, domain_size};
438 for (const OutputAttributeInfo &output_info : outputs_info) {
439 const CPPType &type = output_info.field.cpp_type();
440 const bke::AttributeValidator validator = attributes.lookup_validator(output_info.name);
441
442 OutputAttributeToStore store{component_type,
443 domain,
444 output_info.name,
445 GArray<>(type, domain_size, NoInitialization())};
446 fn::GField field = validator.validate_field_if_necessary(output_info.field);
447 field_evaluator.add_with_destination(std::move(field), store.data.as_mutable_span());
448 attributes_to_store.append(std::move(store));
449 }
450 field_evaluator.evaluate();
451 }
452 }
453 return attributes_to_store;
454}
455
457{
458 using namespace bke::socket_value_visitor;
459 auto has_anonymous_attributes = [&](const bke::AttributeAccessor &attributes) {
460 return attributes.has_anonymous();
461 };
463 attributes.remove_anonymous();
464 };
465
466 VisitParams params;
467 params.check_AttributeAccessor = has_anonymous_attributes;
468 params.edit_AttributeAccessor = remove_anonymous_attributes;
469 edit_recursive(geometry, params);
470}
471
474{
475 for (OutputAttributeToStore &store : attributes_to_store) {
476 bke::GeometryComponent &component = geometry.get_component_for_write(store.component_type);
477 bke::MutableAttributeAccessor attributes = *component.attributes_for_write();
478
479 const bke::AttrType data_type = bke::cpp_type_to_attribute_type(store.data.type());
480 const std::optional<bke::AttributeMetaData> meta_data = attributes.lookup_meta_data(
481 store.name);
482
483 /* Attempt to remove the attribute if it already exists but the domain and type don't match.
484 * Removing the attribute won't succeed if it is built in and non-removable. */
485 if (meta_data.has_value() &&
486 (meta_data->domain != store.domain || meta_data->data_type != data_type))
487 {
488 attributes.remove(store.name);
489 }
490
491 /* Try to create the attribute reusing the stored buffer. This will only succeed if the
492 * attribute didn't exist before, or if it existed but was removed above. */
493 const ImplicitSharingPtr sharing_info(
494 new ImplicitSharedValue<GArray<>>(std::move(store.data)));
495 const GArray<> &data = sharing_info->data;
496 if (attributes.add(store.name,
497 store.domain,
499 bke::AttributeInitShared(data.data(), *sharing_info)))
500 {
501 continue;
502 }
503
505 store.name, store.domain, data_type);
506 if (attribute) {
507 attribute.varray.set_all(data.data());
508 attribute.finish();
509 }
510 }
511}
512
514 const bNodeTree &tree,
515 const PointerRNA &properties_ptr,
516 Span<GMutablePointer> output_values)
517{
518 /* All new attribute values have to be computed before the geometry is actually changed. This is
519 * necessary because some fields might depend on attributes that are overwritten. */
521 find_output_attributes_to_store(tree, properties_ptr, output_values);
522 if (outputs_by_domain.size() == 0) {
523 return;
524 }
525
526 {
527 /* Handle top level instances separately first. */
530 store_computed_output_attributes(geometry, attributes_to_store);
531 }
532
533 const bool only_instance_attributes = outputs_by_domain.size() == 1 &&
534 *outputs_by_domain.keys().begin() ==
536 if (only_instance_attributes) {
537 /* No need to call #foreach_real_geometry when only adding attributes to top-level instances.
538 * This avoids some unnecessary data copies currently if some sub-geometries are not yet owned
539 * by the geometry set, i.e. they use #GeometryOwnershipType::Editable/ReadOnly. */
540 return;
541 }
542
544 /* Instance attributes should only be created for the top-level geometry. */
546 instance_geometry,
547 outputs_by_domain,
551 store_computed_output_attributes(instance_geometry, attributes_to_store);
552 });
553}
554
556 const PointerRNA &properties_ptr,
557 const ComputeContext &base_compute_context,
558 GeoNodesCallData &call_data,
559 bke::GeometrySet input_geometry)
560{
562 const GeometryNodesLazyFunctionGraphInfo &lf_graph_info =
564 const GeometryNodesGroupFunction &function = lf_graph_info.function;
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();
568
569 Array<GMutablePointer> param_inputs(num_inputs);
570 Array<GMutablePointer> param_outputs(num_outputs);
571 Array<std::optional<lf::ValueUsage>> param_input_usages(num_inputs);
572 Array<lf::ValueUsage> param_output_usages(num_outputs);
573 Array<bool> param_set_outputs(num_outputs, false);
574
575 /* We want to evaluate the main outputs, but don't care about which inputs are used for now. */
576 param_output_usages.as_mutable_span().slice(function.outputs.main).fill(lf::ValueUsage::Used);
577 param_output_usages.as_mutable_span()
578 .slice(function.outputs.input_usages)
579 .fill(lf::ValueUsage::Unused);
580
581 call_data.call_depth_limit = U.nodes_stack_limit;
582
583 GeoNodesUserData user_data;
584 user_data.call_data = &call_data;
585 call_data.root_ntree = &btree;
586
587 user_data.compute_context = &base_compute_context;
588
589 ResourceScope scope;
590 LinearAllocator<> &allocator = scope.allocator();
591
592 btree.ensure_interface_cache();
593
594 PointerRNA inputs_ptr = RNA_pointer_get(const_cast<PointerRNA *>(&properties_ptr), "inputs");
595
596 /* Prepare main inputs. */
597 for (const int i : btree.interface_inputs().index_range()) {
598 const bNodeTreeInterfaceSocket &interface_socket = *btree.interface_inputs()[i];
599 const bke::bNodeSocketType *typeinfo = interface_socket.socket_typeinfo();
600 const eNodeSocketDatatype socket_type = typeinfo ? typeinfo->type : SOCK_CUSTOM;
601 if (socket_type == SOCK_GEOMETRY && i == 0) {
603 bke::SocketValueVariant::from(std::move(input_geometry)));
604 param_inputs[function.inputs.main[0]] = &value;
605 continue;
606 }
607
608 PointerRNA input_props_ptr = RNA_pointer_get(&inputs_ptr, interface_socket.identifier);
610 &call_data, &input_props_ptr, btree, interface_socket);
611 param_inputs[function.inputs.main[i]] = &scope.construct<bke::SocketValueVariant>(
612 std::move(value));
613 }
614
615 /* Prepare used-outputs inputs. */
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];
619 }
620
621 /* No anonymous attributes have to be propagated. */
622 Array<bke::GeometryNodesReferenceSet> references_to_propagate(
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];
626 }
627
628 /* Prepare memory for output values. */
629 for (const int i : IndexRange(num_outputs)) {
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};
634 }
635
636 GeoNodesLocalUserData local_user_data(user_data);
637
638 lf::Context lf_context(lazy_function.init_storage(allocator), &user_data, &local_user_data);
639 lf::BasicParams lf_params{lazy_function,
640 param_inputs,
641 param_outputs,
642 param_input_usages,
643 param_output_usages,
644 param_set_outputs};
645 {
646 ScopedComputeContextTimer timer{lf_context};
647 lazy_function.execute(lf_params, lf_context);
648 }
649 lazy_function.destruct_storage(lf_context.storage);
650
651 bke::GeometrySet output_geometry =
652 param_outputs[0].get<bke::SocketValueVariant>()->extract<bke::GeometrySet>();
653 store_output_attributes(output_geometry, btree, properties_ptr, param_outputs);
654
655 for (const int i : IndexRange(num_outputs)) {
656 if (param_set_outputs[i]) {
657 GMutablePointer &ptr = param_outputs[i];
658 ptr.destruct();
659 }
660 }
661
662 if (output_geometry.has_bundle()) {
663 /* Ensure that the bundle data is properly owned by the geometry. Do not call this in the
664 * geometry itself because it may just be referenced during modifier evaluation and an
665 * unnecessary copy can be avoided. See #GeometryOwnershipType::Editable. */
666 output_geometry.bundle_for_write().ensure_owns_direct_data();
667 }
668
669 /* Remove anonymous attributes because their lifetimes can't be tracked reliably outside of
670 * Geometry Nodes. */
671 remove_anonymous_attributes(output_geometry);
672 return output_geometry;
673}
674
676 const PointerRNA &properties_ptr,
677 ResourceScope &scope)
678{
679 /* Assume that all inputs have unknown values by default. */
680 Vector<InferenceValue> inference_values(btree.interface_inputs().size(),
682
683 PointerRNA inputs_ptr = RNA_pointer_get(const_cast<PointerRNA *>(&properties_ptr), "inputs");
684
685 btree.ensure_interface_cache();
686 for (const int input_i : btree.interface_inputs().index_range()) {
687 const bNodeTreeInterfaceSocket &io_input = *btree.interface_inputs()[input_i];
688 const bke::bNodeSocketType *stype = io_input.socket_typeinfo();
689 if (!stype) {
690 continue;
691 }
692 if (!stype->base_cpp_type || !stype->geometry_nodes_default_value) {
693 continue;
694 }
695 PointerRNA socket_props_ptr = RNA_pointer_get(&inputs_ptr, io_input.identifier);
697 &socket_props_ptr, btree, io_input);
698 if (input_type != GeometryNodesInputType::Value) {
699 continue;
700 }
701
702 bke::SocketValueVariant &value = scope.add_value(
703 init_socket_cpp_value(nullptr, &socket_props_ptr, btree, io_input));
704 if (!value.is_single()) {
705 continue;
706 }
707 const GPointer single_value = value.get();
708 BLI_assert(single_value.type() == stype->base_cpp_type);
709 inference_values[input_i] = InferenceValue::from_primitive(single_value.get());
710 }
711 return inference_values;
712}
713
714} // namespace nodes
715} // namespace blender
Object groups, one object can be in many groups at once.
#define PRF_scope(category)
__forceinline float extract(const int4 &b)
Definition binning.cpp:27
#define ELEM(...)
MutableSpan< T > as_mutable_span()
Definition BLI_array.hh:259
IndexRange index_range() const
Definition BLI_array.hh:371
GMutableSpan as_mutable_span()
GArray(Allocator allocator={}) noexcept
const CPPType * type() const
const void * get() 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
static fn::GField from(std::string name, const CPPType &type, std::optional< std::string > socket_inspection_name=std::nullopt)
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)
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)
Definition FN_field.hh:482
static InferenceValue from_primitive(const void *value)
#define attribute(slot)
#define T
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)
BMesh Iterators.
UserDef U
Definition blender.cc:58
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)
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
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)
eNodeTree_Type type
bke::bNodeTreeRuntime * runtime
fn::GField validate_field_if_necessary(const fn::GField &field) const
nodes::Bundle & bundle_for_write()
Defines a socket type.
Definition BKE_node.hh:163
const CPPType * base_cpp_type
Definition BKE_node.hh:210
eNodeSocketDatatype type
Definition BKE_node.hh:198
const SocketValueVariant * geometry_nodes_default_value
Definition BKE_node.hh:216
struct blender::nodes::GeometryNodesGroupFunction::@172250372114350111302221310316304130074374314150 inputs
struct blender::nodes::GeometryNodesGroupFunction::@275230106163054033107343230045175116316373002223 outputs