Browse Source

Cleanup: Consistent names for mantis and ui node files

Joseph Brandenburg 3 months ago
parent
commit
a31b53d3f0

+ 14 - 14
__init__.py

@@ -2,14 +2,14 @@ from . import ( ops_nodegroup,
                 ops_ui, 
                 base_definitions,
                 socket_definitions,
-                link_definitions,
-                xForm_definitions,
+                link_nodes_ui,
+                xForm_nodes_ui,
                 misc_nodes_ui,
-                primitives_definitions,
-                deformer_definitions,
-                math_definitions,
+                primitives_nodes_ui,
+                deformer_nodes_ui,
+                math_nodes_ui,
                 i_o,
-                schema_definitions,
+                schema_nodes_ui,
                 menu_classes,
               )
 from .ops_generate_tree import GenerateMantisTree
@@ -21,17 +21,17 @@ MANTIS_VERSION_MINOR=12
 MANTIS_VERSION_SUB=5
 
 classLists = [module.TellClasses() for module in [
- link_definitions,
- xForm_definitions,
+ link_nodes_ui,
+ xForm_nodes_ui,
  misc_nodes_ui,
  socket_definitions,
  ops_nodegroup,
  ops_ui,
- primitives_definitions,
- deformer_definitions,
- math_definitions,
+ primitives_nodes_ui,
+ deformer_nodes_ui,
+ math_nodes_ui,
  i_o,
- schema_definitions,
+ schema_nodes_ui,
  base_definitions,
  menu_classes,
 ]]
@@ -106,7 +106,7 @@ link_relationship_category = [
         NodeItem("LinkInheritConstraint"),
         NodeItem("LinkArmature"),
     ]
