:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SkeletonModification2D.xml. .. _class_SkeletonModification2D: SkeletonModification2D ====================== **Experimental:** This class may be changed or removed in future versions. **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`SkeletonModification2DCCDIK`, :ref:`SkeletonModification2DFABRIK`, :ref:`SkeletonModification2DJiggle`, :ref:`SkeletonModification2DLookAt`, :ref:`SkeletonModification2DPhysicalBones`, :ref:`SkeletonModification2DStackHolder`, :ref:`SkeletonModification2DTwoBoneIK` Base class for resources that operate on :ref:`Bone2D`\ s in a :ref:`Skeleton2D`. .. rst-class:: classref-introduction-group Description ----------- This resource provides an interface that can be expanded so code that operates on :ref:`Bone2D` nodes in a :ref:`Skeleton2D` can be mixed and matched together to create complex interactions. This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------+-----------------------------------------------------------------------------+----------+ | :ref:`bool` | :ref:`enabled` | ``true`` | +-------------------------+-----------------------------------------------------------------------------+----------+ | :ref:`int` | :ref:`execution_mode` | ``0`` | +-------------------------+-----------------------------------------------------------------------------+----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_draw_editor_gizmo`\ (\ ) |virtual| | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_execute`\ (\ delta\: :ref:`float`\ ) |virtual| | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_setup_modification`\ (\ modification_stack\: :ref:`SkeletonModificationStack2D`\ ) |virtual| | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`clamp_angle`\ (\ angle\: :ref:`float`, min\: :ref:`float`, max\: :ref:`float`, invert\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_editor_draw_gizmo`\ (\ ) |const| | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_is_setup`\ (\ ) |const| | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`SkeletonModificationStack2D` | :ref:`get_modification_stack`\ (\ ) | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_editor_draw_gizmo`\ (\ draw_gizmo\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_is_setup`\ (\ is_setup\: :ref:`bool`\ ) | +-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_SkeletonModification2D_property_enabled: .. rst-class:: classref-property :ref:`bool` **enabled** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_enabled**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_enabled**\ (\ ) If ``true``, the modification's :ref:`_execute()` function will be called by the :ref:`SkeletonModificationStack2D`. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_property_execution_mode: .. rst-class:: classref-property :ref:`int` **execution_mode** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_execution_mode**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_execution_mode**\ (\ ) The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_SkeletonModification2D_private_method__draw_editor_gizmo: .. rst-class:: classref-method |void| **_draw_editor_gizmo**\ (\ ) |virtual| :ref:`🔗` Used for drawing **editor-only** modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos. \ **Note:** You will need to use the Skeleton2D from :ref:`SkeletonModificationStack2D.get_skeleton()` and it's draw functions, as the **SkeletonModification2D** resource cannot draw on its own. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_private_method__execute: .. rst-class:: classref-method |void| **_execute**\ (\ delta\: :ref:`float`\ ) |virtual| :ref:`🔗` Executes the given modification. This is where the modification performs whatever function it is designed to do. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_private_method__setup_modification: .. rst-class:: classref-method |void| **_setup_modification**\ (\ modification_stack\: :ref:`SkeletonModificationStack2D`\ ) |virtual| :ref:`🔗` Called when the modification is setup. This is where the modification performs initialization. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_clamp_angle: .. rst-class:: classref-method :ref:`float` **clamp_angle**\ (\ angle\: :ref:`float`, min\: :ref:`float`, max\: :ref:`float`, invert\: :ref:`bool`\ ) :ref:`🔗` Takes an angle and clamps it so it is within the passed-in ``min`` and ``max`` range. ``invert`` will inversely clamp the angle, clamping it to the range outside of the given bounds. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_get_editor_draw_gizmo: .. rst-class:: classref-method :ref:`bool` **get_editor_draw_gizmo**\ (\ ) |const| :ref:`🔗` Returns whether this modification will call :ref:`_draw_editor_gizmo()` in the Godot editor to draw modification-specific gizmos. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_get_is_setup: .. rst-class:: classref-method :ref:`bool` **get_is_setup**\ (\ ) |const| :ref:`🔗` Returns whether this modification has been successfully setup or not. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_get_modification_stack: .. rst-class:: classref-method :ref:`SkeletonModificationStack2D` **get_modification_stack**\ (\ ) :ref:`🔗` Returns the :ref:`SkeletonModificationStack2D` that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_set_editor_draw_gizmo: .. rst-class:: classref-method |void| **set_editor_draw_gizmo**\ (\ draw_gizmo\: :ref:`bool`\ ) :ref:`🔗` Sets whether this modification will call :ref:`_draw_editor_gizmo()` in the Godot editor to draw modification-specific gizmos. .. rst-class:: classref-item-separator ---- .. _class_SkeletonModification2D_method_set_is_setup: .. rst-class:: classref-method |void| **set_is_setup**\ (\ is_setup\: :ref:`bool`\ ) :ref:`🔗` Manually allows you to set the setup state of the modification. This function should only rarely be used, as the :ref:`SkeletonModificationStack2D` the modification is bound to should handle setting the modification up. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`