setNodeTransform.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. return {
  2. summary = 'Set or blend the transform of a node.',
  3. description = [[
  4. Sets or blends the transform of a node to a new transform. This sets the local transform of the
  5. node, relative to its parent.
  6. ]],
  7. arguments = {
  8. index = {
  9. type = 'number',
  10. description = 'The index of the node.'
  11. },
  12. name = {
  13. type = 'string',
  14. description = 'The name of the node.'
  15. },
  16. x = {
  17. type = 'number',
  18. description = 'The x component of the position.'
  19. },
  20. y = {
  21. type = 'number',
  22. description = 'The y component of the position.'
  23. },
  24. z = {
  25. type = 'number',
  26. description = 'The z component of the position.'
  27. },
  28. sx = {
  29. type = 'number',
  30. description = 'The x component of the scale.'
  31. },
  32. sy = {
  33. type = 'number',
  34. description = 'The y component of the scale.'
  35. },
  36. sz = {
  37. type = 'number',
  38. description = 'The z component of the scale.'
  39. },
  40. angle = {
  41. type = 'number',
  42. description = 'The number of radians the node should be rotated around its rotation axis.'
  43. },
  44. ax = {
  45. type = 'number',
  46. description = 'The x component of the axis of rotation.'
  47. },
  48. ay = {
  49. type = 'number',
  50. description = 'The y component of the axis of rotation.'
  51. },
  52. az = {
  53. type = 'number',
  54. description = 'The z component of the axis of rotation.'
  55. },
  56. position = {
  57. type = 'Vec3',
  58. description = 'The position.'
  59. },
  60. scale = {
  61. type = 'Vec3',
  62. description = 'The scale.'
  63. },
  64. orientation = {
  65. type = 'Quat',
  66. description = 'The orientation.'
  67. },
  68. transform = {
  69. type = 'Mat4',
  70. description = 'The transform.'
  71. },
  72. blend = {
  73. type = 'number',
  74. default = '1.0',
  75. description = [[
  76. A number from 0 to 1 indicating how much of the target transform to blend in. A value of 0
  77. will not change the node's transform at all, whereas 1 will fully blend to the target
  78. transform.
  79. ]]
  80. }
  81. },
  82. returns = {},
  83. variants = {
  84. {
  85. arguments = { 'index', 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az', 'blend' },
  86. returns = {}
  87. },
  88. {
  89. arguments = { 'name', 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az', 'blend' },
  90. returns = {}
  91. },
  92. {
  93. arguments = { 'index', 'position', 'scale', 'orientation', 'blend' },
  94. returns = {}
  95. },
  96. {
  97. arguments = { 'name', 'position', 'scale', 'orientation', 'blend' },
  98. returns = {}
  99. },
  100. {
  101. arguments = { 'index', 'transform', 'blend' },
  102. returns = {}
  103. },
  104. {
  105. arguments = { 'name', 'transform', 'blend' },
  106. returns = {}
  107. }
  108. },
  109. notes = [[
  110. For best results when animating, it's recommended to keep the 3 components of the scale the
  111. same.
  112. Even though the translation, scale, and rotation parameters are given in TSR order, they are
  113. applied in the normal TRS order.
  114. ]],
  115. related = {
  116. 'Model:getNodePosition',
  117. 'Model:setNodePosition',
  118. 'Model:getNodeOrientation',
  119. 'Model:setNodeOrientation',
  120. 'Model:getNodeScale',
  121. 'Model:setNodeScale',
  122. 'Model:getNodePose',
  123. 'Model:setNodePose',
  124. 'Model:animate'
  125. }
  126. }