misc_nodes_socket_templates.py 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. from .base_definitions import MantisSocketTemplate as SockTemplate
  2. from dataclasses import replace
  3. SplineIndexTemplate = SockTemplate(name="Spline Index",
  4. bl_idname='UnsignedIntSocket', is_input=True, default_value=0,)
  5. InputWidgetSockets = [
  6. WidgetName := SockTemplate(name='Name', is_input=True,
  7. bl_idname="EnumWidgetLibrarySocket",),
  8. Scale := SockTemplate(name='Scale', is_input=True,
  9. bl_idname="VectorScaleSocket", default_value=(1.0, 1.0, 1.0)),
  10. FlipAxes := SockTemplate(name='Flip Axes', is_input=True,
  11. bl_idname="BooleanThreeTupleSocket",),
  12. xFormOutput := SockTemplate(name='Widget',
  13. bl_idname='xFormSocket',is_input=False),
  14. ]
  15. MatrixFromCurveSockets=[
  16. CurveTemplate := SockTemplate(name="Curve", bl_idname='EnumCurveSocket',
  17. is_input=True,),
  18. SplineIndexTemplate,
  19. TotalDivisionsTemplate := SockTemplate(name="Total Divisions",
  20. bl_idname='UnsignedIntSocket', is_input=True, default_value=0,),
  21. MatrixIndexTemplate := SockTemplate(name="Matrix Index",
  22. bl_idname='UnsignedIntSocket', is_input=True, default_value=0,),
  23. MatrixOutTemplate := SockTemplate(
  24. name="Matrix", is_input=False, bl_idname='MatrixSocket', ),
  25. ]
  26. MatricesOutTemplate = replace(MatrixOutTemplate,
  27. name='Matrices', use_multi_input=True)
  28. MatricesFromCurveSockets=MatrixFromCurveSockets.copy()
  29. MatricesFromCurveSockets[4] = MatricesOutTemplate
  30. MatricesFromCurveSockets.pop(3)
  31. MatrixFromCurveSegmentSockets=[
  32. CurveTemplate,
  33. SplineIndexTemplate,
  34. SegmentIndexTemplate := replace(SplineIndexTemplate, name="Segment Index"),
  35. MatrixOutTemplate,
  36. ]
  37. PointFromCurveSockets=[
  38. CurveTemplate,
  39. SplineIndexTemplate,
  40. FactorTemplate := SockTemplate(name="Factor", bl_idname='FloatFactorSocket',
  41. is_input=True,),
  42. PointOutTemplate := SockTemplate(name="Point", bl_idname="VectorSocket",
  43. is_input=False, )
  44. ]
  45. GetCurvePointSockets=[
  46. CurveTemplate,
  47. SplineIndexTemplate,
  48. IndexTemplate := SockTemplate(name="Index",
  49. bl_idname='UnsignedIntSocket', is_input=True, default_value=0,),
  50. OutputPointTemplate := SockTemplate(name="Point",
  51. bl_idname='VectorSocket', is_input=False,),
  52. OutputLeftHandleTemplate := SockTemplate(name="Left Handle",
  53. bl_idname='VectorSocket', is_input=False, hide=True),
  54. OutputRightHandleTemplate := SockTemplate(name="Right Handle",
  55. bl_idname='VectorSocket', is_input=False, hide=True),
  56. ]
  57. GetNearestFactorOnCurveSockets=[
  58. CurveTemplate,
  59. SplineIndexTemplate,
  60. ReferencePointTemplate := SockTemplate(name="Reference Point",
  61. bl_idname='VectorSocket', is_input=True,),
  62. OutputFactorTemplate := SockTemplate(name="Factor",
  63. bl_idname='FloatSocket', is_input=False,),
  64. ]
  65. MatrixInvertSockets=[
  66. Matrix1Template := SockTemplate(
  67. name="Matrix 1", is_input=True, bl_idname='MatrixSocket', ),
  68. MatrixOutTemplate,
  69. ]
  70. MatrixComposeSockets=[
  71. XBasisVector := SockTemplate(
  72. name="X Basis Vector", is_input=True, bl_idname='VectorSocket',
  73. default_value = (1.0, 0.0, 0.0) ),
  74. YBasisVector := replace(XBasisVector, name="Y Basis Vector",
  75. default_value = (0.0, 1.0, 0.0) ),
  76. ZBasisVector := replace(XBasisVector, name="Z Basis Vector",
  77. default_value = (0.0, 0.0, 1.0) ),
  78. Translation := replace(XBasisVector, name="Translation"),
  79. MatrixOutTemplate,
  80. ]
  81. MatrixAlignRollSockets=[
  82. MatrixInTemplate := replace(Matrix1Template, name="Matrix"),
  83. AlignVector := SockTemplate(name="Alignment Vector", is_input=True,
  84. bl_idname='VectorSocket', default_value=(0.0,-1.0,0.0)),
  85. MatrixOutTemplate,
  86. ]
  87. CompareSockets = [
  88. ComparisonOperation := SockTemplate( name='Comparison',
  89. is_input=True, bl_idname="EnumCompareOperation",
  90. default_value="EQUAL",),
  91. WildcardATemplate := SockTemplate(
  92. name="A", is_input=True, bl_idname='WildcardSocket', ),
  93. WildcardBTemplate := replace(WildcardATemplate, name="B"),
  94. CompareOutputTemplate := SockTemplate(
  95. name="Result", is_input=False, bl_idname="BooleanSocket",),
  96. ]
  97. NumberOfSplinesSockets=[
  98. CurveTemplate,
  99. NumberOfSplinesOut := SockTemplate(name="Number of Splines",
  100. bl_idname='UnsignedIntSocket', is_input=False),
  101. ]
  102. CollectionJoinSockets = [
  103. JoinCollections := SockTemplate(name='Collections', is_input=True,
  104. bl_idname="BoneCollectionSocket", display_shape='SQUARE_DOT',
  105. use_multi_input=True,),
  106. CollectionDeclarationOutput := SockTemplate(name='Collection',
  107. bl_idname="BoneCollectionSocket", is_input=False,)
  108. ]
  109. CollectionHierarchySockets = [
  110. ParentCollection := SockTemplate(name='Parent Collection', is_input=True,
  111. bl_idname="BoneCollectionSocket",),
  112. ChildCollection := SockTemplate(name='Child Collection', is_input=True,
  113. bl_idname="BoneCollectionSocket",),
  114. CollectionDeclarationOutput,
  115. ]