فهرست منبع

cleanup: remove "text-only" field from socket definitions

also remove unnecessary icon assignment in node init for some socket types.
Joseph Brandenburg 10 ماه پیش
والد
کامیت
eebbd591a6
2فایلهای تغییر یافته به همراه10 افزوده شده و 20 حذف شده
  1. 9 15
      nodes_generic.py
  2. 1 5
      socket_definitions.py

+ 9 - 15
nodes_generic.py

@@ -258,7 +258,6 @@ class UtilityMatrixFromCurve(Node, MantisUINode):
     
     def init(self, context):
         curv = self.inputs.new("EnumCurveSocket", "Curve")
-        curv.icon = "OUTLINER_OB_CURVE"
         self.inputs.new('IntSocket', 'Total Divisions')
         self.inputs.new('IntSocket', 'Matrix Index')
         self.outputs.new("MatrixSocket", "Matrix")
@@ -276,7 +275,6 @@ class UtilityPointFromCurve(Node, MantisUINode):
     
     def init(self, context):
         curv = self.inputs.new("EnumCurveSocket", "Curve")
-        curv.icon = "OUTLINER_OB_CURVE"
         self.inputs.new('FloatFactorSocket', 'Factor')
         self.outputs.new("VectorSocket", "Point")
         self.initialized = True
@@ -312,8 +310,6 @@ class UtilityMetaRigNode(Node, MantisUINode):
     def init(self, context):
         armt = self.inputs.new("EnumMetaRigSocket", "Meta-Armature")
         bone = self.inputs.new("EnumMetaBoneSocket", "Meta-Bone")
-        armt.icon = "OUTLINER_OB_ARMATURE"
-        bone.icon = "BONE_DATA"
         bone.hide=True
         self.outputs.new("MatrixSocket", "Matrix")
         self.initialized = True
@@ -343,19 +339,17 @@ class UtilityBonePropertiesNode(Node, MantisUINode):
     mantis_node_class_name=bl_idname
     
     def init(self, context):
-        self.outputs.new("ParameterStringSocket", "matrix")
-        self.outputs.new("ParameterStringSocket", "matrix_local")
-        self.outputs.new("ParameterStringSocket", "matrix_basis")
-        self.outputs.new("ParameterStringSocket", "head")
-        self.outputs.new("ParameterStringSocket", "tail")
-        self.outputs.new("ParameterStringSocket", "length")
-        self.outputs.new("ParameterStringSocket", "rotation")
-        self.outputs.new("ParameterStringSocket", "location")
-        self.outputs.new("ParameterStringSocket", "scale")
+        self.outputs.new("StringSocket", "matrix")
+        self.outputs.new("StringSocket", "matrix_local")
+        self.outputs.new("StringSocket", "matrix_basis")
+        self.outputs.new("StringSocket", "head")
+        self.outputs.new("StringSocket", "tail")
+        self.outputs.new("StringSocket", "length")
+        self.outputs.new("StringSocket", "rotation")
+        self.outputs.new("StringSocket", "location")
+        self.outputs.new("StringSocket", "scale")
         self.initialized = True
         
-        for o in self.outputs:
-            o.text_only = True
 
 class UtilityDriverVariableNode(Node, MantisUINode):
     """Creates a variable for use in a driver."""

+ 1 - 5
socket_definitions.py

@@ -336,10 +336,8 @@ def ChooseDraw(self, context, layout, node, text, icon = "NONE", use_enum=True,
     elif hasattr(self, "display_text") and self.display_text and self.is_linked:
             layout.label(text=self.display_text)
     else:
-        if ( (hasattr(self, "text_only")) and (getattr(self, "text_only") ) ):
-            layout.label(text=text)
         # ENUM VALUES (this is a HACK, fix it later)
-        elif ('Enum' in self.bl_idname) and (use_enum):
+        if ('Enum' in self.bl_idname) and (use_enum):
             if not (self.is_output or self.is_linked):
                 layout.prop_tabs_enum(self, "default_value",)
             else:
@@ -747,7 +745,6 @@ class StringSocket(bpy.types.NodeSocketString, MantisSocket):
     bl_idname = 'StringSocket'
     bl_label = "String"
     default_value : bpy.props.StringProperty(default = "", update = update_socket,)
-    # text_only : bpy.props.BoolProperty(default=False)
     color_simple = cString
     color : bpy.props.FloatVectorProperty(default=cString, size=4)
     icon : bpy.props.StringProperty(default = "NONE",)
@@ -957,7 +954,6 @@ class ParameterStringSocket(MantisSocket):
     
     color : bpy.props.FloatVectorProperty(default=cString, size=4)
     input : bpy.props.BoolProperty(default =False,)
-    text_only : bpy.props.BoolProperty(default=False)
     #custom properties:
     description:bpy.props.StringProperty(default = "")
     def init(self):