class_skeletonmodificationstack3d.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the SkeletonModificationStack3D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_SkeletonModificationStack3D:
  6. SkeletonModificationStack3D
  7. ===========================
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. A resource that holds a stack of :ref:`SkeletonModification3D<class_SkeletonModification3D>`\ s.
  10. Description
  11. -----------
  12. This resource is used by the Skeleton and holds a stack of :ref:`SkeletonModification3D<class_SkeletonModification3D>`\ s. The SkeletonModificationStack3D controls the order of the modifications, which controls how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine *before* the arms on a humanoid skeleton.
  13. Additionally, the SkeletonModificationStack3D also controls how strongly the modifications are applied to the :ref:`Skeleton3D<class_Skeleton3D>` node.
  14. Properties
  15. ----------
  16. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  17. | :ref:`bool<class_bool>` | :ref:`enabled<class_SkeletonModificationStack3D_property_enabled>` | ``false`` |
  18. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`int<class_int>` | :ref:`modification_count<class_SkeletonModificationStack3D_property_modification_count>` | ``0`` |
  20. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`float<class_float>` | :ref:`strength<class_SkeletonModificationStack3D_property_strength>` | ``1.0`` |
  22. +---------------------------+------------------------------------------------------------------------------------------+-----------+
  23. Methods
  24. -------
  25. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`add_modification<class_SkeletonModificationStack3D_method_add_modification>` **(** :ref:`SkeletonModification3D<class_SkeletonModification3D>` modification **)** |
  27. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`delete_modification<class_SkeletonModificationStack3D_method_delete_modification>` **(** :ref:`int<class_int>` mod_idx **)** |
  29. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`enable_all_modifications<class_SkeletonModificationStack3D_method_enable_all_modifications>` **(** :ref:`bool<class_bool>` enabled **)** |
  31. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`execute<class_SkeletonModificationStack3D_method_execute>` **(** :ref:`float<class_float>` delta, :ref:`int<class_int>` execution_mode **)** |
  33. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`get_is_setup<class_SkeletonModificationStack3D_method_get_is_setup>` **(** **)** |const| |
  35. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`SkeletonModification3D<class_SkeletonModification3D>` | :ref:`get_modification<class_SkeletonModificationStack3D_method_get_modification>` **(** :ref:`int<class_int>` mod_idx **)** |const| |
  37. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Skeleton3D<class_Skeleton3D>` | :ref:`get_skeleton<class_SkeletonModificationStack3D_method_get_skeleton>` **(** **)** |const| |
  39. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_modification<class_SkeletonModificationStack3D_method_set_modification>` **(** :ref:`int<class_int>` mod_idx, :ref:`SkeletonModification3D<class_SkeletonModification3D>` modification **)** |
  41. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`setup<class_SkeletonModificationStack3D_method_setup>` **(** **)** |
  43. +-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. Property Descriptions
  45. ---------------------
  46. .. _class_SkeletonModificationStack3D_property_enabled:
  47. - :ref:`bool<class_bool>` **enabled**
  48. +-----------+--------------------+
  49. | *Default* | ``false`` |
  50. +-----------+--------------------+
  51. | *Setter* | set_enabled(value) |
  52. +-----------+--------------------+
  53. | *Getter* | get_enabled() |
  54. +-----------+--------------------+
  55. When true, the modification's in the stack will be called. This is handled automatically through the :ref:`Skeleton3D<class_Skeleton3D>` node.
  56. ----
  57. .. _class_SkeletonModificationStack3D_property_modification_count:
  58. - :ref:`int<class_int>` **modification_count**
  59. +-----------+-------------------------------+
  60. | *Default* | ``0`` |
  61. +-----------+-------------------------------+
  62. | *Setter* | set_modification_count(value) |
  63. +-----------+-------------------------------+
  64. | *Getter* | get_modification_count() |
  65. +-----------+-------------------------------+
  66. The amount of modifications in the stack.
  67. ----
  68. .. _class_SkeletonModificationStack3D_property_strength:
  69. - :ref:`float<class_float>` **strength**
  70. +-----------+---------------------+
  71. | *Default* | ``1.0`` |
  72. +-----------+---------------------+
  73. | *Setter* | set_strength(value) |
  74. +-----------+---------------------+
  75. | *Getter* | get_strength() |
  76. +-----------+---------------------+
  77. The interpolation strength of the modifications in stack. A value of ``0`` will make it where the modifications are not applied, a strength of ``0.5`` will be half applied, and a strength of ``1`` will allow the modifications to be fully applied and override the skeleton bone poses.
  78. Method Descriptions
  79. -------------------
  80. .. _class_SkeletonModificationStack3D_method_add_modification:
  81. - void **add_modification** **(** :ref:`SkeletonModification3D<class_SkeletonModification3D>` modification **)**
  82. Adds the passed-in :ref:`SkeletonModification3D<class_SkeletonModification3D>` to the stack.
  83. ----
  84. .. _class_SkeletonModificationStack3D_method_delete_modification:
  85. - void **delete_modification** **(** :ref:`int<class_int>` mod_idx **)**
  86. Deletes the :ref:`SkeletonModification3D<class_SkeletonModification3D>` at the index position ``mod_idx``, if it exists.
  87. ----
  88. .. _class_SkeletonModificationStack3D_method_enable_all_modifications:
  89. - void **enable_all_modifications** **(** :ref:`bool<class_bool>` enabled **)**
  90. Enables all :ref:`SkeletonModification3D<class_SkeletonModification3D>`\ s in the stack.
  91. ----
  92. .. _class_SkeletonModificationStack3D_method_execute:
  93. - void **execute** **(** :ref:`float<class_float>` delta, :ref:`int<class_int>` execution_mode **)**
  94. Executes all of the :ref:`SkeletonModification3D<class_SkeletonModification3D>`\ s in the stack that use the same execution mode as the passed-in ``execution_mode``, starting from index ``0`` to :ref:`modification_count<class_SkeletonModificationStack3D_property_modification_count>`.
  95. \ **Note:** The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results.
  96. ----
  97. .. _class_SkeletonModificationStack3D_method_get_is_setup:
  98. - :ref:`bool<class_bool>` **get_is_setup** **(** **)** |const|
  99. Returns a boolean that indicates whether the modification stack is setup and can execute.
  100. ----
  101. .. _class_SkeletonModificationStack3D_method_get_modification:
  102. - :ref:`SkeletonModification3D<class_SkeletonModification3D>` **get_modification** **(** :ref:`int<class_int>` mod_idx **)** |const|
  103. Returns the :ref:`SkeletonModification3D<class_SkeletonModification3D>` at the passed-in index, ``mod_idx``.
  104. ----
  105. .. _class_SkeletonModificationStack3D_method_get_skeleton:
  106. - :ref:`Skeleton3D<class_Skeleton3D>` **get_skeleton** **(** **)** |const|
  107. Returns the :ref:`Skeleton3D<class_Skeleton3D>` node that the SkeletonModificationStack3D is bound to.
  108. ----
  109. .. _class_SkeletonModificationStack3D_method_set_modification:
  110. - void **set_modification** **(** :ref:`int<class_int>` mod_idx, :ref:`SkeletonModification3D<class_SkeletonModification3D>` modification **)**
  111. Sets the modification at ``mod_idx`` to the passed-in modification, ``modification``.
  112. ----
  113. .. _class_SkeletonModificationStack3D_method_setup:
  114. - void **setup** **(** **)**
  115. Sets up the modification stack so it can execute. This function should be called by :ref:`Skeleton3D<class_Skeleton3D>` and shouldn't be called unless you know what you are doing.
  116. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  117. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  118. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  119. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  120. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  121. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`