| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280 | import bpyfrom bpy.types import NodeSocket, NodeSocketStandardfrom .utilities import (prRed, prGreen, prPurple, prWhite,                              prOrange,                              wrapRed, wrapGreen, wrapPurple, wrapWhite,                              wrapOrange,)transform_spaces_bone_to = (('WORLD', "World", "World Space"),                            ('LOCAL', "Local", "Local Space"),                            ('POSE', "Pose", "Pose Space"),                            ('CUSTOM', "Custom", "Custom Space"),                            ('LOCAL_WITH_PARENT', "Local (With Parent)", "Local Space"),                            ('LOCAL_OWNER_ORIENT', "Local (Owner Orientation)", "Local Space"),)transform_spaces_bone_from = (('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_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)cBoneCollection = (0.82, 0.82, 0.82, 1.0)cDeformer       = (0.05, 0.08, 0.45, 1.0)cShapeKey       = (0.95, 0.32, 0.05, 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,             RelationshipSocket,             DeformerSocket,             GeometrySocket,             GenericRotationSocket,             EnableSocket,             HideSocket,            #  InverseKinematicsSocket,             DriverSocket,             DriverVariableSocket,             FCurveSocket,            #  LayerMaskSocket,            #  LayerMaskInputSocket,             BoneCollectionSocket,             EnumArrayGetOptions,                          xFormParameterSocket,             ParameterBoolSocket,             ParameterIntSocket,             ParameterFloatSocket,             ParameterVectorSocket,             ParameterStringSocket,                          TransformSpaceSocket,             BooleanSocket,             BooleanThreeTupleSocket,             RotationOrderSocket,             QuaternionSocket,             QuaternionSocketAA,             IntSocket,             StringSocket,             EnumMetaRigSocket,             EnumMetaBoneSocket,             EnumCurveSocket,             BoolUpdateParentNode,            #  LabelSocket,             IKChainLengthSocket,             EnumInheritScale,             EnumRotationMix,             EnumRotationMixCopyTransforms,             EnumMaintainVolumeStretchTo,             EnumRotationStretchTo,             EnumTrackAxis,             EnumUpAxis,             EnumLockAxis,             EnumLimitMode,             EnumYScaleMode,             EnumXZScaleMode,             EnumTransformationMap,             EnumTransformationRotationMode,             EnumTransformationRotationOrder,             EnumTransformationTranslationMixMode,             EnumTransformationRotationMixMode,             EnumTransformationScaleMixMode,             EnumTransformationAxes,             EnumBBoneHandleType,             # Deformers             EnumSkinning,             MorphTargetSocket,             #             FloatSocket,             FloatPositiveSocket,             FloatFactorSocket,             FloatAngleSocket,             VectorSocket,             VectorEulerSocket,             VectorTranslationSocket,             VectorScaleSocket,             # Drivers                          EnumDriverVariableType,             EnumDriverVariableEvaluationSpace,             EnumDriverVariableTransformChannel,             EnumDriverRotationMode,             EnumDriverType,             KeyframeSocket,             EnumKeyframeInterpolationTypeSocket,             EnumKeyframeBezierHandleTypeSocket,                          # Math             MathFloatOperation,             MathVectorOperation,             MatrixTransformOperation,             # Schema             WildcardSocket,            #  xFormArraySocket,            #  RelationshipArraySocket,            #  BooleanArraySocket,            #  IntArraySocket,            #  FloatArraySocket,            #  BooleanThreeTupleArraySocket,            #  VectorArraySocket,            #  QuaternionArraySocket,            #  MatrixArraySocket,            #  StringArraySocket,             ]def Tell_bl_idnames():                                # reroute nodes    return [cls.bl_idname for cls in TellClasses()]#+["NodeSocketColor"]# 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):    # return    context = bpy.context    if not context.space_data:        return    if not hasattr(context.space_data, "path"):        return    try:        node_tree = context.space_data.path[0].node_tree    except IndexError: # not in the UI, for example, in a script instead.        node_tree = None        return    if hasattr(socket.node, "initialized"):        if not socket.node.initialized: return    else: return    if node_tree.do_live_update and not (node_tree.is_executing or node_tree.is_exporting):        # 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 .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)        try:            prPurple("calling Execute Tree from socket update")            node_tree.execute_tree(context)        except Exception as e:            prRed("Automatic Tree Execution failed because of %s" % e)            # I don't want to deal with this right now TODO            # e.__traceback__.print_last() this isn't the same kind of traceback object as the traceback module            # socket.node.is_triggering_execute = Truedef 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)    # TODO: this is stupid. I don't know what I was trying to do when i made this# Driver Variable:def driver_variable_socket_update(self, context):    default_update(self,context)    # self.node.update_on_socket_change(context) # why?    def driver_socket_update(self, context):    default_update(self,context)    # self.node.update_on_socket_change(context) # same here, no ideadef 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):    # return    # TEXT ONLY    if self.node.bl_idname in ["NodeGroupInput", "NodeGroupOutput"]:        layout.label(text=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):            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_simple = cRelationship    color : bpy.props.FloatVectorProperty(default=cRelationship, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cDeformer    color : bpy.props.FloatVectorProperty(default=cDeformer, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cMatrix    color : bpy.props.FloatVectorProperty(default=cMatrix, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple    # 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_simple = cxForm    color : bpy.props.FloatVectorProperty(default=cxForm, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass GeometrySocket(NodeSocket):    '''Geometry Input Output'''    bl_idname = 'GeometrySocket'    bl_label = "Geometry"    color_simple = cGeometry    color : bpy.props.FloatVectorProperty(default=cGeometry, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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    @classmethod    def draw_color_simple(self):        return self.color_simple###############################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_simple = cEnable    color : bpy.props.FloatVectorProperty(default=cEnable, size=4)    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.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass HideSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'HideSocket'    bl_label = "Hide"    default_value: bpy.props.BoolProperty(default=False, update = update_hide_socket,)    color_simple = cEnable    color : bpy.props.FloatVectorProperty(default=cEnable, size=4)    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.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass FCurveSocket(NodeSocket):    '''fCurve'''    bl_idname = 'FCurveSocket'    bl_label = "fCurve"    color_simple = cFCurve    color : bpy.props.FloatVectorProperty(default=cFCurve, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)    def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass DriverSocket(NodeSocket):    '''Driver'''    bl_idname = 'DriverSocket'    bl_label = "Driver"    color_simple = cDriver    color : bpy.props.FloatVectorProperty(default=cDriver, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)        def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass DriverVariableSocket(NodeSocket):    '''Driver'''    bl_idname = 'DriverVariableSocket'    bl_label = "Driver Variable"    color_simple = cDriverVariable    color : bpy.props.FloatVectorProperty(default=cDriverVariable, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)        def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simple# transform_spaces# transform_spaces_bone_object# transform_spaces_object# def get_transform_space_enum(self, context):    # passdef get_transform_space(self, context):    if "Owner" in self.name:        return transform_spaces_bone_from    else:        return transform_spaces_bone_toclass 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=get_transform_space,        default=0,        update = update_socket,)    color_simple = cTransformSpace    color : bpy.props.FloatVectorProperty(default=cTransformSpace, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass BooleanSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'BooleanSocket'    bl_label = "Boolean"    default_value: bpy.props.BoolProperty(update = update_socket,)    color_simple = cBool    color : bpy.props.FloatVectorProperty(default=cBool, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cBool3    color : bpy.props.FloatVectorProperty(default=cBool3, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple    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_simple = cRotationOrder    color : bpy.props.FloatVectorProperty(default=cRotationOrder, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cQuaternion    color : bpy.props.FloatVectorProperty(default=cQuaternion, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass QuaternionSocketAA(NodeSocket):    '''Custom node socket type'''    bl_idname = 'QuaternionSocketAA'    bl_label = "Axis Angle Quaternion"    color_simple = cQuaternion    color : bpy.props.FloatVectorProperty(default=cQuaternion, size=4)    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.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass IntSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'IntSocket'    bl_label = "Integer"    default_value: bpy.props.IntProperty(default=0, update = update_socket,)    color_simple = cInt    color : bpy.props.FloatVectorProperty(default=cInt, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass StringSocket(bpy.types.NodeSocketString):    """Float Input socket"""    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",)    input : bpy.props.BoolProperty(default =False,)    # def init(self):        # if self.node.bl_idname == 'UtilityBoneProperties':            # self.display_shape='CIRCLE_DOT'    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.color    @classmethod    def draw_color_simple(self):        return self.color_simple# class 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_simple = cBoneCollection    color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)#     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_simple = cBoneCollection    color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)#     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.colorclass BoneCollectionSocket(bpy.types.NodeSocket):    """Bone Collection socket"""    bl_idname = 'BoneCollectionSocket'    bl_label = "Bone Collection"    default_value: bpy.props.StringProperty(default = "Collection", update = update_socket,)    input : bpy.props.BoolProperty(default =False,)    color_simple = cBoneCollection    color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleeArrayGetOptions =(        ('CAP', "Cap", "Fail if the index is out of bounds."),        ('WRAP', "Wrap", "Wrap around to the beginning of the array once the idex goes out of bounds."),        ('HOLD', "Hold", "Reuse the last element of the array if the index is out of bounds."),)class EnumArrayGetOptions(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumArrayGetOptions'    bl_label = "OoB Behaviour"    default_value: bpy.props.EnumProperty(        items=eArrayGetOptions,        name="OoB Behaviour",        description="Out-of-bounds behaviour.",        default = 'HOLD',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple###################################################################################### Parameters#####################################################################################class xFormParameterSocket(NodeSocket):    '''xFrom Parameter'''    bl_idname = 'xFormParameterSocket'    bl_label = "sForm Parameter"    color_simple = cxForm    color : bpy.props.FloatVectorProperty(default=cxForm, size=4)    input : bpy.props.BoolProperty(default =False,)        def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simple# what is this one again?class ParameterBoolSocket(bpy.types.NodeSocket):    """Boolean Parameter Socket"""    bl_idname = 'ParameterBoolSocket'    bl_label = "Boolean Parameter"    color_simple = cBool    color : bpy.props.FloatVectorProperty(default=cBool, size=4)    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 = 'CIRCLE_DOT'        # 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    @classmethod    def draw_color_simple(self):        return self.color_simple        class ParameterIntSocket(bpy.types.NodeSocket):    """Integer Parameter socket"""    bl_idname = 'ParameterIntSocket'    bl_label = "Integer Parameter"    default_value : bpy.props.IntProperty(default = 0, update = update_socket,)    color_simple = cInt    color : bpy.props.FloatVectorProperty(default=cInt, size=4)    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 = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simple        class ParameterFloatSocket(bpy.types.NodeSocket):    """Float Parameter socket"""    bl_idname = 'ParameterFloatSocket'    bl_label = "Float Parameter"    default_value : bpy.props.FloatProperty(default = 0.0, update = update_socket,)    color_simple = cFloat    color : bpy.props.FloatVectorProperty(default=cFloat, size=4)    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 = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simple        class ParameterVectorSocket(bpy.types.NodeSocket):    """Vector Parameter socket"""    bl_idname = 'ParameterVectorSocket'    bl_label = "Vector Parameter"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,)    color_simple = cVector    color : bpy.props.FloatVectorProperty(default=cVector, size=4)    input : bpy.props.BoolProperty(default =False,)    #custom properties:    description:bpy.props.StringProperty(default = "")    def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleclass ParameterStringSocket(bpy.types.NodeSocket):    """String Parameter socket"""    bl_idname = 'ParameterStringSocket'    bl_label = "String Parameter"    default_value : bpy.props.StringProperty(default = "", update = update_socket,)    color_simple = cString    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):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simple###################################################################################### 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):        if self.search_prop:            return self.search_prop.name        return ""        default_value  : StringProperty(name = "", get=get_default_value)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    def draw(self, context, layout, node, text):        if self.is_output:            layout.label(text=self.name)        elif 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)        elif hasattr(self.node, "armature"):            layout.label(text=self.node.armature)            # TODO: we should actually use the parsed tree to query this info directly, since this socket may belong to a node group in/out            # which doesn't have this parameter. whatever.        else:            layout.label(text=self.name)                    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpledef poll_is_curve(self, obj):    return obj.type == "CURVE"class EnumCurveSocket(NodeSocket):    '''Choose a curve'''    bl_idname = 'EnumCurveSocket'    bl_label = "Curve"        search_prop:PointerProperty(type=bpy.types.Object, poll=poll_is_curve, update=update_socket)        def get_default_value(self):        if self.search_prop:            return self.search_prop.name        return ""        default_value  : StringProperty(name = "", get=get_default_value)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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="CURVE_DATA", results_are_suggestions=True)        else:            try:                layout.label(text=self.search_prop.name)            except AttributeError: # TODO make this show the graph's result                layout.label(text=self.name)            def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpledef 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple                    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_simple = cBool    color : bpy.props.FloatVectorProperty(default=cBool, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# class 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.color#     @classmethod#     def draw_color_simple(self):#         return self.colorclass IKChainLengthSocket(NodeSocket):    '''Custom node socket type'''    bl_idname = 'IKChainLengthSocket'    bl_label = "IK Chain Length"    default_value: bpy.props.IntProperty(default=0, update = ik_chain_length_update_socket, min = 0, max = 255)    color_simple = cInt    color : bpy.props.FloatVectorProperty(default=cInt, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeRotationMix_copytransforms =(        ('REPLACE', "Replace (Aligned)", "Fully inherit scale"),        ('BEFORE', "Before (Aligned)", "Fully inherit scale"),        ('AFTER', "After (Aligned)", "Fully inherit scale"),        ('REPLACE_SPLIT', "Replace (Split Channels)", "Fully inherit scale"),        ('BEFORE_SPLIT', "Before (Split Channels)", "Fully inherit scale"),        ('AFTER_SPLIT', "After (Split Channels)", "Fully inherit scale"),        ('REPLACE_FULL', "Replace (Full)", "Fully inherit scale"),        ('BEFORE_FULL', "Before (Full)", "Fully inherit scale"),        ('AFTER_FULL', "After (Full)", "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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeRotationStretchTo = (('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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass EnumXZScaleMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumXZScaleMode'    bl_label = "XZ Scale Mode"    default_value: bpy.props.EnumProperty(        items=eXZScaleMode,        name="XZ Scale Mode",        description="XZ Scale Mode",        default = 'NONE',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeMapxForm = (('LOCATION', "Location", "Location",),             ('ROTATION', "Rotation", "Rotation",),             ('SCALE', "Scale", "Scale",),)eRotationMode = (('AUTO', 'Auto', 'Automattically Selected.', 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 To/From"    default_value: bpy.props.EnumProperty(        items=eMapxForm,        name="Map To/From",        description="Map To/From",        default = 'LOCATION',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass EnumTransformationRotationMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationMode'    bl_label = "Map To/From"    default_value: bpy.props.EnumProperty(        items=eRotationMode,        name="Rotation Mode",        description="Rotation Mode",        default = 'AUTO',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        class EnumTransformationRotationOrder(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationOrder'    bl_label = "Map To/From"    default_value: bpy.props.EnumProperty(        items=enumTransformationRotationOrder,        name="Rotation Order",        description="Rotation Order",        default = 'AUTO',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        class EnumTransformationTranslationMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationTranslationMixMode'    bl_label = "Mix Mode"    default_value: bpy.props.EnumProperty(        items=eTranslationMix,        name="Mix Translation",        description="Mix Translation",        default = 'ADD',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        class EnumTransformationRotationMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationRotationMixMode'    bl_label = "Mix Mode"    default_value: bpy.props.EnumProperty(        items=eRotationMix,        name="Mix Rotation",        description="Mix Rotation",        default = 'ADD',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        class EnumTransformationScaleMixMode(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationScaleMixMode'    bl_label = "Mix Mode"    default_value: bpy.props.EnumProperty(        items=eScaleMix,        name="Mix Scale",        description="Mix Scale",        default = 'REPLACE',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeAxes = (        ('X', "X", "X", 0),        ('Y', "Y", "Y", 1),        ('Z', "Z", "Z", 2),    )    class EnumTransformationAxes(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumTransformationAxes'    bl_label = "Axes"    default_value: bpy.props.EnumProperty(        items=eAxes,        # name="",        # description="",        default = 'X',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        #eBBoneHandleType = (        ('AUTO', "Automatic", "", 0),        ('ABSOLUTE', "Absolute", "", 1),        ('RELATIVE', "Relative", "", 2),        ('TANGENT', "Tangent", "", 3),    )class EnumBBoneHandleType(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumBBoneHandleType'    bl_label = "Axes"    default_value: bpy.props.EnumProperty(        items=eBBoneHandleType,        # name="",        # description="",        default = 'AUTO',        update = update_socket,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        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",),                   ('COPY_FROM_OBJECT', "Copy from object", "Copy skin weights from the selected object"),)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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass MorphTargetSocket(NodeSocket):    """Morph Target"""    bl_idname = 'MorphTargetSocket'    bl_label = "Morph Target"        color_simple = cShapeKey    color : bpy.props.FloatVectorProperty(default=cShapeKey, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeDriverVariableType = (                         ( 'SINGLE_PROP',                          "Property",                          "Property",                          1),                        ( 'LOC_DIFF',                          "Distance",                          "Distance",                          2),                       ( 'ROTATION_DIFF',                         "Rotational Difference",                         "Rotational Difference",                         3),                    #    ( 'TRANSFORMS',                    #      "Transform Channel",                    #      "Transform Channel",                    #      4),                      )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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeDriverVariableEvaluationSpace = (                         ( '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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleeDriverVariableTransformChannel = (                ("LOC_X", "X Location", "The X-coordinate of an object's location.", 1),                ("LOC_Y", "Y Location", "The Y-coordinate of an object's location.", 2),                ("LOC_Z", "Z Location", "The Z-coordinate of an object's location.", 3),                ("ROT_X", "X Rotation", "Rotation X-axis.", 4),                ("ROT_Y", "Y Rotation", "Rotation Y-axis.", 5),                ("ROT_Z", "Z Rotation", "Rotation Z-axis.", 6),                ("ROT_W", "W Rotation", "Rotation W-axis.", 7),                ("SCALE_X", "X Scale", "The X-scale of an object's scale.", 8),                ("SCALE_Y", "Y Scale", "The Y-scale of an object's scale.", 9),                ("SCALE_Z", "Z Scale", "The Z-scale of an object's scale.", 10),                ("SCALE_AVG", "Average Scale", "The scale factor of an object's scale.", 11),                )class EnumDriverVariableTransformChannel(NodeSocket):    '''Custom node socket type'''    bl_idname = 'EnumDriverVariableTransformChannel'    bl_label = "Transform Channel"    default_value: bpy.props.EnumProperty(        items = eDriverVariableTransformChannel,        name = "Transform Channel",        description = "Transform Channel",        default = 'LOC_X',        update = driver_variable_socket_update,)    color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass 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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple#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_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple# 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_simple = cFloat    color : bpy.props.FloatVectorProperty(default=cFloat, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple        class FloatPositiveSocket(bpy.types.NodeSocketFloat):    """Float Input socket"""    bl_idname = 'FloatPositiveSocket'    bl_label = "Float (Positive)"    default_value : bpy.props.FloatProperty(default = 0.0, min=0, update = update_socket,)    color_simple = cFloat    color : bpy.props.FloatVectorProperty(default=cFloat, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass FloatFactorSocket(bpy.types.NodeSocketFloatFactor):    '''xFrom Input Output'''    bl_idname = 'FloatFactorSocket'    bl_label = "Float (Factor)"    default_value : bpy.props.FloatProperty(        default = 0.0,        min = 0.0,        max=1.0,        update = update_socket,        subtype='FACTOR',)    color_simple = cFloat    color : bpy.props.FloatVectorProperty(default=cFloat, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass FloatAngleSocket(bpy.types.NodeSocketFloatAngle):    '''xFrom Input Output'''    bl_idname = 'FloatAngleSocket'    bl_label = "Float (Angle)"    default_value : bpy.props.FloatProperty(        default = 0.0,        min = -180,        max=180,        update = update_socket,        subtype='ANGLE',)    color_simple = cFloat    color : bpy.props.FloatVectorProperty(default=cFloat, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass VectorSocket(bpy.types.NodeSocketVectorEuler):    """Vector Input socket"""    bl_idname = 'VectorSocket'    bl_label = "Vector"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,)    color_simple = cVector    color : bpy.props.FloatVectorProperty(default=cVector, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass VectorEulerSocket(bpy.types.NodeSocketVectorEuler):    """Vector Input socket"""    bl_idname = 'VectorEulerSocket'    bl_label = "Euler"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,        subtype='EULER',)    color_simple = cVector    color : bpy.props.FloatVectorProperty(default=cVector, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass VectorTranslationSocket(bpy.types.NodeSocketVectorTranslation):    """Vector Input socket"""    bl_idname = 'VectorTranslationSocket'    bl_label = "Vector (Translation)"    default_value : bpy.props.FloatVectorProperty(        default = (0.0, 0.0, 0.0),        update = update_socket,        subtype='TRANSLATION',)    color_simple = cVector    color : bpy.props.FloatVectorProperty(default=cVector, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass VectorScaleSocket(bpy.types.NodeSocketVectorXYZ):    """Vector Input socket"""    bl_idname = 'VectorScaleSocket'    bl_label = "Vector (Scale)"    default_value : bpy.props.FloatVectorProperty(        default = (1.0, 1.0, 1.0),        update = update_socket,        subtype='XYZ',)    color_simple = cVector    color : bpy.props.FloatVectorProperty(default=cVector, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass KeyframeSocket(NodeSocket):    '''Keyframe'''    bl_idname = 'KeyframeSocket'    bl_label = "Keyframe"    color_simple = cKeyframe    color : bpy.props.FloatVectorProperty(default=cKeyframe, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)    def init(self):        self.display_shape = 'CIRCLE_DOT'    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleEnumKeyframeInterpolationType = (('CONSTANT', 'Stepped', 'Stepped'),                                 ('LINEAR', "Linear", "Linear"),                                 ('BEZIER', "Bezier", "Bezier"),)class EnumKeyframeInterpolationTypeSocket(NodeSocket):    '''Keyframe Interpolation Type'''    bl_idname = 'EnumKeyframeInterpolationTypeSocket'    bl_label = "Keyframe Interpolation Type"    default_value :bpy.props.EnumProperty(        name="",        description="Interpolation",        items=EnumKeyframeInterpolationType,        default='LINEAR',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleEnumKeyframeBezierHandleType = (('FREE', 'Free', 'Completely independent manually set handle.'),                                ('ALIGNED', "Aligned", "Manually set handle with rotation locked together with its pair."),                                ('VECTOR', "Vector", "Automatic handles that create straight lines."),                                ('AUTO', "Automatic", "Automatic handles that create smooth curves."),                                ('AUTO_CLAMPED', "Auto Clamped", "Automatic handles that create smooth curves which only change direction at keyframes."),)class EnumKeyframeBezierHandleTypeSocket(NodeSocket):    '''Keyframe Bezier Handle Type'''    bl_idname = 'EnumKeyframeBezierHandleTypeSocket'    bl_label = "Keyframe Bezier Handle Type"    default_value :bpy.props.EnumProperty(        name="",        description="Handle Type",        items=EnumKeyframeBezierHandleType,        default='AUTO_CLAMPED',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    input : bpy.props.BoolProperty(default =False, update = update_socket)    def draw(self, context, layout, node, text):        ChooseDraw(self, context, layout, node, text)    def draw_color(self, context, node):        return self.color    @classmethod    def draw_color_simple(self):        return self.color_simpleenumFloatOperations = (('ADD', 'Add', 'Add'),                      ('SUBTRACT', "Subtract", "Subtract"),                      ('MULTIPLY', "Multiply", "Multiply"),                      ('DIVIDE', "Divide", "Divide"),                      ('POWER', "Power", "Power"),                      ('FLOOR_DIVIDE', "Floor Divide", "Floor Divide"),                      ('MODULUS', "Modulus", "Modulus"),                      ('ABSOLUTE', "Absolute", "Absolute Value"),                      ('MAXIMUM', "Maximum", "Maximum"),                      ('MINIMUM', "Minimum", "Minimum"),                      ('GREATER THAN', "Greater Than", "Greater Than"),                      ('LESS THAN', "Less Than", "Less Than"),)class MathFloatOperation(NodeSocket):    """Float Math Operation"""    bl_idname = 'MathFloatOperation'    bl_label = "Operation"    default_value :bpy.props.EnumProperty(        name="",        description="Operation",        items=enumFloatOperations,        default='MULTIPLY',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleenumVectorOperations = (('ADD', 'Add', 'Add (Component-wise)'),                        ('SUBTRACT', "Subtract", "Subtract (Component-wise)"),                        ('MULTIPLY', "Multiply", "Multiply (Component-wise)"),                        ('SCALE', "Scale", "Scales vector by input float or average magnitude of input vector's components."),                        ('DIVIDE', "Divide", "Divide (Component-wise)"),                        ('POWER', "Power", "Power (Component-wise)"),                        ('LENGTH', "Length", "Length"),                        ('CROSS', "Cross Product", "Cross product of A X B"),                        ('NORMALIZE', "Normalize", "Returns a normalized vector."),                        ('DOT', "Dot Product", "Dot product of A . B"),                        ('LINEAR_INTERP', "Linear Interpolation", "Linear Interpolation between vectors A and B by factor"))       class MathVectorOperation(NodeSocket):    """Vector Math Operation"""    bl_idname = 'MathVectorOperation'    bl_label = "Operation"    default_value :bpy.props.EnumProperty(        name="",        description="Operation",        items=enumVectorOperations,        default='MULTIPLY',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleenumMatrixTransform  = (('TRANSLATE', 'Translate', 'Translate'),                        ('ROTATE_AXIS_ANGLE', "Rotate (Axis-angle)", "Rotates a number of radians around an axis"),                        # ('ROTATE_EULER', "Rotate (Euler)", "Euler Rotation"),                        # ('ROTATE_QUATERNION', "Rotate (Quaternion)", "Quaternion Rotation"),                        ('SCALE', "Scale", "Scale"),)       class MatrixTransformOperation(NodeSocket):    """Matrix Transform Operation"""    bl_idname = 'MatrixTransformOperation'    bl_label = "Operation"    default_value :bpy.props.EnumProperty(        name="",        description="Operation",        items=enumMatrixTransform,        default='TRANSLATE',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleenumIntOperations =  (('ADD', 'Add', 'Add'),                      ('SUBTRACT', "Subtract", "Subtract"),                      ('MULTIPLY', "Multiply", "Multiply"),                      ('FLOOR_DIVIDE', "Floor Divide", "Floor Divide"),                      ('POWER', "Power", "Power"),                      ('MODULUS', "Modulus", "Modulus"),                      ('ABSOLUTE', "Absolute", "Absolute Value"),                      ('MAXIMUM', "Maximum", "Maximum"),                      ('MINIMUM', "Minimum", "Minimum"),                      ('GREATER THAN', "Greater Than", "Greater Than"),                      ('LESS THAN', "Less Than", "Less Than"),)class MathIntOperation(NodeSocket):    """Int Math Operation"""    bl_idname = 'MathIntOperation'    bl_label = "Operation"    default_value :bpy.props.EnumProperty(        name="",        description="Operation",        items=enumIntOperations,        default='MULTIPLY',        update = update_socket,)        color_simple = cString    color : bpy.props.FloatVectorProperty(default=cString, size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simpleclass WildcardSocket(NodeSocket):    """Some kind of node socket lol I donno"""    bl_idname = 'WildcardSocket'    bl_label = ""    color_simple = (0.0,0.0,0.0,0.0)    color : bpy.props.FloatVectorProperty(default=(0.0,0.0,0.0,0.0), size=4)    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    @classmethod    def draw_color_simple(self):        return self.color_simple
 |