Browse Source

cleanup clarity/consistency in __init__

Joseph Brandenburg 4 weeks ago
parent
commit
6b48cb8702
2 changed files with 12 additions and 12 deletions
  1. 2 2
      __init__.py
  2. 10 10
      socket_definitions.py

+ 2 - 2
__init__.py

@@ -301,10 +301,10 @@ def do_version_update(node_tree):
         if hasattr(node, 'is_updating'):
             node.is_updating = True
     # start by doing tree versioning tasks
-    for affected_bl_idnames, task, arguments_needed in versioning_tasks:
+    for affected_bl_idnames, task, required_kwargs in versioning_tasks:
         if node_tree.bl_idname not in affected_bl_idnames: continue # this is a node task.
         arguments = {}
-        if 'tree' in arguments_needed:
+        if 'tree' in required_kwargs:
             arguments['tree']=node_tree
         task(**arguments)
     # run the updates that have no prerequisites

+ 10 - 10
socket_definitions.py

@@ -29,16 +29,16 @@ if bpy_version == (4,5,0): # THere is a bug that requires the socket type to inh
     parent_classes = (NodeSocketGeometry, NodeSocket)
 
 class MantisSocket(parent_classes):
-        is_valid_interface_type=False
+    is_valid_interface_type=False
     enum_display_type="TABS" # TABS or DROPDOWN
-        category : bpy.props.StringProperty()
-        @property
-        def interface_type(self):
-            # this is stupid but it is the fastest way to implement this
-            # TODO: refactor this, it should be a class property
-            if hasattr(self, "color"):
-                return map_color_to_socket_type(self.color)
-            return map_color_to_socket_type(self.color_simple)
+    category : bpy.props.StringProperty()
+    @property
+    def interface_type(self):
+        # this is stupid but it is the fastest way to implement this
+        # TODO: refactor this, it should be a class property
+        if hasattr(self, "color"):
+            return map_color_to_socket_type(self.color)
+        return map_color_to_socket_type(self.color_simple)
     def draw(self, context, layout, node, text):
         ChooseDraw(self, context, layout, node, text)
     def draw_color(self, context, node):
@@ -624,7 +624,7 @@ def ChooseDraw(self, context, layout, node, text, icon = "NONE", use_enum=True,
                 if self.__class__.enum_display_type == 'DROPDOWN':
                     layout.prop(self, "default_value",)
                 else:
-                layout.prop_tabs_enum(self, "default_value",)
+                    layout.prop_tabs_enum(self, "default_value",)
             else:
                 layout.prop(text=text)
         # for OUTPUT sockets that take INPUT (confusing name!)