| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603 | import bpyfrom bpy.types import NodeSocket, NodeSocketStandardfrom mantis.utilities import (prRed, prGreen, prPurple, prWhite,                              prOrange,                              wrapRed, wrapGreen, wrapPurple, wrapWhite,                              wrapOrange,)transform_spaces = (('WORLD', "World", "World Space"),                    ('LOCAL', "Local", "Local Space"),                    ('POSE', "Pose", "Pose Space"),                    # ('CUSTOM', "Custom", "Custom Space")                    ('LOCAL_WITH_PARENT', "Local (With Parent)", "Local Space"),)                                        # ('TRANSFORM', "Pose", "Pose Space"),)                    transform_spaces_bone_object = (('WORLD', "World", "World Space"),                                ('LOCAL', "Local", "Local Space"),                                ('POSE', "Pose", "Pose Space"),)                                # ('CUSTOM', "Custom", "Custom Space")transform_spaces_object = (('WORLD', "World", "World Space"),                           ('LOCAL', "Local", "Local Space"),)                           # ('CUSTOM', "Custom", "Custom Space")enumRotationOrder =(('AUTO', 'Auto', 'Auto'),                    ('XYZ', "XYZ", "XYZ"),                    ('XZY', "XZY", "XZY"),                    ('ZXY', "ZXY", "ZXY"),                    ('ZYX', "ZYX", "ZYX"),                    ('YXZ', "YXZ", "YXZ"),                    ('YZX', "YZX", "YZX"),                    ('QUATERNION', "Quaternion", "Quaternion"),                    ('AXIS_ANGLE', "Axis Angle", "Axis Angle"),)# node socket colors:cFloat          = (0.631373, 0.631373, 0.631373, 1.000000)cColor          = (0.780392, 0.780392, 0.160784, 1.000000)cVector         = (0.388235, 0.388235, 0.780392, 1.000000)cShader         = (0.388235, 0.780392, 0.388235, 1.000000)cInt            = (0.058824, 0.521569, 0.149020, 1.000000)cString         = (0.388235, 0.388235, 0.388235, 1.000000)# cBool           = (0.698039, 0.650980, 0.188235, 1.000000)cParameter      = (0.48, 0.24, 0.24, 1.0)cDriver         = (0.88, 0.11, 0.88, 1.0)cDriverVariable = (0.66, 0.33, 0.04, 1.0)cFCurve         = (0.77, 0.77, 0.11, 1.0)cKeyframe       = (0.06, 0.22, 0.88, 1.0)cEnable         = (0.92, 0.92, 0.92, 1.0)cLayerMask      = (0.82, 0.82, 0.82, 1.0)cDeformer       = (0.05, 0.08, 0.45, 1.0)# custom colors:cIK             = (0.596078, 0.596078, 0.364706, 1.000000) #because it's yellow in BlendercRelationship   = (0.352941, 0.584314, 0.431373, 1.000000) #constraint colorcMatrix         = (0.0, 1.0, 0.75, 1)cxForm          = (0.843137, 0.592157, 0.388235, 1.000000) #could even fetch the theme colors...cTransformSpace = (1.0, 0.4, 0.216, 1.0)cBool           = (0.1, 0.1, 0.1, 1.0)cBool3          = (0.35, 0.25, 0.18, 1.0)cRotationOrder  = (0.0, 0.8, 0.0, 1.0)cQuaternion     = (0.85, 0.25, 0.18, 1.0)#cGeometry          = (0.000000, 0.672443, 0.366253, 1.000000)# think about making colors that are representative of the data's purpose:   # location   # rotation   # scale# OR make all of it a reference to the type of data within?# Hybrid approach: Make same-data, similar purpose have similar colors.def TellClasses():    return [ #MantisSocket,             #DefaultSocket,             #InputSocket,             MatrixSocket,             xFormSocket,             xFormMultiSocket,             RelationshipSocket,             DeformerSocket,             GeometrySocket,             GenericRotationSocket,             EnableSocket,             HideSocket,            #  InverseKinematicsSocket,             DriverSocket,             DriverVariableSocket,             FCurveSocket,             KeyframeSocket,             LayerMaskSocket,             LayerMaskInputSocket,                          xFormParameterSocket,             ParameterBoolSocket,             ParameterIntSocket,             ParameterFloatSocket,             ParameterVectorSocket,             ParameterStringSocket,                          TransformSpaceSocket,             BooleanSocket,             BooleanThreeTupleSocket,             RotationOrderSocket,             QuaternionSocket,             QuaternionSocketAA,             IntSocket,             StringSocket,             EnumMetaRigSocket,             EnumMetaBoneSocket,             BoolUpdateParentNode,             LabelSocket,             IKChainLengthSocket,             EnumInheritScale,             EnumRotationMix,             EnumRotationMixCopyTransforms,             EnumMaintainVolumeStretchTo,             EnumRotationStretchTo,             EnumTrackAxis,             EnumUpAxis,             EnumLockAxis,             EnumLimitMode,             EnumYScaleMode,             EnumXZScaleMode,             EnumTransformationMap,             EnumTransformationRotationMode,             EnumTransformationRotationOrder,             EnumTransformationTranslationMixMode,             EnumTransformationRotationMixMode,             EnumTransformationScaleMixMode,             EnumTransformationAxes,             # Deformers             EnumSkinning,             #             FloatSocket,             FloatPositiveSocket,             FloatFactorSocket,             FloatAngleSocket,             VectorSocket,             VectorEulerSocket,             VectorTranslationSocket,             VectorScaleSocket,             # Drivers                          EnumDriverVariableType,             EnumDriverVariableEvaluationSpace,             EnumDriverRotationMode,             EnumDriverType,]def Tell_bl_idnames():    return [cls.bl_idname for cls in TellClasses()]# Was setting color like this:# color : bpy.props.FloatVectorProperty(size = 4, default = cFCurve,)# but this didn't work when Blender automatically generated interface classes?# so changed it to color = cVariable# but for color-changing sockets, if I make them, this won' work? Maybe?## I actually think I was wrong about all of that lol# TODO change it back, dingus#########################################################################  Update Callbacks########################################################################def default_update(socket, context, do_execute=True):    context = bpy.context    if not context.space_data:        return    if not hasattr(context.space_data, "path"):        return    node_tree = context.space_data.path[0].node_tree    if node_tree.do_live_update:        # I don't know how the tree can be valid at 0 nodes but doesn't hurt        #  to force it if this somehow happens.        if ((node_tree.tree_valid == False or len(node_tree.parsed_tree) == 0)             or socket.node.bl_idname in ["MantisNodeGroup"]):            # prGreen("Forcing Update From Socket Change.")            node_tree.update_tree(context)        elif (node_tree.tree_valid == True):            # prGreen("Partial Update From Socket Change.")            # We don't have to update the whole thing, just the socket            from mantis.utilities import tree_from_nc            for nc in node_tree.parsed_tree.values():                try:                    if (tree_from_nc(nc.signature, nc.base_tree) == socket.node.id_data):                        if socket.node.name in nc.signature:                            getstring = socket.name                            if (getstring not in nc.parameters.keys()):                                prRed("Socket update failed for %s" % socket.name)                            else:                                nc.parameters[getstring] = socket.default_value                except AttributeError as e:                    prWhite(nc)                    prWhite(nc.inputs)                    raise e            # Now update the tree display:            node_tree.display_update(context)        if node_tree.do_live_update:            try:                node_tree.execute_tree(context)            except Exception as e:                prRed("Automatic Tree Execution failed because of %s" % e)def update_socket(self, context,):    default_update(self,context)                            def update_mute_socket(self, context):    self.node.mute = not self.default_value    default_update(self,context)    def update_hide_socket(self, context):    self.node.mute = self.default_value    default_update(self,context)def update_parent_node(self, context):    default_update(self,context)    if hasattr(self.node, "display_update"):        self.node.display_update(context)    def ik_chain_length_update_socket(self, context):    default_update(self,context)    # self.node.update_chain_length(context)    # Driver Variable:def driver_variable_socket_update(self, context):    default_update(self,context)    self.node.update_on_socket_change(context)    def driver_socket_update(self, context):    default_update(self,context)    self.node.update_on_socket_change(context)def update_metarig_armature(self, context,):    if self.search_prop:        self.node.armature = self.search_prop.name        self.node.inputs["Meta-Bone"].search_prop = self.search_prop    default_update(self,context)def update_metarig_posebone(self, context,):    self.node.pose_bone = self.default_value    default_update(self,context)#########################################################################  Sockets########################################################################def ChooseDraw(self, context, layout, node, text, icon = "NONE", use_enum=True, nice_bool=True, icon_only=False):    # TEXT ONLY    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):        layout.prop_tabs_enum(self, "default_value",)    # for OUTPUT sockets that take INPUT (confusing name!)    elif ((hasattr(self, "default_value")) and hasattr(self, "input") and getattr(self, "input")):        # for simple input nodes        layout.prop(self, "default_value", text=text, toggle=nice_bool, slider=True)    # for INPUTS that are NOT CONNECTED    elif (hasattr(self, "default_value")) and not (self.is_output or self.is_linked):        # DO: expose these values as parameters for this function        #   and set them for each socket.        if icon == 'NONE': icon_only = False        elif icon_only == True : text = "" # "real" icon-only looks bad for strings, need to check other props types.        layout.prop(self, "default_value", text=text, toggle=nice_bool, slider=True, icon=icon,)    # CONNECTED sockets and outputs without input fields    else:        layout.label(text=text)class RelationshipSocket(NodeSocket):    # Description string    '''Relationship'''    # Optional identifier string. If not explicitly defined, the python class name is used.    bl_idname = 'RelationshipSocket'    bl_label = "Relationship"    color = cRelationship    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass DeformerSocket(NodeSocket):    # Description string    '''Deformer'''    # Optional identifier string. If not explicitly defined, the python class name is used.    bl_idname = 'DeformerSocket'    bl_label = "Deformer"    color = cDeformer    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass MatrixSocket(NodeSocket):    '''Matrix Input Output'''    bl_idname = 'MatrixSocket'    bl_label = "Matrix"    default_value : bpy.props.FloatVectorProperty(        default = (1.0, 0.0, 0.0, 0.0,                    0.0, 1.0, 0.0, 0.0,                    0.0, 0.0, 1.0, 0.0,                    0.0, 0.0, 0.0, 1.0),        size=16,        update = update_socket,)    color = cMatrix    input : bpy.props.BoolProperty(default =False,)    # Optional function for drawing the socket input value    def draw(self, context, layout, node, text):        layout.label(text=text)    def draw_color(self, context, node):        return self.color    # Utility functions to make handling the 16 numbers more bearable    def SetValue(self, mat):        self.default_value =  ( mat[0][0], mat[0][1], mat[0][2], mat[0][3],                                mat[1][0], mat[1][1], mat[1][2], mat[1][3],                                mat[2][0], mat[2][1], mat[2][2], mat[2][3],                                mat[3][0], mat[3][1], mat[3][2], mat[3][3], )    def TellValue(self):        from mathutils import Matrix        v = self.default_value        return Matrix( ( ( v[ 0], v[ 1], v[ 2], v[ 3],),                         ( v[ 4], v[ 5], v[ 6], v[ 7],),                         ( v[ 8], v[ 9], v[10], v[11],),                         ( v[12], v[13], v[14], v[15]), ) )                         #NOTE, we're not using the last row                         # so we're gonna use it to store data                         # unused, unused, unused, bone_length                         # but we're not going to make it                         # available except by accessor functions    # would like to make this stuff easier to deal with tho    def TellBoneLength(self):        return self.default_value[15]class xFormSocket(NodeSocket):    '''xFrom Input Output'''    bl_idname = 'xFormSocket'    bl_label = "xForm"    color = cxForm    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass xFormMultiSocket(NodeSocket):    '''xFrom Input Output'''    bl_idname = 'xFormMultiSocket'    bl_label = "xForm"    color = cxForm        input : bpy.props.BoolProperty(default =False,)    def __init__(self):        # self.is_multi_input=True        self.link_limit=0            def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass GeometrySocket(NodeSocket):    '''Geometry Input Output'''    bl_idname = 'GeometrySocket'    bl_label = "Geometry"    color = cGeometry    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass GenericRotationSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'GenericRotationSocket'    bl_label = "Rotation"    color = (0.0,0.0,0.0,0.0)    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    #TODO reimplement the below    # not high priority in the least    # def draw(self, context, layout, node, text):    #     if ((self.is_linked) and (not ToMathutilsValue(QuerySocket(self)[0]))):    #         layout.label(text="Invalid Input")    #     else:    #         layout.label(text=text)    # def draw_color(self, context, node):    #     from mathutils import Vector, Euler, Matrix, Quaternion    #     sock = QuerySocket(self)[0]    #     val = ToMathutilsValue(sock)    #     color = (1.0, 0.0, 0.0, 1.0,)    #     if (not self.is_linked):    #         color = (0.0, 0.0, 0.0, 0.0,)    #     if (val):    #         if ((isinstance(val, Vector)) or (isinstance(val, Euler))):    #             color = cVector    #         elif (isinstance(val, Quaternion)):    #             color = cQuaternion    #         elif (isinstance(val, Matrix)):    #             color = cMatrix    #     return (color)###############################class EnableSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnableSocket'    bl_label = "Enable"    default_value: bpy.props.BoolProperty(default=True, update = update_mute_socket,)    color = cEnable    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, nice_bool=False)    def draw_color(self, context, node):        return self.colorclass HideSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'HideSocket'    bl_label = "Enable"    default_value: bpy.props.BoolProperty(default=False, update = update_hide_socket,)    color = cEnable    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, nice_bool=False)    def draw_color(self, context, node):        return self.colorclass FCurveSocket(NodeSocket):    '''fCurve'''    bl_idname = 'FCurveSocket'    bl_label = "fCurve"    color = cFCurve    input : bpy.props.BoolProperty(default =False, update = update_socket)    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass KeyframeSocket(NodeSocket):    '''Keyframe'''    bl_idname = 'KeyframeSocket'    bl_label = "Keyframe"    color = cKeyframe    input : bpy.props.BoolProperty(default =False, update = update_socket)    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass DriverSocket(NodeSocket):    '''Driver'''    bl_idname = 'DriverSocket'    bl_label = "Driver"    color = cDriver    input : bpy.props.BoolProperty(default =False, update = update_socket)        def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass DriverVariableSocket(NodeSocket):    '''Driver'''    bl_idname = 'DriverVariableSocket'    bl_label = "Driver"    color = cDriverVariable    input : bpy.props.BoolProperty(default =False, update = update_socket)        def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# transform_spaces# transform_spaces_bone_object# transform_spaces_object# def get_transform_space_enum(self, context):    # passclass TransformSpaceSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'TransformSpaceSocket'    bl_label = "Transform Space"    default_value: bpy.props.EnumProperty(        name="Space Transform",        description="Space Transform",        items=transform_spaces,        default='WORLD',        update = update_socket,)    color = cTransformSpace    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass BooleanSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'BooleanSocket'    bl_label = "Boolean"    default_value: bpy.props.BoolProperty(update = update_socket,)    color = cBool    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass BooleanThreeTupleSocket(NodeSocket):    # Description string    '''Custom node socket type'''    # Optional identifier string. If not explicitly defined, the python class name is used.    bl_idname = 'BooleanThreeTupleSocket'    bl_label = "Boolean Vector"    default_value: bpy.props.BoolVectorProperty(subtype = "XYZ",update = update_socket,)    color = cBool3    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    def TellValue(self):        return (self.default_value[0], self.default_value[1], self.default_value[2])class RotationOrderSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'RotationOrderSocket'    bl_label = "Rotation Order"    default_value: bpy.props.EnumProperty(        name="Rotation Order",        description="Rotation Order",        items=enumRotationOrder,        default='AUTO',        update = update_socket,)    color = cRotationOrder    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass QuaternionSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'QuaternionSocket'    bl_label = "Quaternion"    default_value: bpy.props.FloatVectorProperty(        subtype = "QUATERNION",        size = 4,        default = (1.0, 0.0, 0.0, 0.0,),        update = update_socket,)    color = cQuaternion    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass QuaternionSocketAA(NodeSocket):    '''Custom node socket type'''    bl_idname = 'QuaternionSocketAA'    bl_label = "Axis Angle"    color = cQuaternion    input : bpy.props.BoolProperty(default =False,)    default_value: bpy.props.FloatVectorProperty(        subtype = "AXISANGLE",        size = 4,        default = (1.0, 0.0, 0.0, 0.0,),        update = update_socket,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass IntSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'IntSocket'    bl_label = "Boolean"    default_value: bpy.props.IntProperty(default=0, update = update_socket,)    color = cInt    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass StringSocket(bpy.types.NodeSocketString):    """Float Input socket"""    bl_idname = 'StringSocket'    bl_label = "Float"    default_value : bpy.props.StringProperty(default = "", update = update_socket,)    # text_only : bpy.props.BoolProperty(default=False)    color = cString    icon : bpy.props.StringProperty(default = "NONE",)    input : bpy.props.BoolProperty(default =False,)    # def __init__(self):        # if self.node.bl_idname == 'UtilityBoneProperties':            # self.display_shape='DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, icon=self.icon, icon_only=True)    def draw_color(self, context, node):        return self.colorclass LayerMaskSocket(bpy.types.NodeSocket):    """Layer Mask Input socket"""    bl_idname = 'LayerMaskSocket'    bl_label = "Layer Mask"    default_value: bpy.props.BoolVectorProperty(subtype = "LAYER", update = update_socket, size=32)    color = cLayerMask    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color        class LayerMaskInputSocket(bpy.types.NodeSocket): # I can probably use inheritance somehow lol    """Layer Mask Input socket"""    bl_idname = 'LayerMaskInputSocket'    bl_label = "Layer Mask"    default_value: bpy.props.BoolVectorProperty(subtype = "LAYER", update = update_socket, size=32)    color = cLayerMask    input : bpy.props.BoolProperty(default =True,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color###################################################################################### Parameters#####################################################################################class xFormParameterSocket(NodeSocket):    '''xFrom Parameter'''    bl_idname = 'xFormParameterSocket'    bl_label = "Parameter"    color = cxForm    input : bpy.props.BoolProperty(default =False,)        def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# what is this one again?class ParameterBoolSocket(bpy.types.NodeSocket):    """Boolean Parameter Socket"""    bl_idname = 'ParameterBoolSocket'    bl_label = "Bool"    color = cBool    input : bpy.props.BoolProperty(default =False,)    #custom properties:    min:bpy.props.FloatProperty(default = 0)    max:bpy.props.FloatProperty(default = 1)    soft_min:bpy.props.FloatProperty(default = 0)    soft_max:bpy.props.FloatProperty(default = 1)    description:bpy.props.StringProperty(default = "")    default_value : bpy.props.BoolProperty(default = False, update = update_socket,)    def __init__(self):        self.display_shape = 'DIAMOND'        # if True:            # print (self.is_property_set("default_value"))            # ui_data = self.id_properties_ui("default_value")            # ui_data.update(                # description=self.description,                # default=0,) # for now            # ui_data.update(                # min = self.min,                # max = self.max,                # soft_min = self.soft_min,                # soft_max = self.soft_max,)                            def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color        class ParameterIntSocket(bpy.types.NodeSocket):    """Integer Parameter socket"""    bl_idname = 'ParameterIntSocket'    bl_label = "Int"    default_value : bpy.props.IntProperty(default = 0, update = update_socket,)    color = cInt    input : bpy.props.BoolProperty(default =False,)    #custom properties:    min:bpy.props.FloatProperty(default = 0)    max:bpy.props.FloatProperty(default = 1)    soft_min:bpy.props.FloatProperty(default = 0)    soft_max:bpy.props.FloatProperty(default = 1)    description:bpy.props.StringProperty(default = "")    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color        class ParameterFloatSocket(bpy.types.NodeSocket):    """Float Parameter socket"""    bl_idname = 'ParameterFloatSocket'    bl_label = "Float"    default_value : bpy.props.FloatProperty(default = 0.0, update = update_socket,)    color = cFloat    input : bpy.props.BoolProperty(default =False,)    #custom properties:    min:bpy.props.FloatProperty(default = 0)    max:bpy.props.FloatProperty(default = 1)    soft_min:bpy.props.FloatProperty(default = 0)    soft_max:bpy.props.FloatProperty(default = 1)    description:bpy.props.StringProperty(default = "")    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color        class ParameterVectorSocket(bpy.types.NodeSocket):    """Vector Parameter socket"""    bl_idname = 'ParameterVectorSocket'    bl_label = "Vector"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,)    color = cVector    input : bpy.props.BoolProperty(default =False,)    #custom properties:    description:bpy.props.StringProperty(default = "")    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass ParameterStringSocket(bpy.types.NodeSocket):    """String Parameter socket"""    bl_idname = 'ParameterStringSocket'    bl_label = "Float"    default_value : bpy.props.StringProperty(default = "", update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    text_only : bpy.props.BoolProperty(default=False)    #custom properties:    description:bpy.props.StringProperty(default = "")    def __init__(self):        self.display_shape = 'DIAMOND'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color###################################################################################### Additional socket types, for special cases#####################################################################################from bpy.props import PointerProperty, StringPropertydef poll_is_armature(self, obj):    return obj.type == "ARMATURE"    # def poll_is_armature(self, obj):    # return obj.type == "ARMATURE"class EnumMetaRigSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumMetaRigSocket'    bl_label = "Meta Rig"        search_prop:PointerProperty(type=bpy.types.Object, poll=poll_is_armature, update=update_metarig_armature)        def get_default_value(self):        return self.search_prop.name        default_value  : StringProperty(name = "", get=get_default_value)        color = cString    def draw(self, context, layout, node, text):        if not (self.is_linked):            layout.prop_search(data=self, property="search_prop", search_data=bpy.data, search_property="objects", text="", icon="OUTLINER_OB_ARMATURE", results_are_suggestions=True)        else:            layout.label(text=self.node.armature)            def draw_color(self, context, node):        return self.colordef SearchPBDraw(self, context, layout, node, text, icon = "NONE", use_enum=True, nice_bool=True, icon_only=False):    layout.prop_search(data=self, property="default_value", search_data=self.search_prop.data, search_property="bones", text=text, icon=icon, results_are_suggestions=True)    class EnumMetaBoneSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumMetaBoneSocket'    bl_label = "Meta Bone"        search_prop:PointerProperty(type=bpy.types.Object)    bone:StringProperty()        def populate_bones_list(self, context):        # just gonna hardcode the value        if (meta_rig := self.search_prop):            retList = []            armatures = []            i = -1            retList.append( ('NONE', '', '', 'NONE', i:=i+1 ) )            for b in meta_rig.data.bones:                retList.append( (b.name, b.name, "Bone to copy matrix from", "BONE_DATA", i:=i+1 ) )            return(retList)        return None    # default_value : bpy.props.EnumProperty(                 # items = populate_bones_list,                 # name = "Meta Rig")                     def get_default_value(self):        return self.search_prop.name        default_value  : StringProperty(name = "", update=update_metarig_posebone)                     color = cString    def draw(self, context, layout, node, text):        if not (self.is_linked):            if self.search_prop is None:                layout.prop(self, "default_value", text="", icon="BONE_DATA",)            else:                SearchPBDraw(self, context, layout, node, text="")        else:            layout.label(text=self.node.pose_bone)            def draw_color(self, context, node):        return self.color                    class BoolUpdateParentNode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'BoolUpdateParentNode'    bl_label = "Boolean"    default_value: bpy.props.BoolProperty(default=False, update = update_parent_node)    color = cBool    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass LabelSocket(bpy.types.NodeSocket):    """Float Input socket"""    bl_idname = 'LabelSocket'    bl_label = "Label"    color = (0.000, 0.000, 0.000, 0.000000)    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass IKChainLengthSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'IKChainLengthSocket'    bl_label = "Chain Length"    default_value: bpy.props.IntProperty(default=0, update = ik_chain_length_update_socket, min = 0, max = 255)    color = cInt    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# InheriteInheritScale = (        ('FULL', "Full", "Fully inherit scale", 1),        ('AVERAGE', "Average", "todo", 2),        ('ALIGNED', "Aligned", "todo", 3),        ('FIX_SHEAR', "Fix Shear", "todo", 4),        ('NONE', "None", "todo", 5),    )class EnumInheritScale(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumInheritScale'    bl_label = "Inherit Scale"    default_value: bpy.props.EnumProperty(        items=eInheritScale,        name="Inherit Scale",        description="Inherit Scale",        default = 'FULL',        #options = set(),        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# Copy RotationeRotationMix =(        ('REPLACE', "Replace", "Fully inherit scale", 0),        ('BEFORE', "Before", "Fully inherit scale", 1),        ('AFTER', "After", "Fully inherit scale", 2),        ('ADD', "Add", "Fully inherit scale", 3),        #todo, but i don't care much    )    # TODO HACK# I am trying to figure out how to do enum_flag as#  mutually exclusive options# but! I don't think it's possible# I just like the UI for it :P    class EnumRotationMix(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumRotationMix'    bl_label = "Rotation Mix"    default_value: bpy.props.EnumProperty(        items=eRotationMix,        name="Rotation Mix",        description="Rotation Mix",        default = 'REPLACE',#{'REPLACE'},        options = set(), # this has to be a set lol        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.coloreRotationMix_copytransforms =(        ('REPLACE', "Replace", "Fully inherit scale"),        ('BEFORE', "Before", "Fully inherit scale"),        ('AFTER', "After", "Fully inherit scale"),)class EnumRotationMixCopyTransforms(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumRotationMixCopyTransforms'    bl_label = "Rotation Mix"    default_value: bpy.props.EnumProperty(        items=eRotationMix_copytransforms,        name="Rotation Mix",        description="Rotation Mix",        default = 'REPLACE', #{'REPLACE'},        #options = {'ENUM_FLAG'}, # this sux        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# STRETCH TOeMaintainVolumeStretchTo = (('VOLUME_XZX', "XZ", "XZ", 1),                            ('VOLUME_X', "X", "X", 2),                            ('VOLUME_Z', "Z", "Z", 4),                            ('NO_VOLUME', "None", "None", 8),)class EnumMaintainVolumeStretchTo(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumMaintainVolumeStretchToSocket'    bl_label = "Maintain Volume"    default_value: bpy.props.EnumProperty(        items=eMaintainVolumeStretchTo,        name="Maintain Volume",        description="Maintain Volume",        default = 'VOLUME_XZX',        #options = {'ENUM_FLAG'},        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.coloreRotationStretchTo = (('PLANE_X', "XZ", "XZ", 1),                      ('PLANE_Z', "ZX", "ZX", 2),                      ('SWING_Y', "Swing", "Swing", 4),)class EnumRotationStretchTo(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumRotationStretchTo'    bl_label = "Rotation"    default_value: bpy.props.EnumProperty(        items=eRotationStretchTo,        name="Rotation",        description="Rotation",        default = 'PLANE_X',        #options = {'ENUM_FLAG'},        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# Track-ToeTrackAxis = (('TRACK_X', "X", "X", 1),               ('TRACK_Y', "Y", "Y", 2),               ('TRACK_Z', "Z", "Z", 4),               ('TRACK_NEGATIVE_X', "-X", "-X", 8),               ('TRACK_NEGATIVE_Y', "-Y", "-Y", 16),               ('TRACK_NEGATIVE_Z', "-Z", "-Z", 32,))eUpAxis = (('UP_X', "X", "X", 1),           ('UP_Y', "Y", "Y", 2),           ('UP_Z', "Z", "Z", 4),)class EnumTrackAxis(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTrackAxis'    bl_label = "Track Axis"    default_value: bpy.props.EnumProperty(        items=eTrackAxis,        name="Track Axis",        description="Track Axis",        default = 'TRACK_X',        #options = {'ENUM_FLAG'},        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass EnumUpAxis(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumUpAxis'    bl_label = "Up Axis"    default_value: bpy.props.EnumProperty(        items=eUpAxis,        name="Up Axis",        description="Up Axis",        default = 'UP_X',        #options = {'ENUM_FLAG'},        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# Locked TrackeLockAxis = (('LOCK_X', "X", "X", 1),             ('LOCK_Y', "Y", "Y", 2),             ('LOCK_Z', "Z", "Z", 4),)class EnumLockAxis(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumLockAxis'    bl_label = "Lock Axis"    default_value: bpy.props.EnumProperty(        items=eLockAxis,        name="Lock Axis",        description="Lock Axis",        default = 'LOCK_X',        #options = {'ENUM_FLAG'},        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# Limit Distance:eLimitMode = (('LIMITDIST_INSIDE', "Inside", "Inside",),              ('LIMITDIST_OUTSIDE', "Outside", "Outside",),              ('LIMITDIST_ONSURFACE', "On Surface", "On Surface",),)class EnumLimitMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumLimitMode'    bl_label = "Clamp Region"    default_value: bpy.props.EnumProperty(        items=eLimitMode,        name="Clamp Region",        description="Clamp Region",        default = 'LIMITDIST_INSIDE',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color# Spline IKeYScaleMode = (('NONE', "None", "Don’t scale the X and Z axes.",),              ('FIT_CURVE', "Fit Curve", "Scale the bones to fit the entire length of the curve.",),              ('BONE_ORIGINAL', "Bone Original", "Use the original scaling of the bones.",),)eXZScaleMode = (('NONE', "None", "Don’t scale the X and Z axes.",),                ('BONE_ORIGINAL', "Bone Original", "Use the original scaling of the bones.",),                ('INVERSE_PRESERVE', "Inverse Scale", "Scale of the X and Z axes is the inverse of the Y-Scale.",),                ('VOLUME_PRESERVE', "Volume Preservation", "Scale of the X and Z axes are adjusted to preserve the volume of the bones.",),)class EnumYScaleMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumYScaleMode'    bl_label = "Y Scale Mode"    default_value: bpy.props.EnumProperty(        items=eYScaleMode,        name="Y Scale Mode",        description="Y Scale Mode",        default = 'FIT_CURVE',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass EnumXZScaleMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumXZScaleMode'    bl_label = "Y Scale Mode"    default_value: bpy.props.EnumProperty(        items=eXZScaleMode,        name="XZ Scale Mode",        description="XZ Scale Mode",        default = 'NONE',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.coloreMapxForm = (('LOCATION', "Location", "Location",),             ('ROTATION', "Rotation", "Rotation",),             ('SCALE', "Scale", "Scale",),)eRotationMode = (('AUTO', 'Auto', 'Euler using the rotation order of the target.', 0),                 ('XYZ', "XYZ", "Euler using the XYZ rotation order", 1),                 ('XZY', "XZY", "Euler using the XZY rotation order", 2),                 ('ZXY', "ZXY", "Euler using the ZXY rotation order", 3),                 ('ZYX', "ZYX", "Euler using the ZYX rotation order", 4),                 ('YXZ', "YXZ", "Euler using the YXZ rotation order", 5),                 ('YZX', "YZX", "Euler using the YZX rotation order", 6),                 ('QUATERNION', "Quaternion", "Quaternion", 7),                 ('SWING_TWIST_X', 'Swing and X Twist.', 'Decompose into a swing rotation to aim the X axis, followed by twist around it.',  8),                 ('SWING_TWIST_Y', 'Swing and Y Twist.', 'Decompose into a swing rotation to aim the Y axis, followed by twist around it.',  9),                 ('SWING_TWIST_Z', 'Swing and Z Twist.', 'Decompose into a swing rotation to aim the Z axis, followed by twist around it.', 10),)enumTransformationRotationOrder = enumRotationOrder[:6]eTranslationMix =(        ('ADD', "Add", "", 0),        ('REPLACE', "Replace", "", 1),    )    eScaleMix =(        ('MULTIPLY', "Multiply", "", 0),        ('REPLACE', "Replace", "", 1),    )    class EnumTransformationMap(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationMap'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eMapxForm,        name="Map To/From",        description="Map To/From",        default = 'LOCATION',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass EnumTransformationRotationMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationMode'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eRotationMode,        name="Rotation Mode",        description="Rotation Mode",        default = 'AUTO',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color        class EnumTransformationRotationOrder(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationOrder'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=enumTransformationRotationOrder,        name="Rotation Order",        description="Rotation Order",        default = 'AUTO',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color        class EnumTransformationTranslationMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationTranslationMixMode'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eTranslationMix,        name="Mix Translation",        description="Mix Translation",        default = 'ADD',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color        class EnumTransformationRotationMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationMixMode'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eRotationMix,        name="Mix Rotation",        description="Mix Rotation",        default = 'ADD',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color        class EnumTransformationScaleMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationScaleMixMode'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eScaleMix,        name="Mix Scale",        description="Mix Scale",        default = 'REPLACE',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.coloreAxes = (        ('X', "X", "X", 0),        ('Y', "Y", "Y", 1),        ('Z', "Z", "Z", 1),    )    class EnumTransformationAxes(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationAxes'    bl_label = "Map"    default_value: bpy.props.EnumProperty(        items=eAxes,        # name="",        # description="",        default = 'X',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color        #eSkinningMethod = (('EXISTING_GROUPS', "Use Existing Groups", "Use the existing vertex groups, or create empty groups if not found.",),                   ('AUTOMATIC_HEAT', "Automatic (Heat)", "Use Blender's heatmap automatic skinning",),)class EnumSkinning(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumSkinning'    bl_label = "Skinning Method"    default_value: bpy.props.EnumProperty(        items=eSkinningMethod,        name="Skinning Method",        description="Skinning Method",        default = 'AUTOMATIC_HEAT',        update = update_socket,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.coloreDriverVariableType = (                         ( 'SINGLE_PROP',                          "Property",                          "Property",                          1),                        ( 'LOC_DIFF',                          "Distance",                          "Distance",                          2),                       ( 'ROTATION_DIFF',                         "Rotational Difference",                         "Rotational Difference",                         3),                         # TRANSFORMS                      )class EnumDriverVariableType(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumDriverVariableType'    bl_label = "Variable Type"    default_value: bpy.props.EnumProperty(        items = eDriverVariableType,        name = "Variable Type",        description = "Variable Type",        default = 'SINGLE_PROP',        update = driver_variable_socket_update,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.coloreDriverVariableEvaluationSpace = (                         ( 'WORLD_SPACE',                          "World",                          "World",                          1),                                                ( 'TRANSFORM_SPACE',                          "Transform",                          "Transform",                          2),                        ( 'LOCAL_SPACE',                          "Local",                          "Local",                          3),                      )class EnumDriverVariableEvaluationSpace(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumDriverVariableEvaluationSpace'    bl_label = "Evaluation Space"    default_value: bpy.props.EnumProperty(        items = eDriverVariableEvaluationSpace,        name = "Evaluation Space",        description = "Evaluation Space",        default = 'WORLD_SPACE',        update = driver_variable_socket_update,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.colorclass EnumDriverRotationMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumDriverRotationMode'    bl_label  = "Rotaton Mode"    default_value: bpy.props.EnumProperty(        items = eRotationMode,        name = "Rotation Mode",        description = "Rotation Mode",        default = 'AUTO',        update = driver_variable_socket_update,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color#eDriverType = (('AVERAGE', 'Average', 'Average', 0),               ('SUM', "Sum", "Sum", 1),               ('SCRIPTED', "Scripted", "Scripted Expression", 2),               ('MIN', "Min", "Minimum", 3),               ('MAX', "Max", "Maximum", 4),)class EnumDriverType(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumDriverType'    bl_label  = "Driver Type"    default_value: bpy.props.EnumProperty(        items = eDriverType,        name = "Driver Type",        description = "Driver Type",        default = 'AVERAGE',        update = driver_socket_update,)    color = cString    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text, use_enum=False)    def draw_color(self, context, node):        return self.color# Keyframe# Enum for kf handle type# enum for interpolation type# eventually gonna make it to the fancy stuffclass FloatSocket(bpy.types.NodeSocketFloat):    """Float Input socket"""    bl_idname = 'FloatSocket'    bl_label = "Float"    default_value : bpy.props.FloatProperty(default = 0.0, update = update_socket,)    color = cFloat    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color        class FloatPositiveSocket(bpy.types.NodeSocketFloat):    """Float Input socket"""    bl_idname = 'FloatPositiveSocket'    bl_label = "Float"    default_value : bpy.props.FloatProperty(default = 0.0, min=0, update = update_socket,)    color = cFloat    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass FloatFactorSocket(bpy.types.NodeSocketFloatFactor):    '''xFrom Input Output'''    bl_idname = 'FloatFactorSocket'    bl_label = "xForm"    default_value : bpy.props.FloatProperty(        default = 0.0,        min = 0.0,        max=1.0,        update = update_socket,        subtype='FACTOR',)    color = cFloat    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass FloatAngleSocket(bpy.types.NodeSocketFloatAngle):    '''xFrom Input Output'''    bl_idname = 'FloatAngleSocket'    bl_label = "xForm"    default_value : bpy.props.FloatProperty(        default = 0.0,        min = -180,        max=180,        update = update_socket,        subtype='ANGLE',)    color = cFloat    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass VectorSocket(bpy.types.NodeSocketVectorEuler):    """Vector Input socket"""    bl_idname = 'VectorSocket'    bl_label = "Float"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,)    color = cVector    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass VectorEulerSocket(bpy.types.NodeSocketVectorEuler):    """Vector Input socket"""    bl_idname = 'VectorEulerSocket'    bl_label = "Float"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,        subtype='EULER',)    color = cVector    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass VectorTranslationSocket(bpy.types.NodeSocketVectorTranslation):    """Vector Input socket"""    bl_idname = 'VectorTranslationSocket'    bl_label = "Float"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,        subtype='TRANSLATION',)    color = cVector    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.colorclass VectorScaleSocket(bpy.types.NodeSocketVectorXYZ):    """Vector Input socket"""    bl_idname = 'VectorScaleSocket'    bl_label = "Float"    default_value : bpy.props.FloatVectorProperty(        default = (1.0, 1.0, 1.0),        update = update_socket,        subtype='XYZ',)    color = cVector    input : bpy.props.BoolProperty(default =False,)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color
 |