internal_containers.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. from .node_container_common import *
  2. from bpy.types import Node
  3. from .base_definitions import MantisNode
  4. from uuid import uuid4
  5. class DummyNode:
  6. def __init__(self, signature, base_tree, prototype = None, natural_signature=None):
  7. self.signature = signature
  8. self.base_tree = base_tree
  9. self.prototype = prototype
  10. self.inputs={}
  11. self.outputs={}
  12. self.parameters = {}
  13. self.node_type = 'DUMMY'
  14. self.prepared = True
  15. if prototype.bl_idname in ["MantisSchemaGroup"]:
  16. self.node_type = 'DUMMY_SCHEMA'
  17. self.prepared = False
  18. self.uuid = uuid4()
  19. if prototype:
  20. for sock in prototype.inputs:
  21. if sock.identifier == "__extend__" or sock.name == "__extend__":
  22. continue
  23. self.inputs[sock.identifier] = NodeSocket(is_input = True, name = sock.identifier, node = self)
  24. for sock in prototype.outputs:
  25. if sock.identifier == "__extend__" or sock.name == "__extend__":
  26. continue
  27. self.outputs[sock.identifier] = NodeSocket(is_input = False, name = sock.identifier, node = self)
  28. self.parameters[sock.identifier]=None
  29. #HACK
  30. if natural_signature:
  31. self.natural_signature=natural_signature
  32. #HACK
  33. self.hierarchy_connections = []
  34. self.connections = []
  35. self.hierarchy_dependencies = []
  36. self.dependencies = []
  37. self.executed = False
  38. #
  39. #
  40. self.pre_pass_done = False
  41. self.execute_pass_done = False
  42. setup_container(DummyNode)