Blender V5.3
node_tree_zones.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 <iostream>
10
11#include "BKE_node.hh"
12#include "BKE_node_runtime.hh"
14
16#include "BLI_bit_span_ops.hh"
17#include "BLI_set.hh"
18
19namespace blender::bke {
20
22{
23 if (zone.depth >= 0) {
24 return;
25 }
26 if (zone.parent_zone == nullptr) {
27 zone.depth = 0;
28 return;
29 }
31 zone.depth = zone.parent_zone->depth + 1;
32}
33
35 const bNodeTree &tree,
36 bNodeTreeZones &owner,
37 Map<const bNode *, bNodeTreeZone *> &r_zone_by_inout_node)
38{
40
42 Vector<const bNode *> zone_output_nodes;
43 for (const bNodeZoneType *zone_type : zone_types) {
44 zone_output_nodes.extend(tree.nodes_by_type(zone_type->output_idname));
45 }
46 for (const bNode *node : zone_output_nodes) {
47 auto zone = std::make_unique<bNodeTreeZone>();
48 zone->owner = &owner;
49 zone->index = zones.size();
50 zone->output_node_id = node->identifier;
51 r_zone_by_inout_node.add(node, zone.get());
52 zones.append(std::move(zone));
53 }
54 for (const bNodeZoneType *zone_type : zone_types) {
55 for (const bNode *input_node : tree.nodes_by_type(zone_type->input_idname)) {
56 if (const bNode *output_node = zone_type->get_corresponding_output(tree, *input_node)) {
57 if (bNodeTreeZone *zone = r_zone_by_inout_node.lookup_default(output_node, nullptr)) {
58 zone->input_node_id = input_node->identifier;
59 r_zone_by_inout_node.add(input_node, zone);
60 }
61 }
62 }
63 }
64 /* Avoid incomplete zones, all zones must have a valid input and output node. */
65 for (const std::unique_ptr<bNodeTreeZone> &zone : zones) {
66 if (!zone->input_node_id || !zone->output_node_id) {
67 r_zone_by_inout_node.clear();
68 return {};
69 }
70 }
71 return zones;
72}
73
77
78 uint64_t hash() const
79 {
80 return get_default_hash(this->parent, this->child);
81 }
82
83 friend bool operator==(const ZoneRelation &a, const ZoneRelation &b) = default;
84};
85
86static std::optional<Vector<ZoneRelation>> get_direct_zone_relations(
87 const Span<bNodeTreeZone *> all_zones, const BitGroupVector<> &depend_on_input_flag_array)
88{
89 VectorSet<ZoneRelation> all_zone_relations;
90
91 /* Gather all relations, even the transitive once. */
92 for (bNodeTreeZone *zone : all_zones) {
93 const int zone_i = zone->index;
94 for (const bNode *node : {zone->output_node()}) {
95 if (node == nullptr) {
96 continue;
97 }
98 const BoundedBitSpan depend_on_input_flags = depend_on_input_flag_array[node->index()];
99 bits::foreach_1_index(depend_on_input_flags, [&](const int parent_zone_i) {
100 if (parent_zone_i != zone_i) {
101 all_zone_relations.add_new({all_zones[parent_zone_i], zone});
102 }
103 });
104 }
105 }
106
107 for (const ZoneRelation &relation : all_zone_relations) {
108 const ZoneRelation reverse_relation{relation.child, relation.parent};
109 if (all_zone_relations.contains(reverse_relation)) {
110 /* There is a cyclic zone dependency. */
111 return std::nullopt;
112 }
113 }
114
115 /* Remove transitive relations. This is a brute force algorithm currently. */
116 Vector<int> transitive_relations;
117 for (const int a : all_zone_relations.index_range()) {
118 const ZoneRelation &relation_a = all_zone_relations[a];
119 for (const int b : all_zone_relations.index_range()) {
120 if (a == b) {
121 continue;
122 }
123 const ZoneRelation &relation_b = all_zone_relations[b];
124 if (relation_a.child != relation_b.parent) {
125 continue;
126 }
127 const ZoneRelation transitive_relation{relation_a.parent, relation_b.child};
128 const int transitive_relation_i = all_zone_relations.index_of_try(transitive_relation);
129 if (transitive_relation_i != -1) {
130 transitive_relations.append_non_duplicates(transitive_relation_i);
131 }
132 }
133 }
134 std::ranges::sort(transitive_relations, std::greater<>());
135
136 Vector<ZoneRelation> zone_relations = all_zone_relations.as_span();
137 for (const int i : transitive_relations) {
138 zone_relations.remove_and_reorder(i);
139 }
140
141 return zone_relations;
142}
143
144static bool update_zone_per_node(const Span<const bNode *> all_nodes,
145 const Span<bNodeTreeZone *> all_zones,
146 const BitGroupVector<> &depend_on_input_flag_array,
147 const Map<const bNode *, bNodeTreeZone *> &zone_by_inout_node,
148 Map<int, int> &r_zone_by_node_id,
149 Vector<int> &r_node_outside_zones)
150{
151 bool found_node_in_multiple_zones = false;
152 for (const int node_i : all_nodes.index_range()) {
153 const bNode &node = *all_nodes[node_i];
154 const BoundedBitSpan depend_on_input_flags = depend_on_input_flag_array[node_i];
155 bNodeTreeZone *parent_zone = nullptr;
156 bits::foreach_1_index(depend_on_input_flags, [&](const int parent_zone_i) {
157 bNodeTreeZone *zone = all_zones[parent_zone_i];
158 if (ELEM(&node, zone->input_node(), zone->output_node())) {
159 return;
160 }
161 if (parent_zone == nullptr) {
162 parent_zone = zone;
163 return;
164 }
165 for (bNodeTreeZone *iter_zone = zone->parent_zone; iter_zone;
166 iter_zone = iter_zone->parent_zone)
167 {
168 if (iter_zone == parent_zone) {
169 /* This zone is nested in the parent zone, so it becomes the new parent of the node. */
170 parent_zone = zone;
171 return;
172 }
173 }
174 for (bNodeTreeZone *iter_zone = parent_zone->parent_zone; iter_zone;
175 iter_zone = iter_zone->parent_zone)
176 {
177 if (iter_zone == zone) {
178 /* This zone is a parent of the current parent of the node, do nothing. */
179 return;
180 }
181 }
182 found_node_in_multiple_zones = true;
183 });
184 if (parent_zone == nullptr) {
185 if (!zone_by_inout_node.contains(&node)) {
186 r_node_outside_zones.append(node.identifier);
187 }
188 }
189 else {
190 r_zone_by_node_id.add(node.identifier, parent_zone->index);
191 }
192 }
193 for (const MapItem<const bNode *, bNodeTreeZone *> item : zone_by_inout_node.items()) {
194 r_zone_by_node_id.add_overwrite(item.key->identifier, item.value->index);
195 }
196 return found_node_in_multiple_zones;
197}
198
199static void update_zone_border_links(const bNodeTree &tree, bNodeTreeZones &tree_zones)
200{
201 tree.ensure_topology_cache();
202 for (const bNodeLink *link : tree.all_links()) {
203 if (!link->is_available()) {
204 continue;
205 }
206 if (link->is_muted()) {
207 continue;
208 }
209 if (link->fromnode->is_dangling_reroute()) {
210 continue;
211 }
212 bNodeTreeZone *from_zone = const_cast<bNodeTreeZone *>(
213 tree_zones.get_zone_by_socket(*link->fromsock));
214 bNodeTreeZone *to_zone = const_cast<bNodeTreeZone *>(
215 tree_zones.get_zone_by_socket(*link->tosock));
216 if (from_zone == to_zone) {
217 continue;
218 }
219 BLI_assert(from_zone == nullptr || from_zone->contains_zone_recursively(*to_zone));
220 for (bNodeTreeZone *zone = to_zone; zone != from_zone; zone = zone->parent_zone) {
221 zone->border_links.append(link);
222 }
223 }
224}
225
226static std::unique_ptr<bNodeTreeZones> discover_tree_zones(const bNodeTree &tree)
227{
228 tree.ensure_topology_cache();
229 if (tree.has_available_link_cycle()) {
230 return {};
231 }
232
233 const Span<int> input_types = all_zone_input_node_types();
234 const Span<int> output_types = all_zone_output_node_types();
235
236 std::unique_ptr<bNodeTreeZones> tree_zones = std::make_unique<bNodeTreeZones>();
237 tree_zones->tree = &tree;
238
239 const Span<const bNode *> all_nodes = tree.all_nodes();
240 Map<const bNode *, bNodeTreeZone *> zone_by_inout_node;
241 tree_zones->zones_ptrs = find_zone_nodes(tree, *tree_zones, zone_by_inout_node);
242 for (const std::unique_ptr<bNodeTreeZone> &zone : tree_zones->zones_ptrs) {
243 tree_zones->zones.append(zone.get());
244 }
245
246 const int zones_num = tree_zones->zones.size();
247 const int nodes_num = all_nodes.size();
248 /* A bit for every node-zone-combination. The bit is set when the node is in the zone. */
249 BitGroupVector<> depend_on_input_flag_array(nodes_num, zones_num, false);
250 /* The bit is set when the node depends on the output of the zone. */
251 BitGroupVector<> depend_on_output_flag_array(nodes_num, zones_num, false);
252
253 const Span<const bNode *> sorted_nodes = tree.toposort_left_to_right();
254 for (const bNode *node : sorted_nodes) {
255 const int node_i = node->index();
256 MutableBoundedBitSpan depend_on_input_flags = depend_on_input_flag_array[node_i];
257 MutableBoundedBitSpan depend_on_output_flags = depend_on_output_flag_array[node_i];
258
259 /* Forward all bits from the nodes to the left. */
260 for (const bNodeSocket *input_socket : node->input_sockets()) {
261 if (!input_socket->is_available()) {
262 continue;
263 }
264 for (const bNodeLink *link : input_socket->directly_linked_links()) {
265 if (link->is_muted()) {
266 continue;
267 }
268 const bNode &from_node = *link->fromnode;
269 const int from_node_i = from_node.index();
270 depend_on_input_flags |= depend_on_input_flag_array[from_node_i];
271 depend_on_output_flags |= depend_on_output_flag_array[from_node_i];
272 }
273 }
274 if (input_types.contains(node->type_legacy)) {
275 if (const bNodeTreeZone *zone = zone_by_inout_node.lookup_default(node, nullptr)) {
276 /* Now entering a zone, so set the corresponding bit. */
277 depend_on_input_flags[zone->index].set();
278 }
279 }
280 else if (output_types.contains(node->type_legacy)) {
281 if (const bNodeTreeZone *zone = zone_by_inout_node.lookup_default(node, nullptr)) {
282 /* The output is implicitly linked to the input, so also propagate the bits from there. */
283 if (const bNode *zone_input_node = zone->input_node()) {
284 const int input_node_i = zone_input_node->index();
285 depend_on_input_flags |= depend_on_input_flag_array[input_node_i];
286 depend_on_output_flags |= depend_on_output_flag_array[input_node_i];
287 }
288 /* Now exiting a zone, so change the bits accordingly. */
289 depend_on_input_flags[zone->index].reset();
290 depend_on_output_flags[zone->index].set();
291 }
292 }
293
294 if (bits::has_common_set_bits(depend_on_input_flags, depend_on_output_flags)) {
295 /* A node can not be inside and after a zone at the same time. */
296 return {};
297 }
298 }
299
300 const std::optional<Vector<ZoneRelation>> zone_relations = get_direct_zone_relations(
301 tree_zones->zones, depend_on_input_flag_array);
302 if (!zone_relations) {
303 /* Found cyclic relations. */
304 return {};
305 }
306
307 /* Set parent and child pointers in zones. */
308 for (const ZoneRelation &relation : *zone_relations) {
309 relation.parent->child_zones.append(relation.child);
310 BLI_assert(relation.child->parent_zone == nullptr);
311 relation.child->parent_zone = relation.parent;
312 }
313
314 Set<const bNodeTreeZone *> found_zones;
315 for (bNodeTreeZone *main_zone : tree_zones->zones) {
316 found_zones.clear();
317 for (bNodeTreeZone *zone = main_zone; zone; zone = zone->parent_zone) {
318 if (!found_zones.add(zone)) {
319 /* Found cyclic parent relationships between zones. */
320 return {};
321 }
322 }
323 }
324
325 /* Update depths. */
326 for (bNodeTreeZone *zone : tree_zones->zones) {
327 update_zone_depths(*zone);
328 }
329
330 for (bNodeTreeZone *zone : tree_zones->zones) {
331 if (zone->depth == 0) {
332 tree_zones->root_zones.append(zone);
333 }
334 }
335
336 const bool found_node_in_multiple_zones = update_zone_per_node(
337 all_nodes,
338 tree_zones->zones,
339 depend_on_input_flag_array,
340 zone_by_inout_node,
341 tree_zones->zone_by_node_id,
342 tree_zones->node_ids_outside_zones);
343 if (found_node_in_multiple_zones) {
344 return {};
345 }
346
347 for (const UString output_idname : {"NodeGroupOutput"_ustr,
348 "ShaderNodeOutputMaterial"_ustr,
349 "ShaderNodeOutputLight"_ustr,
350 "ShaderNodeOutputWorld"_ustr,
351 "ShaderNodeOutputAOV"_ustr})
352 {
353 for (const bNode *node : tree.nodes_by_type(output_idname)) {
354 if (tree_zones->zone_by_node_id.contains(node->identifier)) {
355 /* Output nodes must not be in a zone. */
356 return {};
357 }
358 }
359 }
360
361 for (const int node_i : all_nodes.index_range()) {
362 const bNode *node = all_nodes[node_i];
363 const int zone_i = tree_zones->zone_by_node_id.lookup_default(node->identifier, -1);
364 if (zone_i == -1) {
365 continue;
366 }
367 bNodeTreeZone &zone = *tree_zones->zones[zone_i];
368 if (ELEM(node->identifier, zone.input_node_id, zone.output_node_id)) {
369 continue;
370 }
371 zone.child_node_ids.append(node->identifier);
372 }
373
374 update_zone_border_links(tree, *tree_zones);
375
376 // std::cout << *tree_zones << std::endl;
377 return tree_zones;
378}
379
381{
382 tree.ensure_topology_cache();
385 if (tree.runtime->tree_zones) {
387 }
388 });
389 return tree.runtime->tree_zones.get();
390}
391
393{
394 const bNodeTreeZones *zones = this->owner;
395 const int zone_i = zones->zone_by_node_id.lookup_default(node.identifier, -1);
396 if (zone_i == -1) {
397 return false;
398 }
399 for (const bNodeTreeZone *zone = zones->zones[zone_i]; zone; zone = zone->parent_zone) {
400 if (zone == this) {
401 return true;
402 }
403 }
404 return false;
405}
406
408{
409 for (const bNodeTreeZone *zone = other_zone.parent_zone; zone; zone = zone->parent_zone) {
410 if (zone == this) {
411 return true;
412 }
413 }
414 return false;
415}
416
418{
419 const bNode &node = socket.owner_node();
420 const bNodeTreeZone *zone = this->get_zone_by_node(node.identifier);
421 if (zone == nullptr) {
422 return zone;
423 }
424 if (zone->input_node_id == node.identifier) {
425 if (socket.is_input()) {
426 return zone->parent_zone;
427 }
428 }
429 if (zone->output_node_id == node.identifier) {
430 if (socket.is_output()) {
431 return zone->parent_zone;
432 }
433 }
434 return zone;
435}
436
438{
439 const int zone_i = this->zone_by_node_id.lookup_default(node_id, -1);
440 if (zone_i == -1) {
441 return nullptr;
442 }
443 return this->zones[zone_i];
444}
445
447 const bNodeTreeZone *to_zone) const
448{
449 if (from_zone == to_zone) {
450 /* Links between zones in the same zone are always allowed. */
451 return true;
452 }
453 if (!from_zone) {
454 /* Links from the root tree can go to any zone. */
455 return true;
456 }
457 if (!to_zone) {
458 /* Links can not leave a zone and connect to a socket in the root tree. */
459 return false;
460 }
461 return from_zone->contains_zone_recursively(*to_zone);
462}
463
465 const bNodeSocket &to) const
466{
467 BLI_assert(from.in_out == SOCK_OUT);
469 const bNodeTreeZone *from_zone = this->get_zone_by_socket(from);
470 const bNodeTreeZone *to_zone = this->get_zone_by_socket(to);
471 return this->link_between_zones_is_allowed(from_zone, to_zone);
472}
473
475 const bNodeTreeZone *outer_zone, const bNodeTreeZone *inner_zone) const
476{
477 BLI_assert(this->link_between_zones_is_allowed(outer_zone, inner_zone));
478 Vector<const bNodeTreeZone *> zones_to_enter;
479 for (const bNodeTreeZone *zone = inner_zone; zone != outer_zone; zone = zone->parent_zone) {
480 zones_to_enter.append(zone);
481 }
482 std::reverse(zones_to_enter.begin(), zones_to_enter.end());
483 return zones_to_enter;
484}
485
491
493 const bNode &output_bnode) const
494{
495 tree.ensure_topology_cache();
496 for (const bNode *node : tree.nodes_by_type(this->input_idname)) {
497 if (this->get_corresponding_output_id(*node) == output_bnode.identifier) {
498 return node;
499 }
500 }
501 return nullptr;
502}
503
505 const bNode &input_bnode) const
506{
507 return tree.node_by_id(this->get_corresponding_output_id(input_bnode));
508}
509
511{
512 return const_cast<bNode *>(
513 this->get_corresponding_input(const_cast<const bNodeTree &>(tree), output_bnode));
514}
515
517{
518 return const_cast<bNode *>(
519 this->get_corresponding_output(const_cast<const bNodeTree &>(tree), input_bnode));
520}
521
523{
524 static Vector<const bNodeZoneType *> zone_types;
525 return zone_types;
526};
527
529{
530 get_zone_types_vector().append(&zone_type);
531}
532
537
539{
540 static const Vector<int> node_types = []() {
541 Vector<int> node_types;
542 for (const bNodeZoneType *zone_type : all_zone_types()) {
543 node_types.append(zone_type->input_type);
544 node_types.append(zone_type->output_type);
545 }
546 return node_types;
547 }();
548 return node_types;
549}
550
552{
553 static const Vector<int> node_types = []() {
554 Vector<int> node_types;
555 for (const bNodeZoneType *zone_type : all_zone_types()) {
556 node_types.append(zone_type->input_type);
557 }
558 return node_types;
559 }();
560 return node_types;
561}
562
564{
565 static const Vector<int> node_types = []() {
566 Vector<int> node_types;
567 for (const bNodeZoneType *zone_type : all_zone_types()) {
568 node_types.append(zone_type->output_type);
569 }
570 return node_types;
571 }();
572 return node_types;
573}
574
575const bNodeZoneType *zone_type_by_node_type(const int node_type)
576{
577 for (const bNodeZoneType *zone_type : all_zone_types()) {
578 if (ELEM(node_type, zone_type->input_type, zone_type->output_type)) {
579 return zone_type;
580 }
581 }
582 return nullptr;
583}
584
586{
587 if (!this->input_node_id) {
588 return nullptr;
589 }
590 return this->owner->tree->node_by_id(*this->input_node_id);
591}
592
594{
595 if (!this->output_node_id) {
596 return nullptr;
597 }
598 return this->owner->tree->node_by_id(*this->output_node_id);
599}
600
602{
603 Vector<const bNode *> nodes(node_ids.size());
604 for (const int i : nodes.index_range()) {
605 nodes[i] = tree.node_by_id(node_ids[i]);
606 }
607 return nodes;
608}
609
611{
612 return node_ids_to_vector(*this->owner->tree, this->child_node_ids);
613}
614
619
620std::ostream &operator<<(std::ostream &stream, const bNodeTreeZones &zones)
621{
622 for (const bNodeTreeZone *zone : zones.zones) {
623 stream << *zone;
624 if (zones.zones.last() != zone) {
625 stream << "\n";
626 }
627 }
628 return stream;
629}
630
631std::ostream &operator<<(std::ostream &stream, const bNodeTreeZone &zone)
632{
633 stream << zone.index << ": Parent index: ";
634 if (zone.parent_zone != nullptr) {
635 stream << zone.parent_zone->index;
636 }
637 else {
638 stream << "*";
639 }
640
641 stream << "; Input: " << (zone.input_node() ? zone.input_node()->name : "null");
642 stream << ", Output: " << (zone.output_node() ? zone.output_node()->name : "null");
643
644 stream << "; Border Links: {\n";
645 for (const bNodeLink *border_link : zone.border_links) {
646 stream << " " << border_link->fromnode->name << ": " << border_link->fromsock->name << " -> ";
647 stream << border_link->tonode->name << ": " << border_link->tosock->name << ";\n";
648 }
649 stream << "}.";
650 return stream;
651}
652
653} // namespace blender::bke
#define ELEM(...)
void ensure(const FunctionRef< void()> compute_cache)
void clear()
Definition BLI_map.hh:1038
bool add_overwrite(const Key &key, const Value &value)
Definition BLI_map.hh:325
bool add(const Key &key, const Value &value)
Definition BLI_map.hh:295
Value lookup_default(const Key &key, const Value &default_value) const
Definition BLI_map.hh:570
bool contains(const Key &key) const
Definition BLI_map.hh:353
ItemIterator items() const &
Definition BLI_map.hh:902
bool add(const Key &key)
Definition BLI_set.hh:248
void clear()
Definition BLI_set.hh:570
constexpr int64_t size() const
Definition BLI_span.hh:256
constexpr IndexRange index_range() const
Definition BLI_span.hh:405
constexpr bool contains(const T &value) const
Definition BLI_span.hh:281
int64_t index_of_try(const Key &key) const
IndexRange index_range() const
bool contains(const Key &key) const
Span< Key > as_span() const
void add_new(const Key &key)
int64_t size() const
void remove_and_reorder(const int64_t index)
void append(const T &value)
void extend(Span< T > array)
void append_non_duplicates(const T &value)
std::shared_ptr< bNodeTreeZones > tree_zones
std::shared_ptr< bNodeTreeZones > last_valid_zones
bool contains_zone_recursively(const bNodeTreeZone &other_zone) const
Vector< const bNode * > child_nodes() const
friend std::ostream & operator<<(std::ostream &stream, const bNodeTreeZone &zone)
std::optional< int > output_node_id
const bNode * output_node() const
Vector< const bNodeLink * > border_links
bool contains_node_recursively(const bNode &node) const
std::optional< int > input_node_id
const bNode * input_node() const
Vector< const bNodeTreeZone * > get_zones_to_enter_from_root(const bNodeTreeZone *zone) const
Vector< const bNodeTreeZone * > get_zones_to_enter(const bNodeTreeZone *outer_zone, const bNodeTreeZone *inner_zone) const
bool link_between_zones_is_allowed(const bNodeTreeZone *from_zone, const bNodeTreeZone *to_zone) const
Vector< const bNode * > nodes_outside_zones() const
Vector< bNodeTreeZone * > zones
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
friend std::ostream & operator<<(std::ostream &stream, const bNodeTreeZones &zones)
const bNodeTreeZone * get_zone_by_socket(const bNodeSocket &socket) const
bool link_between_sockets_is_allowed(const bNodeSocket &from, const bNodeSocket &to) const
const bNode * get_corresponding_input(const bNodeTree &tree, const bNode &output_bnode) const
virtual const int & get_corresponding_output_id(const bNode &input_bnode) const =0
const bNode * get_corresponding_output(const bNodeTree &tree, const bNode &input_bnode) const
bool has_common_set_bits(const BitSpanT &...args)
void foreach_1_index(const BitSpanT &data, Fn &&fn)
const bNodeZoneType * zone_type_by_node_type(const int node_type)
static void update_zone_depths(bNodeTreeZone &zone)
static std::optional< Vector< ZoneRelation > > get_direct_zone_relations(const Span< bNodeTreeZone * > all_zones, const BitGroupVector<> &depend_on_input_flag_array)
static Vector< const bNodeZoneType * > & get_zone_types_vector()
static Vector< std::unique_ptr< bNodeTreeZone > > find_zone_nodes(const bNodeTree &tree, bNodeTreeZones &owner, Map< const bNode *, bNodeTreeZone * > &r_zone_by_inout_node)
Span< int > all_zone_output_node_types()
static void update_zone_border_links(const bNodeTree &tree, bNodeTreeZones &tree_zones)
Span< const bNodeZoneType * > all_zone_types()
static Vector< const bNode * > node_ids_to_vector(const bNodeTree &tree, const Vector< int > &node_ids)
Span< int > all_zone_node_types()
void register_node_zone_type(const bNodeZoneType &zone_type)
Span< int > all_zone_input_node_types()
static std::unique_ptr< bNodeTreeZones > discover_tree_zones(const bNodeTree &tree)
const bNodeTreeZones * get_tree_zones(const bNodeTree &tree)
static bool update_zone_per_node(const Span< const bNode * > all_nodes, const Span< bNodeTreeZone * > all_zones, const BitGroupVector<> &depend_on_input_flag_array, const Map< const bNode *, bNodeTreeZone * > &zone_by_inout_node, Map< int, int > &r_zone_by_node_id, Vector< int > &r_node_outside_zones)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
Definition BKE_text.h:91
signed int int32_t
Definition BKE_text.h:78
constexpr uint64_t get_default_hash(const T &v, const Args &...args)
Definition BLI_hash.hh:252
eNodeSocketInOut in_out
bke::bNodeTreeRuntime * runtime
friend bool operator==(const ZoneRelation &a, const ZoneRelation &b)=default