Ver Fonte

Fix: Mantis fails to execute Array Get nodes with Drivers

This special case was causing the array get nodes to be missed by
Mantis because they had no hierarchy connections to the tree
since the Driver connections were always detected as non-hierarchy
SO I added a special case to ensure the driver edges are
always hierarchy connections when going into an Array.

Tested with Array Get and Array Length nodes.
Joseph Brandenburg há 1 semana atrás
pai
commit
a4d2fd6d95
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      base_definitions.py

+ 8 - 0
base_definitions.py

@@ -990,6 +990,14 @@ class DummyLink:
 def detect_hierarchy_link(from_node, from_socket, to_node, to_socket,):
     if to_node.node_type in ['DUMMY_SCHEMA', 'SCHEMA']:
         return False #TODO: find out if filtering SCHEMA types is wise
+    if from_socket in from_name_filter and to_socket in ["Array"]:
+        # SPECIAL CASE: arrays essentially extend the non-hierarchy edge
+        #       so if the connection to the array isn't hierarchy, the array node
+        #       in the middle gets disconnected and never executes.
+        #       SO we need to make all the edges until the end hierarchy.
+        #       TODO: test the graph for cycles and tag the "last" edge in the cycle
+        #             is the general solution but that is toooooo slow in Python
+        return True
     if (from_socket in from_name_filter) or (to_socket in to_name_filter):
         return False
     # if from_node.__class__.__name__ in ["UtilityCombineVector", "UtilityCombineThreeBool"]: