socket_definitions.py 82 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266
  1. import bpy
  2. from bpy.types import NodeSocket, NodeSocketStandard
  3. from .utilities import (prRed, prGreen, prPurple, prWhite,
  4. prOrange,
  5. wrapRed, wrapGreen, wrapPurple, wrapWhite,
  6. wrapOrange,)
  7. transform_spaces = (('WORLD', "World", "World Space"),
  8. ('LOCAL', "Local", "Local Space"),
  9. ('POSE', "Pose", "Pose Space"),
  10. ('CUSTOM', "Custom", "Custom Space"),
  11. ('LOCAL_WITH_PARENT', "Local (With Parent)", "Local Space"),)
  12. # ('TRANSFORM', "Pose", "Pose Space"),)
  13. transform_spaces_bone_object = (('WORLD', "World", "World Space"),
  14. ('LOCAL', "Local", "Local Space"),
  15. ('POSE', "Pose", "Pose Space"),
  16. ('CUSTOM', "Custom", "Custom Space"),)
  17. transform_spaces_object = (('WORLD', "World", "World Space"),
  18. ('LOCAL', "Local", "Local Space"),
  19. ('CUSTOM', "Custom", "Custom Space"),)
  20. enumRotationOrder =(('AUTO', 'Auto', 'Auto'),
  21. ('XYZ', "XYZ", "XYZ"),
  22. ('XZY', "XZY", "XZY"),
  23. ('ZXY', "ZXY", "ZXY"),
  24. ('ZYX', "ZYX", "ZYX"),
  25. ('YXZ', "YXZ", "YXZ"),
  26. ('YZX', "YZX", "YZX"),
  27. ('QUATERNION', "Quaternion", "Quaternion"),
  28. ('AXIS_ANGLE', "Axis Angle", "Axis Angle"),)
  29. # node socket colors:
  30. cFloat = (0.631373, 0.631373, 0.631373, 1.000000)
  31. cColor = (0.780392, 0.780392, 0.160784, 1.000000)
  32. cVector = (0.388235, 0.388235, 0.780392, 1.000000)
  33. cShader = (0.388235, 0.780392, 0.388235, 1.000000)
  34. cInt = (0.058824, 0.521569, 0.149020, 1.000000)
  35. cString = (0.388235, 0.388235, 0.388235, 1.000000)
  36. # cBool = (0.698039, 0.650980, 0.188235, 1.000000)
  37. cParameter = (0.48, 0.24, 0.24, 1.0)
  38. cDriver = (0.88, 0.11, 0.88, 1.0)
  39. cDriverVariable = (0.66, 0.33, 0.04, 1.0)
  40. cFCurve = (0.77, 0.77, 0.11, 1.0)
  41. cKeyframe = (0.06, 0.22, 0.88, 1.0)
  42. cEnable = (0.92, 0.92, 0.92, 1.0)
  43. cBoneCollection = (0.82, 0.82, 0.82, 1.0)
  44. cDeformer = (0.05, 0.08, 0.45, 1.0)
  45. cShapeKey = (0.95, 0.32, 0.05, 1.0)
  46. # custom colors:
  47. cIK = (0.596078, 0.596078, 0.364706, 1.000000) #because it's yellow in Blender
  48. cRelationship = (0.352941, 0.584314, 0.431373, 1.000000) #constraint color
  49. cMatrix = (0.0, 1.0, 0.75, 1)
  50. cxForm = (0.843137, 0.592157, 0.388235, 1.000000) #could even fetch the theme colors...
  51. cTransformSpace = (1.0, 0.4, 0.216, 1.0)
  52. cBool = (0.1, 0.1, 0.1, 1.0)
  53. cBool3 = (0.35, 0.25, 0.18, 1.0)
  54. cRotationOrder = (0.0, 0.8, 0.0, 1.0)
  55. cQuaternion = (0.85, 0.25, 0.18, 1.0)
  56. #
  57. cGeometry = (0.000000, 0.672443, 0.366253, 1.000000)
  58. # think about making colors that are representative of the data's purpose:
  59. # location
  60. # rotation
  61. # scale
  62. # OR make all of it a reference to the type of data within?
  63. # Hybrid approach: Make same-data, similar purpose have similar colors.
  64. def TellClasses():
  65. return [ #MantisSocket,
  66. #DefaultSocket,
  67. #InputSocket,
  68. MatrixSocket,
  69. xFormSocket,
  70. RelationshipSocket,
  71. DeformerSocket,
  72. GeometrySocket,
  73. GenericRotationSocket,
  74. EnableSocket,
  75. HideSocket,
  76. # InverseKinematicsSocket,
  77. DriverSocket,
  78. DriverVariableSocket,
  79. FCurveSocket,
  80. # LayerMaskSocket,
  81. # LayerMaskInputSocket,
  82. BoneCollectionSocket,
  83. BoneCollectionInputSocket,
  84. EnumArrayGetOptions,
  85. xFormParameterSocket,
  86. ParameterBoolSocket,
  87. ParameterIntSocket,
  88. ParameterFloatSocket,
  89. ParameterVectorSocket,
  90. ParameterStringSocket,
  91. TransformSpaceSocket,
  92. BooleanSocket,
  93. BooleanThreeTupleSocket,
  94. RotationOrderSocket,
  95. QuaternionSocket,
  96. QuaternionSocketAA,
  97. IntSocket,
  98. StringSocket,
  99. EnumMetaRigSocket,
  100. EnumMetaBoneSocket,
  101. EnumCurveSocket,
  102. BoolUpdateParentNode,
  103. # LabelSocket,
  104. IKChainLengthSocket,
  105. EnumInheritScale,
  106. EnumRotationMix,
  107. EnumRotationMixCopyTransforms,
  108. EnumMaintainVolumeStretchTo,
  109. EnumRotationStretchTo,
  110. EnumTrackAxis,
  111. EnumUpAxis,
  112. EnumLockAxis,
  113. EnumLimitMode,
  114. EnumYScaleMode,
  115. EnumXZScaleMode,
  116. EnumTransformationMap,
  117. EnumTransformationRotationMode,
  118. EnumTransformationRotationOrder,
  119. EnumTransformationTranslationMixMode,
  120. EnumTransformationRotationMixMode,
  121. EnumTransformationScaleMixMode,
  122. EnumTransformationAxes,
  123. EnumBBoneHandleType,
  124. # Deformers
  125. EnumSkinning,
  126. MorphTargetSocket,
  127. #
  128. FloatSocket,
  129. FloatPositiveSocket,
  130. FloatFactorSocket,
  131. FloatAngleSocket,
  132. VectorSocket,
  133. VectorEulerSocket,
  134. VectorTranslationSocket,
  135. VectorScaleSocket,
  136. # Drivers
  137. EnumDriverVariableType,
  138. EnumDriverVariableEvaluationSpace,
  139. EnumDriverVariableTransformChannel,
  140. EnumDriverRotationMode,
  141. EnumDriverType,
  142. KeyframeSocket,
  143. EnumKeyframeInterpolationTypeSocket,
  144. EnumKeyframeBezierHandleTypeSocket,
  145. # Math
  146. MathFloatOperation,
  147. MathVectorOperation,
  148. MatrixTransformOperation,
  149. # Schema
  150. WildcardSocket,
  151. # xFormArraySocket,
  152. # RelationshipArraySocket,
  153. # BooleanArraySocket,
  154. # IntArraySocket,
  155. # FloatArraySocket,
  156. # BooleanThreeTupleArraySocket,
  157. # VectorArraySocket,
  158. # QuaternionArraySocket,
  159. # MatrixArraySocket,
  160. # StringArraySocket,
  161. ]
  162. def Tell_bl_idnames(): # reroute nodes
  163. return [cls.bl_idname for cls in TellClasses()]#+["NodeSocketColor"]
  164. # Was setting color like this:
  165. # color : bpy.props.FloatVectorProperty(size = 4, default = cFCurve,)
  166. # but this didn't work when Blender automatically generated interface classes?
  167. # so changed it to color = cVariable
  168. # but for color-changing sockets, if I make them, this won' work? Maybe?
  169. #
  170. # I actually think I was wrong about all of that lol
  171. # TODO change it back, dingus
  172. ########################################################################
  173. # Update Callbacks
  174. ########################################################################
  175. def default_update(socket, context, do_execute=True):
  176. # return
  177. context = bpy.context
  178. if not context.space_data:
  179. return
  180. if not hasattr(context.space_data, "path"):
  181. return
  182. try:
  183. node_tree = context.space_data.path[0].node_tree
  184. except IndexError: # not in the UI, for example, in a script instead.
  185. node_tree = None
  186. return
  187. if hasattr(socket.node, "initialized"):
  188. if not socket.node.initialized: return
  189. else: return
  190. if node_tree.do_live_update and not (node_tree.is_executing or node_tree.is_exporting):
  191. # I don't know how the tree can be valid at 0 nodes but doesn't hurt
  192. # to force it if this somehow happens.
  193. if ((node_tree.tree_valid == False or len(node_tree.parsed_tree) == 0)
  194. or socket.node.bl_idname in ["MantisNodeGroup"]):
  195. # prGreen("Forcing Update From Socket Change.")
  196. node_tree.update_tree(context)
  197. elif (node_tree.tree_valid == True):
  198. # prGreen("Partial Update From Socket Change.")
  199. # We don't have to update the whole thing, just the socket
  200. from .utilities import tree_from_nc
  201. for nc in node_tree.parsed_tree.values():
  202. try:
  203. if (tree_from_nc(nc.signature, nc.base_tree) == socket.node.id_data):
  204. if socket.node.name in nc.signature:
  205. getstring = socket.name
  206. if (getstring not in nc.parameters.keys()):
  207. prRed("Socket update failed for %s" % socket.name)
  208. else:
  209. nc.parameters[getstring] = socket.default_value
  210. except AttributeError as e:
  211. prWhite(nc)
  212. prWhite(nc.inputs)
  213. raise e
  214. # Now update the tree display:
  215. node_tree.display_update(context)
  216. try:
  217. prPurple("calling Execute Tree from socket update")
  218. node_tree.execute_tree(context)
  219. except Exception as e:
  220. prRed("Automatic Tree Execution failed because of %s" % e)
  221. # I don't want to deal with this right now TODO
  222. # e.__traceback__.print_last() this isn't the same kind of traceback object as the traceback module
  223. # socket.node.is_triggering_execute = True
  224. def update_socket(self, context,):
  225. default_update(self,context)
  226. def update_mute_socket(self, context):
  227. self.node.mute = not self.default_value
  228. default_update(self,context)
  229. def update_hide_socket(self, context):
  230. self.node.mute = self.default_value
  231. default_update(self,context)
  232. def update_parent_node(self, context):
  233. default_update(self,context)
  234. if hasattr(self.node, "display_update"):
  235. self.node.display_update(context)
  236. def ik_chain_length_update_socket(self, context):
  237. default_update(self,context)
  238. # self.node.update_chain_length(context)
  239. # TODO: this is stupid. I don't know what I was trying to do when i made this
  240. # Driver Variable:
  241. def driver_variable_socket_update(self, context):
  242. default_update(self,context)
  243. # self.node.update_on_socket_change(context) # why?
  244. def driver_socket_update(self, context):
  245. default_update(self,context)
  246. # self.node.update_on_socket_change(context) # same here, no idea
  247. def update_metarig_armature(self, context,):
  248. if self.search_prop:
  249. self.node.armature = self.search_prop.name
  250. self.node.inputs["Meta-Bone"].search_prop = self.search_prop
  251. default_update(self,context)
  252. def update_metarig_posebone(self, context,):
  253. self.node.pose_bone = self.default_value
  254. default_update(self,context)
  255. ########################################################################
  256. # Sockets
  257. ########################################################################
  258. def ChooseDraw(self, context, layout, node, text, icon = "NONE", use_enum=True, nice_bool=True, icon_only=False):
  259. # return
  260. # TEXT ONLY
  261. if ( (hasattr(self, "text_only")) and (getattr(self, "text_only") ) ):
  262. layout.label(text=text)
  263. # ENUM VALUES (this is a HACK, fix it later)
  264. elif ('Enum' in self.bl_idname) and (use_enum):
  265. layout.prop_tabs_enum(self, "default_value",)
  266. # for OUTPUT sockets that take INPUT (confusing name!)
  267. elif ((hasattr(self, "default_value")) and hasattr(self, "input") and getattr(self, "input")):
  268. # for simple input nodes
  269. layout.prop(self, "default_value", text=text, toggle=nice_bool, slider=True)
  270. # for INPUTS that are NOT CONNECTED
  271. elif (hasattr(self, "default_value")) and not (self.is_output or self.is_linked):
  272. # DO: expose these values as parameters for this function
  273. # and set them for each socket.
  274. if icon == 'NONE': icon_only = False
  275. elif icon_only == True : text = "" # "real" icon-only looks bad for strings, need to check other props types.
  276. layout.prop(self, "default_value", text=text, toggle=nice_bool, slider=True, icon=icon,)
  277. # CONNECTED sockets and outputs without input fields
  278. else:
  279. layout.label(text=text)
  280. class RelationshipSocket(NodeSocket):
  281. # Description string
  282. '''Relationship'''
  283. # Optional identifier string. If not explicitly defined, the python class name is used.
  284. bl_idname = 'RelationshipSocket'
  285. bl_label = "Relationship"
  286. color_simple = cRelationship
  287. color : bpy.props.FloatVectorProperty(default=cRelationship, size=4)
  288. input : bpy.props.BoolProperty(default =False,)
  289. def draw(self, context, layout, node, text):
  290. ChooseDraw(self, context, layout, node, text)
  291. def draw_color(self, context, node):
  292. return self.color
  293. @classmethod
  294. def draw_color_simple(self):
  295. return self.color_simple
  296. class DeformerSocket(NodeSocket):
  297. # Description string
  298. '''Deformer'''
  299. # Optional identifier string. If not explicitly defined, the python class name is used.
  300. bl_idname = 'DeformerSocket'
  301. bl_label = "Deformer"
  302. color_simple = cDeformer
  303. color : bpy.props.FloatVectorProperty(default=cDeformer, size=4)
  304. input : bpy.props.BoolProperty(default =False,)
  305. def draw(self, context, layout, node, text):
  306. ChooseDraw(self, context, layout, node, text)
  307. def draw_color(self, context, node):
  308. return self.color
  309. @classmethod
  310. def draw_color_simple(self):
  311. return self.color_simple
  312. class MatrixSocket(NodeSocket):
  313. '''Matrix Input Output'''
  314. bl_idname = 'MatrixSocket'
  315. bl_label = "Matrix"
  316. default_value : bpy.props.FloatVectorProperty(
  317. default = (1.0, 0.0, 0.0, 0.0,
  318. 0.0, 1.0, 0.0, 0.0,
  319. 0.0, 0.0, 1.0, 0.0,
  320. 0.0, 0.0, 0.0, 1.0),
  321. size=16,
  322. update = update_socket,)
  323. color_simple = cMatrix
  324. color : bpy.props.FloatVectorProperty(default=cMatrix, size=4)
  325. input : bpy.props.BoolProperty(default =False,)
  326. # Optional function for drawing the socket input value
  327. def draw(self, context, layout, node, text):
  328. layout.label(text=text)
  329. def draw_color(self, context, node):
  330. return self.color
  331. @classmethod
  332. def draw_color_simple(self):
  333. return self.color_simple
  334. # Utility functions to make handling the 16 numbers more bearable
  335. def SetValue(self, mat):
  336. self.default_value = ( mat[0][0], mat[0][1], mat[0][2], mat[0][3],
  337. mat[1][0], mat[1][1], mat[1][2], mat[1][3],
  338. mat[2][0], mat[2][1], mat[2][2], mat[2][3],
  339. mat[3][0], mat[3][1], mat[3][2], mat[3][3], )
  340. def TellValue(self):
  341. from mathutils import Matrix
  342. v = self.default_value
  343. return Matrix( ( ( v[ 0], v[ 1], v[ 2], v[ 3],),
  344. ( v[ 4], v[ 5], v[ 6], v[ 7],),
  345. ( v[ 8], v[ 9], v[10], v[11],),
  346. ( v[12], v[13], v[14], v[15]), ) )
  347. #NOTE, we're not using the last row
  348. # so we're gonna use it to store data
  349. # unused, unused, unused, bone_length
  350. # but we're not going to make it
  351. # available except by accessor functions
  352. # would like to make this stuff easier to deal with tho
  353. def TellBoneLength(self):
  354. return self.default_value[15]
  355. class xFormSocket(NodeSocket):
  356. '''xFrom Input Output'''
  357. bl_idname = 'xFormSocket'
  358. bl_label = "xForm"
  359. color_simple = cxForm
  360. color : bpy.props.FloatVectorProperty(default=cxForm, size=4)
  361. input : bpy.props.BoolProperty(default =False,)
  362. def draw(self, context, layout, node, text):
  363. ChooseDraw(self, context, layout, node, text)
  364. def draw_color(self, context, node):
  365. return self.color
  366. @classmethod
  367. def draw_color_simple(self):
  368. return self.color_simple
  369. class GeometrySocket(NodeSocket):
  370. '''Geometry Input Output'''
  371. bl_idname = 'GeometrySocket'
  372. bl_label = "Geometry"
  373. color_simple = cGeometry
  374. color : bpy.props.FloatVectorProperty(default=cGeometry, size=4)
  375. input : bpy.props.BoolProperty(default =False,)
  376. def draw(self, context, layout, node, text):
  377. ChooseDraw(self, context, layout, node, text)
  378. def draw_color(self, context, node):
  379. return self.color
  380. @classmethod
  381. def draw_color_simple(self):
  382. return self.color_simple
  383. class GenericRotationSocket(NodeSocket):
  384. '''Custom node socket type'''
  385. bl_idname = 'GenericRotationSocket'
  386. bl_label = "Rotation"
  387. color = (0.0,0.0,0.0,0.0)
  388. input : bpy.props.BoolProperty(default =False,)
  389. def draw(self, context, layout, node, text):
  390. ChooseDraw(self, context, layout, node, text)
  391. def draw_color(self, context, node):
  392. return self.color
  393. @classmethod
  394. def draw_color_simple(self):
  395. return self.color_simple
  396. ###############################
  397. class EnableSocket(NodeSocket):
  398. '''Custom node socket type'''
  399. bl_idname = 'EnableSocket'
  400. bl_label = "Enable"
  401. default_value: bpy.props.BoolProperty(default=True, update = update_mute_socket,)
  402. color_simple = cEnable
  403. color : bpy.props.FloatVectorProperty(default=cEnable, size=4)
  404. input : bpy.props.BoolProperty(default =False,)
  405. def draw(self, context, layout, node, text):
  406. ChooseDraw(self, context, layout, node, text, nice_bool=False)
  407. def draw_color(self, context, node):
  408. return self.color
  409. @classmethod
  410. def draw_color_simple(self):
  411. return self.color_simple
  412. class HideSocket(NodeSocket):
  413. '''Custom node socket type'''
  414. bl_idname = 'HideSocket'
  415. bl_label = "Hide"
  416. default_value: bpy.props.BoolProperty(default=False, update = update_hide_socket,)
  417. color_simple = cEnable
  418. color : bpy.props.FloatVectorProperty(default=cEnable, size=4)
  419. input : bpy.props.BoolProperty(default =False,)
  420. def draw(self, context, layout, node, text):
  421. ChooseDraw(self, context, layout, node, text, nice_bool=False)
  422. def draw_color(self, context, node):
  423. return self.color
  424. @classmethod
  425. def draw_color_simple(self):
  426. return self.color_simple
  427. class FCurveSocket(NodeSocket):
  428. '''fCurve'''
  429. bl_idname = 'FCurveSocket'
  430. bl_label = "fCurve"
  431. color_simple = cFCurve
  432. color : bpy.props.FloatVectorProperty(default=cFCurve, size=4)
  433. input : bpy.props.BoolProperty(default =False, update = update_socket)
  434. def init(self):
  435. self.display_shape = 'CIRCLE_DOT'
  436. def draw(self, context, layout, node, text):
  437. ChooseDraw(self, context, layout, node, text)
  438. def draw_color(self, context, node):
  439. return self.color
  440. @classmethod
  441. def draw_color_simple(self):
  442. return self.color_simple
  443. class DriverSocket(NodeSocket):
  444. '''Driver'''
  445. bl_idname = 'DriverSocket'
  446. bl_label = "Driver"
  447. color_simple = cDriver
  448. color : bpy.props.FloatVectorProperty(default=cDriver, size=4)
  449. input : bpy.props.BoolProperty(default =False, update = update_socket)
  450. def init(self):
  451. self.display_shape = 'CIRCLE_DOT'
  452. def draw(self, context, layout, node, text):
  453. ChooseDraw(self, context, layout, node, text)
  454. def draw_color(self, context, node):
  455. return self.color
  456. @classmethod
  457. def draw_color_simple(self):
  458. return self.color_simple
  459. class DriverVariableSocket(NodeSocket):
  460. '''Driver'''
  461. bl_idname = 'DriverVariableSocket'
  462. bl_label = "Driver Variable"
  463. color_simple = cDriverVariable
  464. color : bpy.props.FloatVectorProperty(default=cDriverVariable, size=4)
  465. input : bpy.props.BoolProperty(default =False, update = update_socket)
  466. def init(self):
  467. self.display_shape = 'CIRCLE_DOT'
  468. def draw(self, context, layout, node, text):
  469. ChooseDraw(self, context, layout, node, text)
  470. def draw_color(self, context, node):
  471. return self.color
  472. @classmethod
  473. def draw_color_simple(self):
  474. return self.color_simple
  475. # transform_spaces
  476. # transform_spaces_bone_object
  477. # transform_spaces_object
  478. # def get_transform_space_enum(self, context):
  479. # pass
  480. class TransformSpaceSocket(NodeSocket):
  481. '''Custom node socket type'''
  482. bl_idname = 'TransformSpaceSocket'
  483. bl_label = "Transform Space"
  484. default_value: bpy.props.EnumProperty(
  485. name="Space Transform",
  486. description="Space Transform",
  487. items=transform_spaces,
  488. default='WORLD',
  489. update = update_socket,)
  490. color_simple = cTransformSpace
  491. color : bpy.props.FloatVectorProperty(default=cTransformSpace, size=4)
  492. input : bpy.props.BoolProperty(default =False,)
  493. def draw(self, context, layout, node, text):
  494. ChooseDraw(self, context, layout, node, text)
  495. def draw_color(self, context, node):
  496. return self.color
  497. @classmethod
  498. def draw_color_simple(self):
  499. return self.color_simple
  500. class BooleanSocket(NodeSocket):
  501. '''Custom node socket type'''
  502. bl_idname = 'BooleanSocket'
  503. bl_label = "Boolean"
  504. default_value: bpy.props.BoolProperty(update = update_socket,)
  505. color_simple = cBool
  506. color : bpy.props.FloatVectorProperty(default=cBool, size=4)
  507. input : bpy.props.BoolProperty(default =False,)
  508. def draw(self, context, layout, node, text):
  509. ChooseDraw(self, context, layout, node, text)
  510. def draw_color(self, context, node):
  511. return self.color
  512. @classmethod
  513. def draw_color_simple(self):
  514. return self.color_simple
  515. class BooleanThreeTupleSocket(NodeSocket):
  516. # Description string
  517. '''Custom node socket type'''
  518. # Optional identifier string. If not explicitly defined, the python class name is used.
  519. bl_idname = 'BooleanThreeTupleSocket'
  520. bl_label = "Boolean Vector"
  521. default_value: bpy.props.BoolVectorProperty(subtype = "XYZ",update = update_socket,)
  522. color_simple = cBool3
  523. color : bpy.props.FloatVectorProperty(default=cBool3, size=4)
  524. input : bpy.props.BoolProperty(default =False,)
  525. def draw(self, context, layout, node, text):
  526. ChooseDraw(self, context, layout, node, text)
  527. def draw_color(self, context, node):
  528. return self.color
  529. @classmethod
  530. def draw_color_simple(self):
  531. return self.color_simple
  532. def TellValue(self):
  533. return (self.default_value[0], self.default_value[1], self.default_value[2])
  534. class RotationOrderSocket(NodeSocket):
  535. '''Custom node socket type'''
  536. bl_idname = 'RotationOrderSocket'
  537. bl_label = "Rotation Order"
  538. default_value: bpy.props.EnumProperty(
  539. name="Rotation Order",
  540. description="Rotation Order",
  541. items=enumRotationOrder,
  542. default='AUTO',
  543. update = update_socket,)
  544. color_simple = cRotationOrder
  545. color : bpy.props.FloatVectorProperty(default=cRotationOrder, size=4)
  546. input : bpy.props.BoolProperty(default =False,)
  547. def draw(self, context, layout, node, text):
  548. ChooseDraw(self, context, layout, node, text)
  549. def draw_color(self, context, node):
  550. return self.color
  551. @classmethod
  552. def draw_color_simple(self):
  553. return self.color_simple
  554. class QuaternionSocket(NodeSocket):
  555. '''Custom node socket type'''
  556. bl_idname = 'QuaternionSocket'
  557. bl_label = "Quaternion"
  558. default_value: bpy.props.FloatVectorProperty(
  559. subtype = "QUATERNION",
  560. size = 4,
  561. default = (1.0, 0.0, 0.0, 0.0,),
  562. update = update_socket,)
  563. color_simple = cQuaternion
  564. color : bpy.props.FloatVectorProperty(default=cQuaternion, size=4)
  565. input : bpy.props.BoolProperty(default =False,)
  566. def draw(self, context, layout, node, text):
  567. ChooseDraw(self, context, layout, node, text)
  568. def draw_color(self, context, node):
  569. return self.color
  570. @classmethod
  571. def draw_color_simple(self):
  572. return self.color_simple
  573. class QuaternionSocketAA(NodeSocket):
  574. '''Custom node socket type'''
  575. bl_idname = 'QuaternionSocketAA'
  576. bl_label = "Axis Angle Quaternion"
  577. color_simple = cQuaternion
  578. color : bpy.props.FloatVectorProperty(default=cQuaternion, size=4)
  579. input : bpy.props.BoolProperty(default =False,)
  580. default_value: bpy.props.FloatVectorProperty(
  581. subtype = "AXISANGLE",
  582. size = 4,
  583. default = (1.0, 0.0, 0.0, 0.0,),
  584. update = update_socket,)
  585. def draw(self, context, layout, node, text):
  586. ChooseDraw(self, context, layout, node, text)
  587. def draw_color(self, context, node):
  588. return self.color
  589. @classmethod
  590. def draw_color_simple(self):
  591. return self.color_simple
  592. class IntSocket(NodeSocket):
  593. '''Custom node socket type'''
  594. bl_idname = 'IntSocket'
  595. bl_label = "Integer"
  596. default_value: bpy.props.IntProperty(default=0, update = update_socket,)
  597. color_simple = cInt
  598. color : bpy.props.FloatVectorProperty(default=cInt, size=4)
  599. input : bpy.props.BoolProperty(default =False,)
  600. def draw(self, context, layout, node, text):
  601. ChooseDraw(self, context, layout, node, text)
  602. def draw_color(self, context, node):
  603. return self.color
  604. @classmethod
  605. def draw_color_simple(self):
  606. return self.color_simple
  607. class StringSocket(bpy.types.NodeSocketString):
  608. """Float Input socket"""
  609. bl_idname = 'StringSocket'
  610. bl_label = "String"
  611. default_value : bpy.props.StringProperty(default = "", update = update_socket,)
  612. # text_only : bpy.props.BoolProperty(default=False)
  613. color_simple = cString
  614. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  615. icon : bpy.props.StringProperty(default = "NONE",)
  616. input : bpy.props.BoolProperty(default =False,)
  617. # def init(self):
  618. # if self.node.bl_idname == 'UtilityBoneProperties':
  619. # self.display_shape='CIRCLE_DOT'
  620. def draw(self, context, layout, node, text):
  621. ChooseDraw(self, context, layout, node, text, icon=self.icon, icon_only=True)
  622. def draw_color(self, context, node):
  623. return self.color
  624. @classmethod
  625. def draw_color_simple(self):
  626. return self.color_simple
  627. # class LayerMaskSocket(bpy.types.NodeSocket):
  628. # """Layer Mask Input socket"""
  629. # bl_idname = 'LayerMaskSocket'
  630. # bl_label = "Layer Mask"
  631. # default_value: bpy.props.BoolVectorProperty(subtype = "LAYER", update = update_socket, size=32)
  632. # color_simple = cBoneCollection
  633. color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)
  634. # input : bpy.props.BoolProperty(default =False,)
  635. # def draw(self, context, layout, node, text):
  636. # ChooseDraw(self, context, layout, node, text)
  637. # def draw_color(self, context, node):
  638. # return self.color
  639. # class LayerMaskInputSocket(bpy.types.NodeSocket): # I can probably use inheritance somehow lol
  640. # """Layer Mask Input socket"""
  641. # bl_idname = 'LayerMaskInputSocket'
  642. # bl_label = "Layer Mask"
  643. # default_value: bpy.props.BoolVectorProperty(subtype = "LAYER", update = update_socket, size=32)
  644. # color_simple = cBoneCollection
  645. color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)
  646. # input : bpy.props.BoolProperty(default =True,)
  647. # def draw(self, context, layout, node, text):
  648. # ChooseDraw(self, context, layout, node, text)
  649. # def draw_color(self, context, node):
  650. # return self.color
  651. class BoneCollectionSocket(bpy.types.NodeSocket):
  652. """Bone Collection socket"""
  653. bl_idname = 'BoneCollectionSocket'
  654. bl_label = "Bone Collection"
  655. default_value: bpy.props.StringProperty(default = "Collection", update = update_socket,)
  656. input : bpy.props.BoolProperty(default =False,)
  657. color_simple = cBoneCollection
  658. color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)
  659. def draw(self, context, layout, node, text):
  660. ChooseDraw(self, context, layout, node, text)
  661. def draw_color(self, context, node):
  662. return self.color
  663. @classmethod
  664. def draw_color_simple(self):
  665. return self.color_simple
  666. class BoneCollectionInputSocket(bpy.types.NodeSocket):
  667. """Bone Collection Input Socket"""
  668. bl_idname = 'BoneCollectionInputSocket'
  669. bl_label = "Bone Collection"
  670. default_value: bpy.props.StringProperty(default = "Collection", update = update_socket,)
  671. input : bpy.props.BoolProperty(default =True,)
  672. color_simple = cBoneCollection
  673. color : bpy.props.FloatVectorProperty(default=cBoneCollection, size=4)
  674. def draw(self, context, layout, node, text):
  675. ChooseDraw(self, context, layout, node, text)
  676. def draw_color(self, context, node):
  677. return self.color
  678. @classmethod
  679. def draw_color_simple(self):
  680. return self.color_simple
  681. eArrayGetOptions =(
  682. ('CAP', "Cap", "Fail if the index is out of bounds."),
  683. ('WRAP', "Wrap", "Wrap around to the beginning of the array once the idex goes out of bounds."),
  684. ('HOLD', "Hold", "Reuse the last element of the array if the index is out of bounds."),)
  685. class EnumArrayGetOptions(NodeSocket):
  686. '''Custom node socket type'''
  687. bl_idname = 'EnumArrayGetOptions'
  688. bl_label = "OoB Behaviour"
  689. default_value: bpy.props.EnumProperty(
  690. items=eArrayGetOptions,
  691. name="OoB Behaviour",
  692. description="Out-of-bounds behaviour.",
  693. default = 'HOLD',
  694. update = update_socket,)
  695. color_simple = cString
  696. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  697. input : bpy.props.BoolProperty(default =False,)
  698. def draw(self, context, layout, node, text):
  699. ChooseDraw(self, context, layout, node, text)
  700. def draw_color(self, context, node):
  701. return self.color
  702. @classmethod
  703. def draw_color_simple(self):
  704. return self.color_simple
  705. #####################################################################################
  706. # Parameters
  707. #####################################################################################
  708. class xFormParameterSocket(NodeSocket):
  709. '''xFrom Parameter'''
  710. bl_idname = 'xFormParameterSocket'
  711. bl_label = "sForm Parameter"
  712. color_simple = cxForm
  713. color : bpy.props.FloatVectorProperty(default=cxForm, size=4)
  714. input : bpy.props.BoolProperty(default =False,)
  715. def init(self):
  716. self.display_shape = 'CIRCLE_DOT'
  717. def draw(self, context, layout, node, text):
  718. ChooseDraw(self, context, layout, node, text)
  719. def draw_color(self, context, node):
  720. return self.color
  721. @classmethod
  722. def draw_color_simple(self):
  723. return self.color_simple
  724. # what is this one again?
  725. class ParameterBoolSocket(bpy.types.NodeSocket):
  726. """Boolean Parameter Socket"""
  727. bl_idname = 'ParameterBoolSocket'
  728. bl_label = "Boolean Parameter"
  729. color_simple = cBool
  730. color : bpy.props.FloatVectorProperty(default=cBool, size=4)
  731. input : bpy.props.BoolProperty(default =False,)
  732. #custom properties:
  733. min:bpy.props.FloatProperty(default = 0)
  734. max:bpy.props.FloatProperty(default = 1)
  735. soft_min:bpy.props.FloatProperty(default = 0)
  736. soft_max:bpy.props.FloatProperty(default = 1)
  737. description:bpy.props.StringProperty(default = "")
  738. default_value : bpy.props.BoolProperty(default = False, update = update_socket,)
  739. def init(self):
  740. self.display_shape = 'CIRCLE_DOT'
  741. # if True:
  742. # print (self.is_property_set("default_value"))
  743. # ui_data = self.id_properties_ui("default_value")
  744. # ui_data.update(
  745. # description=self.description,
  746. # default=0,) # for now
  747. # ui_data.update(
  748. # min = self.min,
  749. # max = self.max,
  750. # soft_min = self.soft_min,
  751. # soft_max = self.soft_max,)
  752. def draw(self, context, layout, node, text):
  753. ChooseDraw(self, context, layout, node, text)
  754. def draw_color(self, context, node):
  755. return self.color
  756. @classmethod
  757. def draw_color_simple(self):
  758. return self.color_simple
  759. class ParameterIntSocket(bpy.types.NodeSocket):
  760. """Integer Parameter socket"""
  761. bl_idname = 'ParameterIntSocket'
  762. bl_label = "Integer Parameter"
  763. default_value : bpy.props.IntProperty(default = 0, update = update_socket,)
  764. color_simple = cInt
  765. color : bpy.props.FloatVectorProperty(default=cInt, size=4)
  766. input : bpy.props.BoolProperty(default =False,)
  767. #custom properties:
  768. min:bpy.props.FloatProperty(default = 0)
  769. max:bpy.props.FloatProperty(default = 1)
  770. soft_min:bpy.props.FloatProperty(default = 0)
  771. soft_max:bpy.props.FloatProperty(default = 1)
  772. description:bpy.props.StringProperty(default = "")
  773. def init(self):
  774. self.display_shape = 'CIRCLE_DOT'
  775. def draw(self, context, layout, node, text):
  776. ChooseDraw(self, context, layout, node, text)
  777. def draw_color(self, context, node):
  778. return self.color
  779. @classmethod
  780. def draw_color_simple(self):
  781. return self.color_simple
  782. class ParameterFloatSocket(bpy.types.NodeSocket):
  783. """Float Parameter socket"""
  784. bl_idname = 'ParameterFloatSocket'
  785. bl_label = "Float Parameter"
  786. default_value : bpy.props.FloatProperty(default = 0.0, update = update_socket,)
  787. color_simple = cFloat
  788. color : bpy.props.FloatVectorProperty(default=cFloat, size=4)
  789. input : bpy.props.BoolProperty(default =False,)
  790. #custom properties:
  791. min:bpy.props.FloatProperty(default = 0)
  792. max:bpy.props.FloatProperty(default = 1)
  793. soft_min:bpy.props.FloatProperty(default = 0)
  794. soft_max:bpy.props.FloatProperty(default = 1)
  795. description:bpy.props.StringProperty(default = "")
  796. def init(self):
  797. self.display_shape = 'CIRCLE_DOT'
  798. def draw(self, context, layout, node, text):
  799. ChooseDraw(self, context, layout, node, text)
  800. def draw_color(self, context, node):
  801. return self.color
  802. @classmethod
  803. def draw_color_simple(self):
  804. return self.color_simple
  805. class ParameterVectorSocket(bpy.types.NodeSocket):
  806. """Vector Parameter socket"""
  807. bl_idname = 'ParameterVectorSocket'
  808. bl_label = "Vector Parameter"
  809. default_value : bpy.props.FloatVectorProperty(
  810. default = (0.0, 0.0, 0.0),
  811. update = update_socket,)
  812. color_simple = cVector
  813. color : bpy.props.FloatVectorProperty(default=cVector, size=4)
  814. input : bpy.props.BoolProperty(default =False,)
  815. #custom properties:
  816. description:bpy.props.StringProperty(default = "")
  817. def init(self):
  818. self.display_shape = 'CIRCLE_DOT'
  819. def draw(self, context, layout, node, text):
  820. ChooseDraw(self, context, layout, node, text)
  821. def draw_color(self, context, node):
  822. return self.color
  823. @classmethod
  824. def draw_color_simple(self):
  825. return self.color_simple
  826. class ParameterStringSocket(bpy.types.NodeSocket):
  827. """String Parameter socket"""
  828. bl_idname = 'ParameterStringSocket'
  829. bl_label = "String Parameter"
  830. default_value : bpy.props.StringProperty(default = "", update = update_socket,)
  831. color_simple = cString
  832. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  833. input : bpy.props.BoolProperty(default =False,)
  834. text_only : bpy.props.BoolProperty(default=False)
  835. #custom properties:
  836. description:bpy.props.StringProperty(default = "")
  837. def init(self):
  838. self.display_shape = 'CIRCLE_DOT'
  839. def draw(self, context, layout, node, text):
  840. ChooseDraw(self, context, layout, node, text)
  841. def draw_color(self, context, node):
  842. return self.color
  843. @classmethod
  844. def draw_color_simple(self):
  845. return self.color_simple
  846. #####################################################################################
  847. # Additional socket types, for special cases
  848. #####################################################################################
  849. from bpy.props import PointerProperty, StringProperty
  850. def poll_is_armature(self, obj):
  851. return obj.type == "ARMATURE"
  852. # def poll_is_armature(self, obj):
  853. # return obj.type == "ARMATURE"
  854. class EnumMetaRigSocket(NodeSocket):
  855. '''Custom node socket type'''
  856. bl_idname = 'EnumMetaRigSocket'
  857. bl_label = "Meta Rig"
  858. search_prop:PointerProperty(type=bpy.types.Object, poll=poll_is_armature, update=update_metarig_armature)
  859. def get_default_value(self):
  860. if self.search_prop:
  861. return self.search_prop.name
  862. return ""
  863. default_value : StringProperty(name = "", get=get_default_value)
  864. color_simple = cString
  865. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  866. def draw(self, context, layout, node, text):
  867. if not (self.is_linked):
  868. layout.prop_search(data=self, property="search_prop", search_data=bpy.data, search_property="objects", text="", icon="OUTLINER_OB_ARMATURE", results_are_suggestions=True)
  869. else:
  870. layout.label(text=self.node.armature)
  871. def draw_color(self, context, node):
  872. return self.color
  873. @classmethod
  874. def draw_color_simple(self):
  875. return self.color_simple
  876. def poll_is_curve(self, obj):
  877. return obj.type == "CURVE"
  878. class EnumCurveSocket(NodeSocket):
  879. '''Choose a curve'''
  880. bl_idname = 'EnumCurveSocket'
  881. bl_label = "Curve"
  882. search_prop:PointerProperty(type=bpy.types.Object, poll=poll_is_curve, update=update_socket)
  883. def get_default_value(self):
  884. if self.search_prop:
  885. return self.search_prop.name
  886. return ""
  887. default_value : StringProperty(name = "", get=get_default_value)
  888. color_simple = cString
  889. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  890. def draw(self, context, layout, node, text):
  891. if not (self.is_linked):
  892. layout.prop_search(data=self, property="search_prop", search_data=bpy.data, search_property="objects", text="", icon="OUTLINER_OB_ARMATURE", results_are_suggestions=True)
  893. else:
  894. try:
  895. layout.label(text=self.search_prop.name)
  896. except AttributeError: # TODO make this show the graph's result
  897. layout.label(text="")
  898. def draw_color(self, context, node):
  899. return self.color
  900. @classmethod
  901. def draw_color_simple(self):
  902. return self.color_simple
  903. def SearchPBDraw(self, context, layout, node, text, icon = "NONE", use_enum=True, nice_bool=True, icon_only=False):
  904. 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)
  905. class EnumMetaBoneSocket(NodeSocket):
  906. '''Custom node socket type'''
  907. bl_idname = 'EnumMetaBoneSocket'
  908. bl_label = "Meta Bone"
  909. search_prop:PointerProperty(type=bpy.types.Object)
  910. bone:StringProperty()
  911. def populate_bones_list(self, context):
  912. # just gonna hardcode the value
  913. if (meta_rig := self.search_prop):
  914. retList = []
  915. armatures = []
  916. i = -1
  917. retList.append( ('NONE', '', '', 'NONE', i:=i+1 ) )
  918. for b in meta_rig.data.bones:
  919. retList.append( (b.name, b.name, "Bone to copy matrix from", "BONE_DATA", i:=i+1 ) )
  920. return(retList)
  921. return None
  922. # default_value : bpy.props.EnumProperty(
  923. # items = populate_bones_list,
  924. # name = "Meta Rig")
  925. # def get_default_value(self):
  926. # return self.search_prop.name
  927. default_value : StringProperty(name = "", update=update_metarig_posebone)
  928. color_simple = cString
  929. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  930. def draw(self, context, layout, node, text):
  931. if not (self.is_linked):
  932. if self.search_prop is None:
  933. layout.prop(self, "default_value", text="", icon="BONE_DATA",)
  934. else:
  935. SearchPBDraw(self, context, layout, node, text="")
  936. else:
  937. layout.label(text=self.node.pose_bone)
  938. def draw_color(self, context, node):
  939. return self.color
  940. @classmethod
  941. def draw_color_simple(self):
  942. return self.color_simple
  943. class BoolUpdateParentNode(NodeSocket):
  944. '''Custom node socket type'''
  945. bl_idname = 'BoolUpdateParentNode'
  946. bl_label = "Boolean"
  947. default_value: bpy.props.BoolProperty(default=False, update = update_parent_node)
  948. color_simple = cBool
  949. color : bpy.props.FloatVectorProperty(default=cBool, size=4)
  950. input : bpy.props.BoolProperty(default =False,)
  951. def draw(self, context, layout, node, text):
  952. ChooseDraw(self, context, layout, node, text)
  953. def draw_color(self, context, node):
  954. return self.color
  955. @classmethod
  956. def draw_color_simple(self):
  957. return self.color_simple
  958. # class LabelSocket(bpy.types.NodeSocket):
  959. # """Float Input socket"""
  960. # bl_idname = 'LabelSocket'
  961. # bl_label = "Label"
  962. # color = (0.000, 0.000, 0.000, 0.000000)
  963. # input : bpy.props.BoolProperty(default =False,)
  964. # def draw(self, context, layout, node, text):
  965. # ChooseDraw(self, context, layout, node, text)
  966. # def draw_color(self, context, node):
  967. # return self.color
  968. # @classmethod
  969. # def draw_color_simple(self):
  970. # return self.color
  971. class IKChainLengthSocket(NodeSocket):
  972. '''Custom node socket type'''
  973. bl_idname = 'IKChainLengthSocket'
  974. bl_label = "IK Chain Length"
  975. default_value: bpy.props.IntProperty(default=0, update = ik_chain_length_update_socket, min = 0, max = 255)
  976. color_simple = cInt
  977. color : bpy.props.FloatVectorProperty(default=cInt, size=4)
  978. input : bpy.props.BoolProperty(default =False,)
  979. def draw(self, context, layout, node, text):
  980. ChooseDraw(self, context, layout, node, text)
  981. def draw_color(self, context, node):
  982. return self.color
  983. @classmethod
  984. def draw_color_simple(self):
  985. return self.color_simple
  986. # Inherit
  987. eInheritScale = (
  988. ('FULL', "Full", "Fully inherit scale", 1),
  989. ('AVERAGE', "Average", "todo", 2),
  990. ('ALIGNED', "Aligned", "todo", 3),
  991. ('FIX_SHEAR', "Fix Shear", "todo", 4),
  992. ('NONE', "None", "todo", 5),
  993. )
  994. class EnumInheritScale(NodeSocket):
  995. '''Custom node socket type'''
  996. bl_idname = 'EnumInheritScale'
  997. bl_label = "Inherit Scale"
  998. default_value: bpy.props.EnumProperty(
  999. items=eInheritScale,
  1000. name="Inherit Scale",
  1001. description="Inherit Scale",
  1002. default = 'FULL',
  1003. #options = set(),
  1004. update = update_socket,)
  1005. color_simple = cString
  1006. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1007. input : bpy.props.BoolProperty(default =False,)
  1008. def draw(self, context, layout, node, text):
  1009. ChooseDraw(self, context, layout, node, text)
  1010. def draw_color(self, context, node):
  1011. return self.color
  1012. @classmethod
  1013. def draw_color_simple(self):
  1014. return self.color_simple
  1015. # Copy Rotation
  1016. eRotationMix =(
  1017. ('REPLACE', "Replace", "Fully inherit scale", 0),
  1018. ('BEFORE', "Before", "Fully inherit scale", 1),
  1019. ('AFTER', "After", "Fully inherit scale", 2),
  1020. ('ADD', "Add", "Fully inherit scale", 3),
  1021. #todo, but i don't care much
  1022. )
  1023. # TODO HACK
  1024. # I am trying to figure out how to do enum_flag as
  1025. # mutually exclusive options
  1026. # but! I don't think it's possible
  1027. # I just like the UI for it :P
  1028. class EnumRotationMix(NodeSocket):
  1029. '''Custom node socket type'''
  1030. bl_idname = 'EnumRotationMix'
  1031. bl_label = "Rotation Mix"
  1032. default_value: bpy.props.EnumProperty(
  1033. items=eRotationMix,
  1034. name="Rotation Mix",
  1035. description="Rotation Mix",
  1036. default = 'REPLACE',#{'REPLACE'},
  1037. options = set(), # this has to be a set lol
  1038. update = update_socket,)
  1039. color_simple = cString
  1040. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1041. input : bpy.props.BoolProperty(default =False,)
  1042. def draw(self, context, layout, node, text):
  1043. ChooseDraw(self, context, layout, node, text)
  1044. def draw_color(self, context, node):
  1045. return self.color
  1046. @classmethod
  1047. def draw_color_simple(self):
  1048. return self.color_simple
  1049. eRotationMix_copytransforms =(
  1050. ('REPLACE', "Replace", "Fully inherit scale"),
  1051. ('BEFORE', "Before", "Fully inherit scale"),
  1052. ('AFTER', "After", "Fully inherit scale"),)
  1053. class EnumRotationMixCopyTransforms(NodeSocket):
  1054. '''Custom node socket type'''
  1055. bl_idname = 'EnumRotationMixCopyTransforms'
  1056. bl_label = "Rotation Mix"
  1057. default_value: bpy.props.EnumProperty(
  1058. items=eRotationMix_copytransforms,
  1059. name="Rotation Mix",
  1060. description="Rotation Mix",
  1061. default = 'REPLACE', #{'REPLACE'},
  1062. #options = {'ENUM_FLAG'}, # this sux
  1063. update = update_socket,)
  1064. color_simple = cString
  1065. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1066. input : bpy.props.BoolProperty(default =False,)
  1067. def draw(self, context, layout, node, text):
  1068. ChooseDraw(self, context, layout, node, text)
  1069. def draw_color(self, context, node):
  1070. return self.color
  1071. @classmethod
  1072. def draw_color_simple(self):
  1073. return self.color_simple
  1074. # STRETCH TO
  1075. eMaintainVolumeStretchTo = (('VOLUME_XZX', "XZ", "XZ", 1),
  1076. ('VOLUME_X', "X", "X", 2),
  1077. ('VOLUME_Z', "Z", "Z", 4),
  1078. ('NO_VOLUME', "None", "None", 8),)
  1079. class EnumMaintainVolumeStretchTo(NodeSocket):
  1080. '''Custom node socket type'''
  1081. bl_idname = 'EnumMaintainVolumeStretchToSocket'
  1082. bl_label = "Maintain Volume"
  1083. default_value: bpy.props.EnumProperty(
  1084. items=eMaintainVolumeStretchTo,
  1085. name="Maintain Volume",
  1086. description="Maintain Volume",
  1087. default = 'VOLUME_XZX',
  1088. #options = {'ENUM_FLAG'},
  1089. update = update_socket,)
  1090. color_simple = cString
  1091. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1092. input : bpy.props.BoolProperty(default =False,)
  1093. def draw(self, context, layout, node, text):
  1094. ChooseDraw(self, context, layout, node, text)
  1095. def draw_color(self, context, node):
  1096. return self.color
  1097. @classmethod
  1098. def draw_color_simple(self):
  1099. return self.color_simple
  1100. eRotationStretchTo = (('PLANE_X', "XZ", "XZ", 1),
  1101. ('PLANE_Z', "ZX", "ZX", 2),
  1102. ('SWING_Y', "Swing", "Swing", 4),)
  1103. class EnumRotationStretchTo(NodeSocket):
  1104. '''Custom node socket type'''
  1105. bl_idname = 'EnumRotationStretchTo'
  1106. bl_label = "Rotation"
  1107. default_value: bpy.props.EnumProperty(
  1108. items=eRotationStretchTo,
  1109. name="Rotation",
  1110. description="Rotation",
  1111. default = 'PLANE_X',
  1112. #options = {'ENUM_FLAG'},
  1113. update = update_socket,)
  1114. color_simple = cString
  1115. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1116. input : bpy.props.BoolProperty(default =False,)
  1117. def draw(self, context, layout, node, text):
  1118. ChooseDraw(self, context, layout, node, text)
  1119. def draw_color(self, context, node):
  1120. return self.color
  1121. @classmethod
  1122. def draw_color_simple(self):
  1123. return self.color_simple
  1124. # Track-To
  1125. eTrackAxis = (('TRACK_X', "X", "X", 1),
  1126. ('TRACK_Y', "Y", "Y", 2),
  1127. ('TRACK_Z', "Z", "Z", 4),
  1128. ('TRACK_NEGATIVE_X', "-X", "-X", 8),
  1129. ('TRACK_NEGATIVE_Y', "-Y", "-Y", 16),
  1130. ('TRACK_NEGATIVE_Z', "-Z", "-Z", 32,))
  1131. eUpAxis = (('UP_X', "X", "X", 1),
  1132. ('UP_Y', "Y", "Y", 2),
  1133. ('UP_Z', "Z", "Z", 4),)
  1134. class EnumTrackAxis(NodeSocket):
  1135. '''Custom node socket type'''
  1136. bl_idname = 'EnumTrackAxis'
  1137. bl_label = "Track Axis"
  1138. default_value: bpy.props.EnumProperty(
  1139. items=eTrackAxis,
  1140. name="Track Axis",
  1141. description="Track Axis",
  1142. default = 'TRACK_X',
  1143. #options = {'ENUM_FLAG'},
  1144. update = update_socket,)
  1145. color_simple = cString
  1146. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1147. input : bpy.props.BoolProperty(default =False,)
  1148. def draw(self, context, layout, node, text):
  1149. ChooseDraw(self, context, layout, node, text)
  1150. def draw_color(self, context, node):
  1151. return self.color
  1152. @classmethod
  1153. def draw_color_simple(self):
  1154. return self.color_simple
  1155. class EnumUpAxis(NodeSocket):
  1156. '''Custom node socket type'''
  1157. bl_idname = 'EnumUpAxis'
  1158. bl_label = "Up Axis"
  1159. default_value: bpy.props.EnumProperty(
  1160. items=eUpAxis,
  1161. name="Up Axis",
  1162. description="Up Axis",
  1163. default = 'UP_X',
  1164. #options = {'ENUM_FLAG'},
  1165. update = update_socket,)
  1166. color_simple = cString
  1167. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1168. input : bpy.props.BoolProperty(default =False,)
  1169. def draw(self, context, layout, node, text):
  1170. ChooseDraw(self, context, layout, node, text)
  1171. def draw_color(self, context, node):
  1172. return self.color
  1173. @classmethod
  1174. def draw_color_simple(self):
  1175. return self.color_simple
  1176. # Locked Track
  1177. eLockAxis = (('LOCK_X', "X", "X", 1),
  1178. ('LOCK_Y', "Y", "Y", 2),
  1179. ('LOCK_Z', "Z", "Z", 4),)
  1180. class EnumLockAxis(NodeSocket):
  1181. '''Custom node socket type'''
  1182. bl_idname = 'EnumLockAxis'
  1183. bl_label = "Lock Axis"
  1184. default_value: bpy.props.EnumProperty(
  1185. items=eLockAxis,
  1186. name="Lock Axis",
  1187. description="Lock Axis",
  1188. default = 'LOCK_X',
  1189. #options = {'ENUM_FLAG'},
  1190. update = update_socket,)
  1191. color_simple = cString
  1192. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1193. input : bpy.props.BoolProperty(default =False,)
  1194. def draw(self, context, layout, node, text):
  1195. ChooseDraw(self, context, layout, node, text)
  1196. def draw_color(self, context, node):
  1197. return self.color
  1198. @classmethod
  1199. def draw_color_simple(self):
  1200. return self.color_simple
  1201. # Limit Distance:
  1202. eLimitMode = (('LIMITDIST_INSIDE', "Inside", "Inside",),
  1203. ('LIMITDIST_OUTSIDE', "Outside", "Outside",),
  1204. ('LIMITDIST_ONSURFACE', "On Surface", "On Surface",),)
  1205. class EnumLimitMode(NodeSocket):
  1206. '''Custom node socket type'''
  1207. bl_idname = 'EnumLimitMode'
  1208. bl_label = "Clamp Region"
  1209. default_value: bpy.props.EnumProperty(
  1210. items=eLimitMode,
  1211. name="Clamp Region",
  1212. description="Clamp Region",
  1213. default = 'LIMITDIST_INSIDE',
  1214. update = update_socket,)
  1215. color_simple = cString
  1216. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1217. input : bpy.props.BoolProperty(default =False,)
  1218. def draw(self, context, layout, node, text):
  1219. ChooseDraw(self, context, layout, node, text)
  1220. def draw_color(self, context, node):
  1221. return self.color
  1222. @classmethod
  1223. def draw_color_simple(self):
  1224. return self.color_simple
  1225. # Spline IK
  1226. eYScaleMode = (('NONE', "None", "Don’t scale the X and Z axes.",),
  1227. ('FIT_CURVE', "Fit Curve", "Scale the bones to fit the entire length of the curve.",),
  1228. ('BONE_ORIGINAL', "Bone Original", "Use the original scaling of the bones.",),)
  1229. eXZScaleMode = (('NONE', "None", "Don’t scale the X and Z axes.",),
  1230. ('BONE_ORIGINAL', "Bone Original", "Use the original scaling of the bones.",),
  1231. ('INVERSE_PRESERVE', "Inverse Scale", "Scale of the X and Z axes is the inverse of the Y-Scale.",),
  1232. ('VOLUME_PRESERVE', "Volume Preservation", "Scale of the X and Z axes are adjusted to preserve the volume of the bones.",),)
  1233. class EnumYScaleMode(NodeSocket):
  1234. '''Custom node socket type'''
  1235. bl_idname = 'EnumYScaleMode'
  1236. bl_label = "Y Scale Mode"
  1237. default_value: bpy.props.EnumProperty(
  1238. items=eYScaleMode,
  1239. name="Y Scale Mode",
  1240. description="Y Scale Mode",
  1241. default = 'FIT_CURVE',
  1242. update = update_socket,)
  1243. color_simple = cString
  1244. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1245. input : bpy.props.BoolProperty(default =False,)
  1246. def draw(self, context, layout, node, text):
  1247. ChooseDraw(self, context, layout, node, text)
  1248. def draw_color(self, context, node):
  1249. return self.color
  1250. @classmethod
  1251. def draw_color_simple(self):
  1252. return self.color_simple
  1253. class EnumXZScaleMode(NodeSocket):
  1254. '''Custom node socket type'''
  1255. bl_idname = 'EnumXZScaleMode'
  1256. bl_label = "XZ Scale Mode"
  1257. default_value: bpy.props.EnumProperty(
  1258. items=eXZScaleMode,
  1259. name="XZ Scale Mode",
  1260. description="XZ Scale Mode",
  1261. default = 'NONE',
  1262. update = update_socket,)
  1263. color_simple = cString
  1264. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1265. input : bpy.props.BoolProperty(default =False,)
  1266. def draw(self, context, layout, node, text):
  1267. ChooseDraw(self, context, layout, node, text)
  1268. def draw_color(self, context, node):
  1269. return self.color
  1270. @classmethod
  1271. def draw_color_simple(self):
  1272. return self.color_simple
  1273. eMapxForm = (('LOCATION', "Location", "Location",),
  1274. ('ROTATION', "Rotation", "Rotation",),
  1275. ('SCALE', "Scale", "Scale",),)
  1276. eRotationMode = (('AUTO', 'Auto', 'Automattically Selected.', 0),
  1277. ('XYZ', "XYZ", "Euler using the XYZ rotation order", 1),
  1278. ('XZY', "XZY", "Euler using the XZY rotation order", 2),
  1279. ('ZXY', "ZXY", "Euler using the ZXY rotation order", 3),
  1280. ('ZYX', "ZYX", "Euler using the ZYX rotation order", 4),
  1281. ('YXZ', "YXZ", "Euler using the YXZ rotation order", 5),
  1282. ('YZX', "YZX", "Euler using the YZX rotation order", 6),
  1283. ('QUATERNION', "Quaternion", "Quaternion", 7),
  1284. ('SWING_TWIST_X', 'Swing and X Twist.', 'Decompose into a swing rotation to aim the X axis, followed by twist around it.', 8),
  1285. ('SWING_TWIST_Y', 'Swing and Y Twist.', 'Decompose into a swing rotation to aim the Y axis, followed by twist around it.', 9),
  1286. ('SWING_TWIST_Z', 'Swing and Z Twist.', 'Decompose into a swing rotation to aim the Z axis, followed by twist around it.', 10),)
  1287. enumTransformationRotationOrder = enumRotationOrder[:6]
  1288. eTranslationMix =(
  1289. ('ADD', "Add", "", 0),
  1290. ('REPLACE', "Replace", "", 1),
  1291. )
  1292. eScaleMix =(
  1293. ('MULTIPLY', "Multiply", "", 0),
  1294. ('REPLACE', "Replace", "", 1),
  1295. )
  1296. class EnumTransformationMap(NodeSocket):
  1297. '''Custom node socket type'''
  1298. bl_idname = 'EnumTransformationMap'
  1299. bl_label = "Map To/From"
  1300. default_value: bpy.props.EnumProperty(
  1301. items=eMapxForm,
  1302. name="Map To/From",
  1303. description="Map To/From",
  1304. default = 'LOCATION',
  1305. update = update_socket,)
  1306. color_simple = cString
  1307. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1308. input : bpy.props.BoolProperty(default =False,)
  1309. def draw(self, context, layout, node, text):
  1310. ChooseDraw(self, context, layout, node, text)
  1311. def draw_color(self, context, node):
  1312. return self.color
  1313. @classmethod
  1314. def draw_color_simple(self):
  1315. return self.color_simple
  1316. class EnumTransformationRotationMode(NodeSocket):
  1317. '''Custom node socket type'''
  1318. bl_idname = 'EnumTransformationRotationMode'
  1319. bl_label = "Map To/From"
  1320. default_value: bpy.props.EnumProperty(
  1321. items=eRotationMode,
  1322. name="Rotation Mode",
  1323. description="Rotation Mode",
  1324. default = 'AUTO',
  1325. update = update_socket,)
  1326. color_simple = cString
  1327. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1328. input : bpy.props.BoolProperty(default =False,)
  1329. def draw(self, context, layout, node, text):
  1330. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1331. def draw_color(self, context, node):
  1332. return self.color
  1333. @classmethod
  1334. def draw_color_simple(self):
  1335. return self.color_simple
  1336. class EnumTransformationRotationOrder(NodeSocket):
  1337. '''Custom node socket type'''
  1338. bl_idname = 'EnumTransformationRotationOrder'
  1339. bl_label = "Map To/From"
  1340. default_value: bpy.props.EnumProperty(
  1341. items=enumTransformationRotationOrder,
  1342. name="Rotation Order",
  1343. description="Rotation Order",
  1344. default = 'AUTO',
  1345. update = update_socket,)
  1346. color_simple = cString
  1347. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1348. input : bpy.props.BoolProperty(default =False,)
  1349. def draw(self, context, layout, node, text):
  1350. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1351. def draw_color(self, context, node):
  1352. return self.color
  1353. @classmethod
  1354. def draw_color_simple(self):
  1355. return self.color_simple
  1356. class EnumTransformationTranslationMixMode(NodeSocket):
  1357. '''Custom node socket type'''
  1358. bl_idname = 'EnumTransformationTranslationMixMode'
  1359. bl_label = "Mix Mode"
  1360. default_value: bpy.props.EnumProperty(
  1361. items=eTranslationMix,
  1362. name="Mix Translation",
  1363. description="Mix Translation",
  1364. default = 'ADD',
  1365. update = update_socket,)
  1366. color_simple = cString
  1367. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1368. input : bpy.props.BoolProperty(default =False,)
  1369. def draw(self, context, layout, node, text):
  1370. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1371. def draw_color(self, context, node):
  1372. return self.color
  1373. @classmethod
  1374. def draw_color_simple(self):
  1375. return self.color_simple
  1376. class EnumTransformationRotationMixMode(NodeSocket):
  1377. '''Custom node socket type'''
  1378. bl_idname = 'EnumTransformationRotationMixMode'
  1379. bl_label = "Mix Mode"
  1380. default_value: bpy.props.EnumProperty(
  1381. items=eRotationMix,
  1382. name="Mix Rotation",
  1383. description="Mix Rotation",
  1384. default = 'ADD',
  1385. update = update_socket,)
  1386. color_simple = cString
  1387. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1388. input : bpy.props.BoolProperty(default =False,)
  1389. def draw(self, context, layout, node, text):
  1390. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1391. def draw_color(self, context, node):
  1392. return self.color
  1393. @classmethod
  1394. def draw_color_simple(self):
  1395. return self.color_simple
  1396. class EnumTransformationScaleMixMode(NodeSocket):
  1397. '''Custom node socket type'''
  1398. bl_idname = 'EnumTransformationScaleMixMode'
  1399. bl_label = "Mix Mode"
  1400. default_value: bpy.props.EnumProperty(
  1401. items=eScaleMix,
  1402. name="Mix Scale",
  1403. description="Mix Scale",
  1404. default = 'REPLACE',
  1405. update = update_socket,)
  1406. color_simple = cString
  1407. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1408. input : bpy.props.BoolProperty(default =False,)
  1409. def draw(self, context, layout, node, text):
  1410. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1411. def draw_color(self, context, node):
  1412. return self.color
  1413. @classmethod
  1414. def draw_color_simple(self):
  1415. return self.color_simple
  1416. eAxes = (
  1417. ('X', "X", "X", 0),
  1418. ('Y', "Y", "Y", 1),
  1419. ('Z', "Z", "Z", 2),
  1420. )
  1421. class EnumTransformationAxes(NodeSocket):
  1422. '''Custom node socket type'''
  1423. bl_idname = 'EnumTransformationAxes'
  1424. bl_label = "Axes"
  1425. default_value: bpy.props.EnumProperty(
  1426. items=eAxes,
  1427. # name="",
  1428. # description="",
  1429. default = 'X',
  1430. update = update_socket,)
  1431. color_simple = cString
  1432. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1433. input : bpy.props.BoolProperty(default =False,)
  1434. def draw(self, context, layout, node, text):
  1435. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1436. def draw_color(self, context, node):
  1437. return self.color
  1438. @classmethod
  1439. def draw_color_simple(self):
  1440. return self.color_simple
  1441. #
  1442. eBBoneHandleType = (
  1443. ('AUTO', "Automatic", "", 0),
  1444. ('ABSOLUTE', "Absolute", "", 1),
  1445. ('RELATIVE', "Relative", "", 2),
  1446. ('TANGENT', "Tangent", "", 3),
  1447. )
  1448. class EnumBBoneHandleType(NodeSocket):
  1449. '''Custom node socket type'''
  1450. bl_idname = 'EnumBBoneHandleType'
  1451. bl_label = "Axes"
  1452. default_value: bpy.props.EnumProperty(
  1453. items=eBBoneHandleType,
  1454. # name="",
  1455. # description="",
  1456. default = 'AUTO',
  1457. update = update_socket,)
  1458. color_simple = cString
  1459. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1460. input : bpy.props.BoolProperty(default =False,)
  1461. def draw(self, context, layout, node, text):
  1462. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1463. def draw_color(self, context, node):
  1464. return self.color
  1465. @classmethod
  1466. def draw_color_simple(self):
  1467. return self.color_simple
  1468. eSkinningMethod = (('EXISTING_GROUPS', "Use Existing Groups", "Use the existing vertex groups, or create empty groups if not found.",),
  1469. ('AUTOMATIC_HEAT', "Automatic (Heat)", "Use Blender's heatmap automatic skinning",),
  1470. ('COPY_FROM_OBJECT', "Copy from object", "Copy skin weights from the selected object"),)
  1471. class EnumSkinning(NodeSocket):
  1472. '''Custom node socket type'''
  1473. bl_idname = 'EnumSkinning'
  1474. bl_label = "Skinning Method"
  1475. default_value: bpy.props.EnumProperty(
  1476. items=eSkinningMethod,
  1477. name="Skinning Method",
  1478. description="Skinning Method",
  1479. default = 'AUTOMATIC_HEAT',
  1480. update = update_socket,)
  1481. color_simple = cString
  1482. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1483. input : bpy.props.BoolProperty(default =False,)
  1484. def draw(self, context, layout, node, text):
  1485. ChooseDraw(self, context, layout, node, text)
  1486. def draw_color(self, context, node):
  1487. return self.color
  1488. @classmethod
  1489. def draw_color_simple(self):
  1490. return self.color_simple
  1491. class MorphTargetSocket(NodeSocket):
  1492. """Morph Target"""
  1493. bl_idname = 'MorphTargetSocket'
  1494. bl_label = "Morph Target"
  1495. color_simple = cShapeKey
  1496. color : bpy.props.FloatVectorProperty(default=cShapeKey, size=4)
  1497. input : bpy.props.BoolProperty(default =False,)
  1498. def draw(self, context, layout, node, text):
  1499. ChooseDraw(self, context, layout, node, text)
  1500. def draw_color(self, context, node):
  1501. return self.color
  1502. @classmethod
  1503. def draw_color_simple(self):
  1504. return self.color_simple
  1505. eDriverVariableType = (
  1506. ( 'SINGLE_PROP',
  1507. "Property",
  1508. "Property",
  1509. 1),
  1510. ( 'LOC_DIFF',
  1511. "Distance",
  1512. "Distance",
  1513. 2),
  1514. ( 'ROTATION_DIFF',
  1515. "Rotational Difference",
  1516. "Rotational Difference",
  1517. 3),
  1518. # ( 'TRANSFORMS',
  1519. # "Transform Channel",
  1520. # "Transform Channel",
  1521. # 4),
  1522. )
  1523. class EnumDriverVariableType(NodeSocket):
  1524. '''Custom node socket type'''
  1525. bl_idname = 'EnumDriverVariableType'
  1526. bl_label = "Variable Type"
  1527. default_value: bpy.props.EnumProperty(
  1528. items = eDriverVariableType,
  1529. name = "Variable Type",
  1530. description = "Variable Type",
  1531. default = 'SINGLE_PROP',
  1532. update = driver_variable_socket_update,)
  1533. color_simple = cString
  1534. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1535. input : bpy.props.BoolProperty(default =False,)
  1536. def draw(self, context, layout, node, text):
  1537. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1538. def draw_color(self, context, node):
  1539. return self.color
  1540. @classmethod
  1541. def draw_color_simple(self):
  1542. return self.color_simple
  1543. eDriverVariableEvaluationSpace = (
  1544. ( 'WORLD_SPACE',
  1545. "World",
  1546. "World",
  1547. 1),
  1548. ( 'TRANSFORM_SPACE',
  1549. "Transform",
  1550. "Transform",
  1551. 2),
  1552. ( 'LOCAL_SPACE',
  1553. "Local",
  1554. "Local",
  1555. 3),
  1556. )
  1557. class EnumDriverVariableEvaluationSpace(NodeSocket):
  1558. '''Custom node socket type'''
  1559. bl_idname = 'EnumDriverVariableEvaluationSpace'
  1560. bl_label = "Evaluation Space"
  1561. default_value: bpy.props.EnumProperty(
  1562. items = eDriverVariableEvaluationSpace,
  1563. name = "Evaluation Space",
  1564. description = "Evaluation Space",
  1565. default = 'WORLD_SPACE',
  1566. update = driver_variable_socket_update,)
  1567. color_simple = cString
  1568. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1569. input : bpy.props.BoolProperty(default =False,)
  1570. def draw(self, context, layout, node, text):
  1571. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1572. def draw_color(self, context, node):
  1573. return self.color
  1574. @classmethod
  1575. def draw_color_simple(self):
  1576. return self.color_simple
  1577. eDriverVariableTransformChannel = (
  1578. ("LOC_X", "X Location", "The X-coordinate of an object's location.", 1),
  1579. ("LOC_Y", "Y Location", "The Y-coordinate of an object's location.", 2),
  1580. ("LOC_Z", "Z Location", "The Z-coordinate of an object's location.", 3),
  1581. ("ROT_X", "X Rotation", "Rotation X-axis.", 4),
  1582. ("ROT_Y", "Y Rotation", "Rotation Y-axis.", 5),
  1583. ("ROT_Z", "Z Rotation", "Rotation Z-axis.", 6),
  1584. ("ROT_W", "W Rotation", "Rotation W-axis.", 7),
  1585. ("SCALE_X", "X Scale", "The X-scale of an object's scale.", 8),
  1586. ("SCALE_Y", "Y Scale", "The Y-scale of an object's scale.", 9),
  1587. ("SCALE_Z", "Z Scale", "The Z-scale of an object's scale.", 10),
  1588. ("SCALE_AVG", "Average Scale", "The scale factor of an object's scale.", 11),
  1589. )
  1590. class EnumDriverVariableTransformChannel(NodeSocket):
  1591. '''Custom node socket type'''
  1592. bl_idname = 'EnumDriverVariableTransformChannel'
  1593. bl_label = "Transform Channel"
  1594. default_value: bpy.props.EnumProperty(
  1595. items = eDriverVariableTransformChannel,
  1596. name = "Transform Channel",
  1597. description = "Transform Channel",
  1598. default = 'LOC_X',
  1599. update = driver_variable_socket_update,)
  1600. color_simple = cString
  1601. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1602. input : bpy.props.BoolProperty(default =False,)
  1603. def draw(self, context, layout, node, text):
  1604. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1605. def draw_color(self, context, node):
  1606. return self.color
  1607. @classmethod
  1608. def draw_color_simple(self):
  1609. return self.color_simple
  1610. class EnumDriverRotationMode(NodeSocket):
  1611. '''Custom node socket type'''
  1612. bl_idname = 'EnumDriverRotationMode'
  1613. bl_label = "Rotaton Mode"
  1614. default_value: bpy.props.EnumProperty(
  1615. items = eRotationMode,
  1616. name = "Rotation Mode",
  1617. description = "Rotation Mode",
  1618. default = 'AUTO',
  1619. update = driver_variable_socket_update,)
  1620. color_simple = cString
  1621. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1622. input : bpy.props.BoolProperty(default =False,)
  1623. def draw(self, context, layout, node, text):
  1624. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1625. def draw_color(self, context, node):
  1626. return self.color
  1627. @classmethod
  1628. def draw_color_simple(self):
  1629. return self.color_simple
  1630. #
  1631. eDriverType = (('AVERAGE', 'Average', 'Average', 0),
  1632. ('SUM', "Sum", "Sum", 1),
  1633. ('SCRIPTED', "Scripted", "Scripted Expression", 2),
  1634. ('MIN', "Min", "Minimum", 3),
  1635. ('MAX', "Max", "Maximum", 4),)
  1636. class EnumDriverType(NodeSocket):
  1637. '''Custom node socket type'''
  1638. bl_idname = 'EnumDriverType'
  1639. bl_label = "Driver Type"
  1640. default_value: bpy.props.EnumProperty(
  1641. items = eDriverType,
  1642. name = "Driver Type",
  1643. description = "Driver Type",
  1644. default = 'AVERAGE',
  1645. update = driver_socket_update,)
  1646. color_simple = cString
  1647. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1648. input : bpy.props.BoolProperty(default =False,)
  1649. def draw(self, context, layout, node, text):
  1650. ChooseDraw(self, context, layout, node, text, use_enum=False)
  1651. def draw_color(self, context, node):
  1652. return self.color
  1653. @classmethod
  1654. def draw_color_simple(self):
  1655. return self.color_simple
  1656. # Keyframe
  1657. # Enum for kf handle type
  1658. # enum for interpolation type
  1659. # eventually gonna make it to the fancy stuff
  1660. class FloatSocket(bpy.types.NodeSocketFloat):
  1661. """Float Input socket"""
  1662. bl_idname = 'FloatSocket'
  1663. bl_label = "Float"
  1664. default_value : bpy.props.FloatProperty(default = 0.0, update = update_socket,)
  1665. color_simple = cFloat
  1666. color : bpy.props.FloatVectorProperty(default=cFloat, size=4)
  1667. input : bpy.props.BoolProperty(default =False,)
  1668. def draw(self, context, layout, node, text):
  1669. ChooseDraw(self, context, layout, node, text)
  1670. def draw_color(self, context, node):
  1671. return self.color
  1672. @classmethod
  1673. def draw_color_simple(self):
  1674. return self.color_simple
  1675. class FloatPositiveSocket(bpy.types.NodeSocketFloat):
  1676. """Float Input socket"""
  1677. bl_idname = 'FloatPositiveSocket'
  1678. bl_label = "Float (Positive)"
  1679. default_value : bpy.props.FloatProperty(default = 0.0, min=0, update = update_socket,)
  1680. color_simple = cFloat
  1681. color : bpy.props.FloatVectorProperty(default=cFloat, size=4)
  1682. input : bpy.props.BoolProperty(default =False,)
  1683. def draw(self, context, layout, node, text):
  1684. ChooseDraw(self, context, layout, node, text)
  1685. def draw_color(self, context, node):
  1686. return self.color
  1687. @classmethod
  1688. def draw_color_simple(self):
  1689. return self.color_simple
  1690. class FloatFactorSocket(bpy.types.NodeSocketFloatFactor):
  1691. '''xFrom Input Output'''
  1692. bl_idname = 'FloatFactorSocket'
  1693. bl_label = "Float (Factor)"
  1694. default_value : bpy.props.FloatProperty(
  1695. default = 0.0,
  1696. min = 0.0,
  1697. max=1.0,
  1698. update = update_socket,
  1699. subtype='FACTOR',)
  1700. color_simple = cFloat
  1701. color : bpy.props.FloatVectorProperty(default=cFloat, size=4)
  1702. input : bpy.props.BoolProperty(default =False,)
  1703. def draw(self, context, layout, node, text):
  1704. ChooseDraw(self, context, layout, node, text)
  1705. def draw_color(self, context, node):
  1706. return self.color
  1707. @classmethod
  1708. def draw_color_simple(self):
  1709. return self.color_simple
  1710. class FloatAngleSocket(bpy.types.NodeSocketFloatAngle):
  1711. '''xFrom Input Output'''
  1712. bl_idname = 'FloatAngleSocket'
  1713. bl_label = "Float (Angle)"
  1714. default_value : bpy.props.FloatProperty(
  1715. default = 0.0,
  1716. min = -180,
  1717. max=180,
  1718. update = update_socket,
  1719. subtype='ANGLE',)
  1720. color_simple = cFloat
  1721. color : bpy.props.FloatVectorProperty(default=cFloat, size=4)
  1722. input : bpy.props.BoolProperty(default =False,)
  1723. def draw(self, context, layout, node, text):
  1724. ChooseDraw(self, context, layout, node, text)
  1725. def draw_color(self, context, node):
  1726. return self.color
  1727. @classmethod
  1728. def draw_color_simple(self):
  1729. return self.color_simple
  1730. class VectorSocket(bpy.types.NodeSocketVectorEuler):
  1731. """Vector Input socket"""
  1732. bl_idname = 'VectorSocket'
  1733. bl_label = "Vector"
  1734. default_value : bpy.props.FloatVectorProperty(
  1735. default = (0.0, 0.0, 0.0),
  1736. update = update_socket,)
  1737. color_simple = cVector
  1738. color : bpy.props.FloatVectorProperty(default=cVector, size=4)
  1739. input : bpy.props.BoolProperty(default =False,)
  1740. def draw(self, context, layout, node, text):
  1741. ChooseDraw(self, context, layout, node, text)
  1742. def draw_color(self, context, node):
  1743. return self.color
  1744. @classmethod
  1745. def draw_color_simple(self):
  1746. return self.color_simple
  1747. class VectorEulerSocket(bpy.types.NodeSocketVectorEuler):
  1748. """Vector Input socket"""
  1749. bl_idname = 'VectorEulerSocket'
  1750. bl_label = "Euler"
  1751. default_value : bpy.props.FloatVectorProperty(
  1752. default = (0.0, 0.0, 0.0),
  1753. update = update_socket,
  1754. subtype='EULER',)
  1755. color_simple = cVector
  1756. color : bpy.props.FloatVectorProperty(default=cVector, size=4)
  1757. input : bpy.props.BoolProperty(default =False,)
  1758. def draw(self, context, layout, node, text):
  1759. ChooseDraw(self, context, layout, node, text)
  1760. def draw_color(self, context, node):
  1761. return self.color
  1762. @classmethod
  1763. def draw_color_simple(self):
  1764. return self.color_simple
  1765. class VectorTranslationSocket(bpy.types.NodeSocketVectorTranslation):
  1766. """Vector Input socket"""
  1767. bl_idname = 'VectorTranslationSocket'
  1768. bl_label = "Vector (Translation)"
  1769. default_value : bpy.props.FloatVectorProperty(
  1770. default = (0.0, 0.0, 0.0),
  1771. update = update_socket,
  1772. subtype='TRANSLATION',)
  1773. color_simple = cVector
  1774. color : bpy.props.FloatVectorProperty(default=cVector, size=4)
  1775. input : bpy.props.BoolProperty(default =False,)
  1776. def draw(self, context, layout, node, text):
  1777. ChooseDraw(self, context, layout, node, text)
  1778. def draw_color(self, context, node):
  1779. return self.color
  1780. @classmethod
  1781. def draw_color_simple(self):
  1782. return self.color_simple
  1783. class VectorScaleSocket(bpy.types.NodeSocketVectorXYZ):
  1784. """Vector Input socket"""
  1785. bl_idname = 'VectorScaleSocket'
  1786. bl_label = "Vector (Scale)"
  1787. default_value : bpy.props.FloatVectorProperty(
  1788. default = (1.0, 1.0, 1.0),
  1789. update = update_socket,
  1790. subtype='XYZ',)
  1791. color_simple = cVector
  1792. color : bpy.props.FloatVectorProperty(default=cVector, size=4)
  1793. input : bpy.props.BoolProperty(default =False,)
  1794. def draw(self, context, layout, node, text):
  1795. ChooseDraw(self, context, layout, node, text)
  1796. def draw_color(self, context, node):
  1797. return self.color
  1798. @classmethod
  1799. def draw_color_simple(self):
  1800. return self.color_simple
  1801. class KeyframeSocket(NodeSocket):
  1802. '''Keyframe'''
  1803. bl_idname = 'KeyframeSocket'
  1804. bl_label = "Keyframe"
  1805. color_simple = cKeyframe
  1806. color : bpy.props.FloatVectorProperty(default=cKeyframe, size=4)
  1807. input : bpy.props.BoolProperty(default =False, update = update_socket)
  1808. def init(self):
  1809. self.display_shape = 'CIRCLE_DOT'
  1810. def draw(self, context, layout, node, text):
  1811. ChooseDraw(self, context, layout, node, text)
  1812. def draw_color(self, context, node):
  1813. return self.color
  1814. @classmethod
  1815. def draw_color_simple(self):
  1816. return self.color_simple
  1817. EnumKeyframeInterpolationType = (('CONSTANT', 'Stepped', 'Stepped'),
  1818. ('LINEAR', "Linear", "Linear"),
  1819. ('BEZIER', "Bezier", "Bezier"),)
  1820. class EnumKeyframeInterpolationTypeSocket(NodeSocket):
  1821. '''Keyframe Interpolation Type'''
  1822. bl_idname = 'EnumKeyframeInterpolationTypeSocket'
  1823. bl_label = "Keyframe Interpolation Type"
  1824. default_value :bpy.props.EnumProperty(
  1825. name="",
  1826. description="Interpolation",
  1827. items=EnumKeyframeInterpolationType,
  1828. default='LINEAR',
  1829. update = update_socket,)
  1830. color_simple = cString
  1831. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1832. input : bpy.props.BoolProperty(default =False, update = update_socket)
  1833. def draw(self, context, layout, node, text):
  1834. ChooseDraw(self, context, layout, node, text)
  1835. def draw_color(self, context, node):
  1836. return self.color
  1837. @classmethod
  1838. def draw_color_simple(self):
  1839. return self.color_simple
  1840. EnumKeyframeBezierHandleType = (('FREE', 'Free', 'Completely independent manually set handle.'),
  1841. ('ALIGNED', "Aligned", "Manually set handle with rotation locked together with its pair."),
  1842. ('VECTOR', "Vector", "Automatic handles that create straight lines."),
  1843. ('AUTO', "Automatic", "Automatic handles that create smooth curves."),
  1844. ('AUTO_CLAMPED', "Auto Clamped", "Automatic handles that create smooth curves which only change direction at keyframes."),)
  1845. class EnumKeyframeBezierHandleTypeSocket(NodeSocket):
  1846. '''Keyframe Bezier Handle Type'''
  1847. bl_idname = 'EnumKeyframeBezierHandleTypeSocket'
  1848. bl_label = "Keyframe Bezier Handle Type"
  1849. default_value :bpy.props.EnumProperty(
  1850. name="",
  1851. description="Handle Type",
  1852. items=EnumKeyframeBezierHandleType,
  1853. default='AUTO_CLAMPED',
  1854. update = update_socket,)
  1855. color_simple = cString
  1856. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1857. input : bpy.props.BoolProperty(default =False, update = update_socket)
  1858. def draw(self, context, layout, node, text):
  1859. ChooseDraw(self, context, layout, node, text)
  1860. def draw_color(self, context, node):
  1861. return self.color
  1862. @classmethod
  1863. def draw_color_simple(self):
  1864. return self.color_simple
  1865. enumFloatOperations = (('ADD', 'Add', 'Add'),
  1866. ('SUBTRACT', "Subtract", "Subtract"),
  1867. ('MULTIPLY', "Multiply", "Multiply"),
  1868. ('DIVIDE', "Divide", "Divide"),
  1869. ('POWER', "Power", "Power"),
  1870. ('FLOOR_DIVIDE', "Floor Divide", "Floor Divide"),
  1871. ('MODULUS', "Modulus", "Modulus"),
  1872. ('ABSOLUTE', "Absolute", "Absolute Value"),
  1873. ('MAXIMUM', "Maximum", "Maximum"),
  1874. ('MINIMUM', "Minimum", "Minimum"),
  1875. ('GREATER THAN', "Greater Than", "Greater Than"),
  1876. ('LESS THAN', "Less Than", "Less Than"),)
  1877. class MathFloatOperation(NodeSocket):
  1878. """Float Math Operation"""
  1879. bl_idname = 'MathFloatOperation'
  1880. bl_label = "Operation"
  1881. default_value :bpy.props.EnumProperty(
  1882. name="",
  1883. description="Operation",
  1884. items=enumFloatOperations,
  1885. default='MULTIPLY',
  1886. update = update_socket,)
  1887. color_simple = cString
  1888. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1889. input : bpy.props.BoolProperty(default =False,)
  1890. def draw(self, context, layout, node, text):
  1891. ChooseDraw(self, context, layout, node, text)
  1892. def draw_color(self, context, node):
  1893. return self.color
  1894. @classmethod
  1895. def draw_color_simple(self):
  1896. return self.color_simple
  1897. enumVectorOperations = (('ADD', 'Add', 'Add (Component-wise)'),
  1898. ('SUBTRACT', "Subtract", "Subtract (Component-wise)"),
  1899. ('MULTIPLY', "Multiply", "Multiply (Component-wise)"),
  1900. ('SCALE', "Scale", "Scales vector by input float or average magnitude of input vector's components."),
  1901. ('DIVIDE', "Divide", "Divide (Component-wise)"),
  1902. ('POWER', "Power", "Power (Component-wise)"),
  1903. ('LENGTH', "Length", "Length"),
  1904. ('CROSS', "Cross Product", "Cross product of A X B"),
  1905. ('NORMALIZE', "Normalize", "Returns a normalized vector."),
  1906. ('DOT', "Dot Product", "Dot product of A . B"),)
  1907. class MathVectorOperation(NodeSocket):
  1908. """Vector Math Operation"""
  1909. bl_idname = 'MathVectorOperation'
  1910. bl_label = "Operation"
  1911. default_value :bpy.props.EnumProperty(
  1912. name="",
  1913. description="Operation",
  1914. items=enumVectorOperations,
  1915. default='MULTIPLY',
  1916. update = update_socket,)
  1917. color_simple = cString
  1918. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1919. input : bpy.props.BoolProperty(default =False,)
  1920. def draw(self, context, layout, node, text):
  1921. ChooseDraw(self, context, layout, node, text)
  1922. def draw_color(self, context, node):
  1923. return self.color
  1924. @classmethod
  1925. def draw_color_simple(self):
  1926. return self.color_simple
  1927. enumMatrixTransform = (('TRANSLATE', 'Translate', 'Translate'),
  1928. ('ROTATE_AXIS_ANGLE', "Rotate (Axis-angle)", "Rotates a number of radians around an axis"),
  1929. # ('ROTATE_EULER', "Rotate (Euler)", "Euler Rotation"),
  1930. # ('ROTATE_QUATERNION', "Rotate (Quaternion)", "Quaternion Rotation"),
  1931. ('SCALE', "Scale", "Scale"),)
  1932. class MatrixTransformOperation(NodeSocket):
  1933. """Matrix Transform Operation"""
  1934. bl_idname = 'MatrixTransformOperation'
  1935. bl_label = "Operation"
  1936. default_value :bpy.props.EnumProperty(
  1937. name="",
  1938. description="Operation",
  1939. items=enumMatrixTransform,
  1940. default='TRANSLATE',
  1941. update = update_socket,)
  1942. color_simple = cString
  1943. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1944. input : bpy.props.BoolProperty(default =False,)
  1945. def draw(self, context, layout, node, text):
  1946. ChooseDraw(self, context, layout, node, text)
  1947. def draw_color(self, context, node):
  1948. return self.color
  1949. @classmethod
  1950. def draw_color_simple(self):
  1951. return self.color_simple
  1952. enumIntOperations = (('ADD', 'Add', 'Add'),
  1953. ('SUBTRACT', "Subtract", "Subtract"),
  1954. ('MULTIPLY', "Multiply", "Multiply"),
  1955. ('FLOOR_DIVIDE', "Floor Divide", "Floor Divide"),
  1956. ('POWER', "Power", "Power"),
  1957. ('MODULUS', "Modulus", "Modulus"),
  1958. ('ABSOLUTE', "Absolute", "Absolute Value"),
  1959. ('MAXIMUM', "Maximum", "Maximum"),
  1960. ('MINIMUM', "Minimum", "Minimum"),
  1961. ('GREATER THAN', "Greater Than", "Greater Than"),
  1962. ('LESS THAN', "Less Than", "Less Than"),)
  1963. class MathIntOperation(NodeSocket):
  1964. """Int Math Operation"""
  1965. bl_idname = 'MathIntOperation'
  1966. bl_label = "Operation"
  1967. default_value :bpy.props.EnumProperty(
  1968. name="",
  1969. description="Operation",
  1970. items=enumIntOperations,
  1971. default='MULTIPLY',
  1972. update = update_socket,)
  1973. color_simple = cString
  1974. color : bpy.props.FloatVectorProperty(default=cString, size=4)
  1975. input : bpy.props.BoolProperty(default =False,)
  1976. def draw(self, context, layout, node, text):
  1977. ChooseDraw(self, context, layout, node, text)
  1978. def draw_color(self, context, node):
  1979. return self.color
  1980. @classmethod
  1981. def draw_color_simple(self):
  1982. return self.color_simple
  1983. class WildcardSocket(NodeSocket):
  1984. """Some kind of node socket lol I donno"""
  1985. bl_idname = 'WildcardSocket'
  1986. bl_label = ""
  1987. color_simple = (0.0,0.0,0.0,0.0)
  1988. color : bpy.props.FloatVectorProperty(default=(0.0,0.0,0.0,0.0), size=4)
  1989. input : bpy.props.BoolProperty(default =False,)
  1990. def draw(self, context, layout, node, text):
  1991. ChooseDraw(self, context, layout, node, text)
  1992. def draw_color(self, context, node):
  1993. return self.color
  1994. @classmethod
  1995. def draw_color_simple(self):
  1996. return self.color_simple