-deformer_category=[NodeItem(cls.bl_idname) for cls in deformer_definitions.TellClasses()]
+deformer_category=[NodeItem(cls.bl_idname) for cls in deformer_nodes_ui.TellClasses()]
 xForm_category = [
         NodeItem("xFormGeometryObject"),
         NodeItem("xFormBoneNode"),
@@ -197,7 +197,7 @@ node_categories = [
     MantisGroupCategory('GROUP_INTERFACE', "Group In/Out", items=group_interface_category),
 ]
 
-schema_category=[NodeItem(cls.bl_idname) for cls in schema_definitions.TellClasses()]
+schema_category=[NodeItem(cls.bl_idname) for cls in schema_nodes_ui.TellClasses()]
 schema_categories = [
     SchemaNodeCategory('SCHEMA_SCHEMA', "Schema", items=schema_category),
 ]

+ 4 - 4
base_definitions.py

@@ -279,26 +279,26 @@ class MantisUINode:
                 socket.display_shape = 'SQUARE_DOT'
             
 class SchemaUINode(MantisUINode):
-    mantis_node_library='.schema_containers'
+    mantis_node_library='.schema_nodes'
     is_updating:BoolProperty(default=False)
     @classmethod
     def poll(cls, ntree):
         return (ntree.bl_idname in ['SchemaTree'])
 
 class LinkNode(MantisUINode):
-    mantis_node_library='.link_containers'
+    mantis_node_library='.link_nodes'
     @classmethod
     def poll(cls, ntree):
         return (ntree.bl_idname in ['MantisTree', 'SchemaTree'])
     
 class xFormNode(MantisUINode):
-    mantis_node_library='.xForm_containers'
+    mantis_node_library='.xForm_nodes'
     @classmethod
     def poll(cls, ntree):
         return (ntree.bl_idname in ['MantisTree', 'SchemaTree'])
 
 class DeformerNode(MantisUINode):
-    mantis_node_library='.deformer_containers'
+    mantis_node_library='.deformer_nodes'
     @classmethod
     def poll(cls, ntree):
         return (ntree.bl_idname in ['MantisTree', 'SchemaTree'])

+ 3 - 3
deformer_containers.py → deformer_nodes.py

@@ -1,5 +1,5 @@
 from .node_container_common import *
-from .xForm_containers import xFormGeometryObject, xFormObjectInstance
+from .xForm_nodes import xFormGeometryObject, xFormObjectInstance
 from .misc_nodes import InputExistingGeometryObject
 from .base_definitions import MantisNode, MantisSocketTemplate
 from .utilities import (prRed, prGreen, prPurple, prWhite, prOrange,
@@ -111,10 +111,10 @@ class DeformerArmature(MantisDeformerNode):
         else:
             trace_xForm_back(self, socket)
     
-    # DUPLICATED FROM xForm_containers::xFormBone 
+    # DUPLICATED FROM xForm_nodes::xFormBone 
     # DEDUP HACK HACK HACK HACK HACK
     def bGetParentArmature(self):
-        from .xForm_containers import xFormArmature
+        from .xForm_nodes import xFormArmature
         from .misc_nodes import InputExistingGeometryObject
         from bpy.types import Object
         if (trace := trace_single_line(self, "Armature Object")[0] ) :

+ 0 - 0
deformer_definitions.py → deformer_nodes_ui.py


+ 0 - 0
link_containers.py → link_nodes.py


+ 0 - 0
link_definitions.py → link_nodes_ui.py


+ 0 - 0
math_containers.py → math_nodes.py


+ 1 - 1
math_definitions.py → math_nodes_ui.py

@@ -119,5 +119,5 @@ class MathStaticVectorNode(Node, MantisUINode):
 
 # Set up the class property that ties the UI classes to the Mantis classes.
 for cls in TellClasses():
-    cls.mantis_node_library='.math_containers'
+    cls.mantis_node_library='.math_nodes'
     cls.set_mantis_class()

+ 1 - 1
misc_nodes.py

@@ -1,6 +1,6 @@
 from .node_container_common import *
 from .base_definitions import MantisNode, NodeSocket, FLOAT_EPSILON
-from .xForm_containers import xFormArmature, xFormBone
+from .xForm_nodes import xFormArmature, xFormBone
 from .misc_nodes_socket_templates import *
 from math import pi, tau
 

+ 1 - 1
ops_generate_tree.py

@@ -231,7 +231,7 @@ def fill_parameters(node, c, context):
         node.inputs["XZ Scale Mode"].default_value = c.xz_scale_mode
     elif (c.type == 'TRANSFORM'):
         # I can't be arsed to do all this work..
-        from .link_containers import transformation_props_sockets as props
+        from .link_nodes import transformation_props_sockets as props
         for prop, (sock_name, _unused) in props.items():
             if "from" in prop:
                 if prop in ["map_from"] or "to" in prop:

+ 0 - 0
primitives_containers.py → primitives_nodes.py


+ 1 - 1
primitives_definitions.py → primitives_nodes_ui.py

@@ -42,5 +42,5 @@ class GeometryLattice(Node, MantisUINode):
 
 
 for cls in TellClasses():
-    cls.mantis_node_library='.primitives_containers'
+    cls.mantis_node_library='.primitives_nodes'
     cls.set_mantis_class()

+ 1 - 1
readtree.py

@@ -49,7 +49,7 @@ def reroute_links_grpout(nc, all_nc):
 
 # FIXME I don't think these signatures are unique.
 def insert_lazy_parents(nc):
-    from .link_containers import LinkInherit
+    from .link_nodes import LinkInherit
     from .base_definitions import NodeLink
     inherit_nc = None
     if nc.inputs["Relationship"].is_connected:

+ 0 - 0
schema_containers.py → schema_nodes.py


+ 0 - 0
schema_definitions.py → schema_nodes_ui.py


+ 5 - 5
schema_solve.py

@@ -80,12 +80,12 @@ class SchemaSolver:
                 mantis_node.fill_parameters(ui_node)
             # HACK to make Group Nodes work
             if ui_node.bl_idname == "NodeGroupInput":
-                from .schema_containers import SchemaConstInput
+                from .schema_nodes import SchemaConstInput
                 mantis_node = SchemaConstInput(signature=signature, base_tree=self.node.base_tree, parent_schema_node=self.node)
                 self.schema_nodes[signature] = mantis_node
                 mantis_node.fill_parameters(ui_node)
             if ui_node.bl_idname == "NodeGroupOutput":
-                from .schema_containers import SchemaConstOutput
+                from .schema_nodes import SchemaConstOutput
                 mantis_node = SchemaConstOutput(signature=signature, base_tree=self.node.base_tree, parent_schema_node=self.node)
                 self.schema_nodes[signature] = mantis_node
                 mantis_node.fill_parameters(ui_node)
@@ -430,7 +430,7 @@ class SchemaSolver:
             if not from_node:
                 from_node = self.schema_nodes[(*self.tree_path_names, from_ui_node.bl_idname)]
             to_node = outgoing.to_node
-            from .schema_containers import SchemaIndex
+            from .schema_nodes import SchemaIndex
             if isinstance(from_node, SchemaIndex):
                 signature = ("MANTIS_AUTOGENERATED", *self.tree_path_names[1:-1], self.index_str(),
                              ui_link.from_socket.name, ui_link.from_socket.identifier)
@@ -542,7 +542,7 @@ class SchemaSolver:
              This function also adds to held_links to pass data between iterations.
         """
 
-        from .schema_definitions import (SchemaIndex,
+        from .schema_nodes_ui import (SchemaIndex,
                                         SchemaArrayInput,
                                         SchemaArrayInputGet,
                                         SchemaArrayInputAll,
@@ -730,7 +730,7 @@ class SchemaSolver:
 
 
     def finalize(self, frame_nc):
-        from .schema_definitions import (SchemaOutgoingConnection,)
+        from .schema_nodes_ui import (SchemaOutgoingConnection,)
         for i in range(len(self.held_links)):
             link = self.held_links.pop()
             to_np = link.to_socket.node; from_np = link.from_socket.node

+ 3 - 3
utilities.py

@@ -609,10 +609,10 @@ def project_point_to_plane(point, origin, normal):
 # This is really, really stupid way to do this
 def gen_nc_input_for_data(socket):
     # Class List #TODO deduplicate
-    from . import xForm_containers, link_containers, misc_nodes, primitives_containers, deformer_containers, math_containers, schema_containers
+    from . import xForm_nodes, link_nodes, misc_nodes, primitives_nodes, deformer_nodes, math_nodes, schema_nodes
     from .internal_containers import NoOpNode
     classes = {}
-    for module in [xForm_containers, link_containers, misc_nodes, primitives_containers, deformer_containers, math_containers, schema_containers]:
+    for module in [xForm_nodes, link_nodes, misc_nodes, primitives_nodes, deformer_nodes, math_nodes, schema_nodes]:
         for cls in module.TellClasses():
             classes[cls.__name__] = cls
     #
@@ -766,7 +766,7 @@ def bind_extracted_spline_to_curve(new_ob, curve):
     # now, weirdly enough - we can't use parenting very easily because Blender
     # defines the parent on a curve relative to the evaluated path animation
     # Setting the inverse matrix is too much work. Use Copy Transforms instead.
-    from .xForm_containers import reset_object_data
+    from .xForm_nodes import reset_object_data
     reset_object_data(new_ob)
     c = new_ob.constraints.new("COPY_TRANSFORMS"); c.target=curve
     new_ob.parent=curve

+ 1 - 1
xForm_containers.py → xForm_nodes.py

@@ -712,7 +712,7 @@ class xFormGeometryObject(xFormNode):
         # NOW: find out if we need to duplicate the object data.
         dupe_data=False
         node_line = trace_single_line(self, "Deformer")[0]
-        from .deformer_containers import DeformerHook
+        from .deformer_nodes import DeformerHook
         for deformer in node_line:
             if isinstance(deformer, DeformerHook) and  \
                deformer.evaluate_input("Affect Curve Radius") == True and \

+ 1 - 1
xForm_definitions.py → xForm_nodes_ui.py

@@ -343,7 +343,7 @@ class xFormObjectInstance(Node, xFormNode):
             if nc:
                 self.inputs['Name'].display_text = nc.evaluate_input("Name")
 
-from .xForm_containers import xFormCurvePinSockets
+from .xForm_nodes import xFormCurvePinSockets
 class xFormCurvePin(Node, xFormNode):
     """"A node representing a curve pin"""
     bl_idname = "xFormCurvePin"