user: How do I use Action(ID) in Blender? Include parameters, examples, warnings and best practices.

assistant: # Action(ID)

base classes — [`bpy_struct`](bpy.types.bpy_struct.html#bpy.types.bpy_struct "bpy.types.bpy_struct"), [`ID`](bpy.types.ID.html#bpy.types.ID "bpy.types.ID")

*class* bpy.types.Action(*ID*)
:   A collection of F-Curves for animation

    curve_frame_range
    :   The combined frame range of all F-Curves within this action

        Type:
        :   [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 2 items in [-inf, inf], default (0.0, 0.0), (readonly)

    frame_end
    :   The end frame of the manually set intended playback range

        Type:
        :   float in [-1.04857e+06, 1.04857e+06], default 0.0

    frame_range
    :   The intended playback frame range of this action, using the manually set range if available, or the combined frame range of all F-Curves within this action if not (assigning sets the manual frame range)

        Type:
        :   [`mathutils.Vector`](mathutils.html#mathutils.Vector "mathutils.Vector") of 2 items in [-inf, inf], default (0.0, 0.0)

    frame_start
    :   The start frame of the manually set intended playback range

        Type:
        :   float in [-1.04857e+06, 1.04857e+06], default 0.0

    is_action_layered
    :   Return whether this is a layered Action. An empty Action is considered as both a ‘legacy’ and a ‘layered’ Action.

        Type:
        :   boolean, default False, (readonly)

    is_action_legacy
    :   Return whether this is a legacy Action. Legacy Actions have no layers or slots. An empty Action is considered as both a ‘legacy’ and a ‘layered’ Action. Since Blender 4.4 actions are automatically updated to layered actions, and thus this will only return True when the action is empty

        Type:
        :   boolean, default False, (readonly)

    is_empty
    :   False when there is any Layer, Slot, or legacy F-Curve

        Type:
        :   boolean, default False, (readonly)

    layers
    :   The list of layers that make up this Action

        Type:
        :   [`ActionLayers`](bpy.types.ActionLayers.html#bpy.types.ActionLayers "bpy.types.ActionLayers") [`bpy_prop_collection`](bpy.types.bpy_prop_collection.html#bpy.types.bpy_prop_collection "bpy.types.bpy_prop_collection") of [`ActionLayer`](bpy.types.ActionLayer.html#bpy.types.ActionLayer "bpy.types.ActionLayer"), (readonly)

    pose_markers
    :   Markers specific to this action, for labeling poses

        Type:
        :   [`ActionPoseMarkers`](bpy.types.ActionPoseMarkers.html#bpy.types.ActionPoseMarkers "bpy.types.ActionPoseMarkers") [`bpy_prop_collection`](bpy.types.bpy_prop_collection.html#bpy.types.bpy_prop_collection "bpy.types.bpy_prop_collection") of [`TimelineMarker`](bpy.types.TimelineMarker.html#bpy.types.TimelineMarker "bpy.types.TimelineMarker"), (readonly)

    slots
    :   The list of slots in this Action

        Type:
        :   [`ActionSlots`](bpy.types.ActionSlots.html#bpy.types.ActionSlots "bpy.types.ActionSlots") [`bpy_prop_collection`](bpy.types.bpy_prop_collection.html#bpy.types.bpy_prop_collection "bpy.types.bpy_prop_collection") of [`ActionSlot`](bpy.types.ActionSlot.html#bpy.types.ActionSlot "bpy.types.ActionSlot"), (readonly)

    use_cyclic
    :   The action is intended to be used as a cycle looping over its manually set playback frame range (enabling this does not automatically make it loop)

        Type:
        :   boolean, default False

    use_frame_range
    :   Manually specify the intended playback frame range for the action (this range is used by some tools, but does not affect animation evaluation)

        Type:
        :   boolean, default False

    deselect_keys()
    :   Deselects all keys of the Action. The selection status of F-Curves is unchanged.

    fcurve_ensure_for_datablock(*datablock*, *data_path*, *\**, *index=0*, *group_name=''*)
    :   Ensure that an F-Curve exists, with the given data path and array index, for the given data-block. This action must already be assigned to the data-block. This function will also create the layer, keyframe strip, and action slot if necessary, and take care of assigning the action slot too

        Parameters:
        :   - **datablock** ([`ID`](bpy.types.ID.html#bpy.types.ID "bpy.types.ID"), (never None)) – The data-block animated by this action, for which to ensure the F-Curve exists. This action must already be assigned to the data-block
            - **data_path** (*string**,* *(**never None**)*) – Data Path, F-Curve data path
            - **index** (*int in* *[**0**,* *inf**]**,* *(**optional**)*) – Index, Array index
            - **group_name** (*string**,* *(**optional**,* *never None**)*) – Group Name, Name of the group for this F-Curve, if any. If the F-Curve already exists, this parameter is ignored

        Returns:
        :   The found or created F-Curve

        Return type:
        :   [`FCurve`](bpy.types.FCurve.html#bpy.types.FCurve "bpy.types.FCurve")

    flip_with_pose(*object*)
    :   Flip the action around the X axis using a pose

        Parameters:
        :   **object** ([`Object`](bpy.types.Object.html#bpy.types.Object "bpy.types.Object"), (never None)) – The reference armature object to use when flipping

    *classmethod* bl_rna_get_subclass(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The RNA type or default when not found.

        Return type:
        :   [`bpy.types.Struct`](bpy.types.Struct.html#bpy.types.Struct "bpy.types.Struct") subclass

    *classmethod* bl_rna_get_subclass_py(*id*, *default=None*, */*)
    :   Parameters:
        :   **id** (*str*) – The RNA type identifier.

        Returns:
        :   The class or default when not found.

        Return type:
        :   type