Преглед изворни кода

v0.11.22 fix color pallet mantis node

the mantis node was not using unique names
chaos and failure was the result
Joseph Brandenburg пре 11 месеци
родитељ
комит
fa475423df
4 измењених фајлова са 11 додато и 8 уклоњено
  1. 1 1
      __init__.py
  2. 1 1
      blender_manifest.toml
  3. 1 4
      misc_nodes.py
  4. 8 2
      ops_ui.py

+ 1 - 1
__init__.py

@@ -18,7 +18,7 @@ from .utilities import prRed
 
 
 MANTIS_VERSION_MAJOR=0
 MANTIS_VERSION_MAJOR=0
 MANTIS_VERSION_MINOR=11
 MANTIS_VERSION_MINOR=11
-MANTIS_VERSION_SUB=21
+MANTIS_VERSION_SUB=22
 
 
 classLists = [module.TellClasses() for module in [
 classLists = [module.TellClasses() for module in [
  link_definitions,
  link_definitions,

+ 1 - 1
blender_manifest.toml

@@ -3,7 +3,7 @@ schema_version = "1.0.0"
 # Example of manifest file for a Blender extension
 # Example of manifest file for a Blender extension
 # Change the values according to your extension
 # Change the values according to your extension
 id = "mantis"
 id = "mantis"
-version = "0.11.21"
+version = "0.11.22"
 name = "Mantis"
 name = "Mantis"
 tagline = "Mantis is a rigging nodes toolkit"
 tagline = "Mantis is a rigging nodes toolkit"
 maintainer = "Nodespaghetti <josephbburg@protonmail.com>"
 maintainer = "Nodespaghetti <josephbburg@protonmail.com>"

+ 1 - 4
misc_nodes.py

@@ -320,8 +320,7 @@ class InputThemeBoneColorSets(SimpleInputNode):
 class InputColorSetPallete(SimpleInputNode):
 class InputColorSetPallete(SimpleInputNode):
     '''A node representing the theme's colors'''
     '''A node representing the theme's colors'''
     def __init__(self, signature, base_tree):
     def __init__(self, signature, base_tree):
-        super().__init__(signature, base_tree, MatrixFromCurveSockets)
-        self.init_parameters()
+        super().__init__(signature, base_tree)
         self.node_type = "UTILITY"
         self.node_type = "UTILITY"
         # we'll go ahead and fill them here
         # we'll go ahead and fill them here
         from .utilities import get_node_prototype
         from .utilities import get_node_prototype
@@ -334,8 +333,6 @@ class InputColorSetPallete(SimpleInputNode):
         self.init_parameters()
         self.init_parameters()
         for o in ui_node.outputs:
         for o in ui_node.outputs:
             self.parameters[o.name] = o.default_value
             self.parameters[o.name] = o.default_value
-            prRed(o.name)
-            prPurple(o.default_value)
 
 
 class UtilityMatrixFromCurve(MantisNode):
 class UtilityMatrixFromCurve(MantisNode):
     '''Get a matrix from a curve'''
     '''Get a matrix from a curve'''

+ 8 - 2
ops_ui.py

@@ -29,8 +29,14 @@ class ColorPalleteAddSocket(Operator):
     
     
     def execute(self, context):
     def execute(self, context):
         n = bpy.data.node_groups[self.tree_invoked].nodes[self.node_invoked]
         n = bpy.data.node_groups[self.tree_invoked].nodes[self.node_invoked]
-        # the name doesn't matter, will probably be Color Set.001 or something instead
-        n.outputs.new("ColorSetSocket", "Color Set")
+        #name them uniquely
+        number=0
+        for o in n.outputs:
+            if int(o.name[-3:]) == number:
+                number = int(o.name[-3:]) + 1
+            else: # my intention is to use the first number that isn't used
+                break # so break here because we have reached the end or a 'gap'
+        n.outputs.new("ColorSetSocket", "Color Set."+str(number).zfill(3))
         return {'FINISHED'}
         return {'FINISHED'}
 
 
 class ColorPalleteRemoveSocket(Operator):
 class ColorPalleteRemoveSocket(Operator):