primitives_nodes_ui.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import bpy
  2. from bpy.types import Node
  3. from .base_definitions import MantisUINode
  4. def TellClasses():
  5. return [
  6. GeometryCirclePrimitive,
  7. GeometryLattice,
  8. ]
  9. def default_traverse(self,socket):
  10. return None
  11. class GeometryCirclePrimitive(Node, MantisUINode):
  12. '''A node representing a circle primitive'''
  13. bl_idname = 'GeometryCirclePrimitive'
  14. bl_label = "Circle Primitive"
  15. bl_icon = 'NODE'
  16. initialized : bpy.props.BoolProperty(default = False)
  17. mantis_node_class_name="CirclePrimitive"
  18. def init(self, context):
  19. self.inputs.new('StringSocket', "Name")
  20. self.inputs.new('FloatPositiveSocket', "Radius")
  21. self.inputs.new('IntSocket', "Number of Points")
  22. self.outputs.new('GeometrySocket', "Circle")
  23. self.initialized = True
  24. from .primitives_sockets import LatticeSockets
  25. class GeometryLattice(Node, MantisUINode):
  26. '''A node representing a lattice geometry'''
  27. bl_idname = "GeometryLattice"
  28. bl_label = "Lattice"
  29. bl_icon = "NODE"
  30. initialized : bpy.props.BoolProperty(default = False)
  31. mantis_node_class_name=bl_idname
  32. def init(self, context):
  33. self.init_sockets(LatticeSockets)
  34. self.initialized = True
  35. for cls in TellClasses():
  36. cls.mantis_node_library='.primitives_nodes'
  37. cls.set_mantis_class()