internal_containers.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from .node_container_common import *
  2. from bpy.types import Node
  3. from .base_definitions import MantisNode
  4. class DummyNode:
  5. def __init__(self, signature, base_tree, prototype = None):
  6. self.signature = signature
  7. self.base_tree = base_tree
  8. self.prototype = prototype
  9. self.inputs={}
  10. self.outputs={}
  11. self.parameters = {}
  12. self.node_type = 'DUMMY'
  13. if prototype:
  14. for sock in prototype.inputs:
  15. if sock.name == "__extend__":
  16. continue
  17. self.inputs[sock.identifier] = NodeSocket(is_input = True, name = sock.identifier, node = self)
  18. for sock in prototype.outputs:
  19. if sock.name == "__extend__":
  20. continue
  21. self.outputs[sock.identifier] = NodeSocket(is_input = False, name = sock.identifier, node = self)
  22. self.parameters[sock.identifier]=None
  23. def evaluate_input(self, input_name):
  24. pass
  25. # return evaluate_input(self, input_name)
  26. def bExecute(self, bContext = None,):
  27. pass
  28. def bFinalize(self, bContext = None,):
  29. pass
  30. def __repr__(self):
  31. return self.signature.__repr__()
  32. def fill_parameters(self,):
  33. pass# fill_parameters(self)
  34. # I don't think I am using this but it doesn't hurt
  35. # a class for duplicating an existing node for e.g. temporary
  36. # traces
  37. class DupeNode:
  38. def __init__(self, signature, base_tree):
  39. self.signature = signature
  40. self.base_tree = base_tree
  41. self.prototype = prototype
  42. self.inputs={}
  43. self.outputs={}
  44. self.parameters = {}
  45. self.node_type = 'DUMMY'
  46. def evaluate_input(self, input_name):
  47. pass
  48. # return evaluate_input(self, input_name)
  49. def bExecute(self, bContext = None,):
  50. pass
  51. def bFinalize(self, bContext = None,):
  52. pass
  53. def __repr__(self):
  54. return self.signature.__repr__()
  55. def fill_parameters(self,):
  56. fill_parameters(self)
  57. # I don't think I am using this but it doesn't hurt