misc_nodes_socket_templates.py 4.7 KB

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