user: Give a detailed overview of Graph Operators: syntax, arguments, return values, common patterns.

assistant: # Graph Operators

bpy.ops.graph.bake_keys()
:   Add keyframes on every frame between the selected keyframes

bpy.ops.graph.blend_offset(*\**, *factor=0.0*)
:   Shift selected keys to the value of the neighboring keys as a block

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Offset Factor, Control which key to offset towards and how far

bpy.ops.graph.blend_to_default(*\**, *factor=0.0*)
:   Blend selected keys to their default value from their current position

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Factor, How much to blend to the default value

bpy.ops.graph.blend_to_ease(*\**, *factor=0.0*)
:   Blends keyframes from current state to an ease-in or ease-out curve

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Blend, Favor either original data or ease curve

bpy.ops.graph.blend_to_neighbor(*\**, *factor=0.0*)
:   Blend selected keyframes to their left or right neighbor

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Blend, The blend factor with 0 being the current frame

bpy.ops.graph.breakdown(*\**, *factor=0.0*)
:   Move selected keyframes to an inbetween position relative to adjacent keys

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Factor, Favor either the left or the right key

bpy.ops.graph.butterworth_smooth(*\**, *cutoff_frequency=3.0*, *filter_order=4*, *samples_per_frame=1*, *blend=1.0*, *blend_in_out=1*)
:   Smooth an F-Curve while maintaining the general shape of the curve

    Parameters:
    :   - **cutoff_frequency** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Frequency Cutoff (Hz), Lower values give a smoother curve
        - **filter_order** (*int in* *[**1**,* *32**]**,* *(**optional**)*) – Filter Order, Higher values produce a harder frequency cutoff
        - **samples_per_frame** (*int in* *[**1**,* *64**]**,* *(**optional**)*) – Samples per Frame, How many samples to calculate per frame, helps with subframe data
        - **blend** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Blend, How much to blend to the smoothed curve
        - **blend_in_out** (*int in* *[**0**,* *inf**]**,* *(**optional**)*) – Blend In/Out, Linearly blend the smooth data to the border frames of the selection

bpy.ops.graph.clean(*\**, *threshold=0.001*, *channels=False*)
:   Simplify F-Curves by removing closely spaced keyframes

    Parameters:
    :   - **threshold** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Threshold
        - **channels** (*boolean**,* *(**optional**)*) – Channels

bpy.ops.graph.click_insert(*\**, *frame=1.0*, *value=1.0*, *extend=False*)
:   Insert new keyframe at the cursor position for the active F-Curve

    Parameters:
    :   - **frame** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Frame Number, Frame to insert keyframe on
        - **value** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Value, Value for keyframe on
        - **extend** (*boolean**,* *(**optional**)*) – Extend, Extend selection instead of deselecting everything first

bpy.ops.graph.clickselect(*\**, *wait_to_deselect_others=False*, *use_select_on_click=False*, *mouse_x=0*, *mouse_y=0*, *extend=False*, *deselect_all=False*, *column=False*, *curves=False*)
:   Select keyframes by clicking on them

    Parameters:
    :   - **wait_to_deselect_others** (*boolean**,* *(**optional**)*) – Wait to Deselect Others
        - **use_select_on_click** (*boolean**,* *(**optional**)*) – Act on Click, Instead of selecting on mouse press, wait to see if there’s drag event. Otherwise select on mouse release
        - **mouse_x** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Mouse X
        - **mouse_y** (*int in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Mouse Y
        - **extend** (*boolean**,* *(**optional**)*) – Extend Select, Toggle keyframe selection instead of leaving newly selected keyframes only
        - **deselect_all** (*boolean**,* *(**optional**)*) – Deselect On Nothing, Deselect all when nothing under the cursor
        - **column** (*boolean**,* *(**optional**)*) – Column Select, Select all keyframes that occur on the same frame as the one under the mouse
        - **curves** (*boolean**,* *(**optional**)*) – Only Curves, Select all the keyframes in the curve

bpy.ops.graph.copy()
:   Copy selected keyframes to the internal clipboard

bpy.ops.graph.cursor_set(*\**, *frame=0.0*, *value=0.0*)
:   Interactively set the current frame and value cursor

    Parameters:
    :   - **frame** (*float in* *[**-1.04857e+06**,* *1.04857e+06**]**,* *(**optional**)*) – Frame
        - **value** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Value

bpy.ops.graph.decimate(*\**, *mode='RATIO'*, *factor=0.333333*, *remove_error_margin=0.0*)
:   Decimate F-Curves by removing keyframes that influence the curve shape the least

    Parameters:
    :   - **mode** (enum in [`'RATIO'`, `'ERROR'`], (optional)) –

          Mode, Which mode to use for decimation

          - `RATIO`
            Ratio – Use a percentage to specify how many keyframes you want to remove.
          - `ERROR`
            Error Margin – Use an error margin to specify how much the curve is allowed to deviate from the original path.
        - **factor** (*float in* *[**0**,* *1**]**,* *(**optional**)*) – Factor, The ratio of keyframes to remove
        - **remove_error_margin** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Max Error Margin, How much the new decimated curve is allowed to deviate from the original

bpy.ops.graph.delete(*\**, *confirm=True*)
:   Remove all selected keyframes

    Parameters:
    :   **confirm** (*boolean**,* *(**optional**)*) – Confirm, Prompt for confirmation

bpy.ops.graph.driver_delete_invalid()
:   Delete all visible drivers considered invalid

bpy.ops.graph.driver_variables_copy()
:   Copy the driver variables of the active driver

bpy.ops.graph.driver_variables_paste(*\**, *replace=False*)
:   Add copied driver variables to the active driver

    Parameters:
    :   **replace** (*boolean**,* *(**optional**)*) – Replace Existing, Replace existing driver variables, instead of just appending to the end of the existing list

bpy.ops.graph.duplicate(*\**, *mode='TRANSLATION'*)
:   Make a copy of all selected keyframes

    Parameters:
    :   **mode** (enum in [Transform Mode Type Items](bpy_types_enum_items/transform_mode_type_items.html#rna-enum-transform-mode-type-items), (optional)) – Mode

bpy.ops.graph.duplicate_move(*\**, *GRAPH_OT_duplicate=None*, *TRANSFORM_OT_translate=None*)
:   Make a copy of all selected keyframes and move them

    Parameters:
    :   - **GRAPH_OT_duplicate** (`GRAPH_OT_duplicate`, (optional)) – Duplicate Keyframes, Make a copy of all selected keyframes
        - **TRANSFORM_OT_translate** (`TRANSFORM_OT_translate`, (optional)) – Move, Move selected items

bpy.ops.graph.ease(*\**, *factor=0.0*, *sharpness=2.0*)
:   Align keyframes on a ease-in or ease-out curve

    Parameters:
    :   - **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Curve Bend, Defines if the keys should be aligned on an ease-in or ease-out curve
        - **sharpness** (*float in* *[**0.001**,* *inf**]**,* *(**optional**)*) – Sharpness, Higher values make the change more abrupt

bpy.ops.graph.easing_type(*\**, *type='AUTO'*)
:   Set easing type for the F-Curve segments starting from the selected keyframes

    Parameters:
    :   **type** (enum in [Beztriple Interpolation Easing Items](bpy_types_enum_items/beztriple_interpolation_easing_items.html#rna-enum-beztriple-interpolation-easing-items), (optional)) – Type

bpy.ops.graph.equalize_handles(*\**, *side='LEFT'*, *handle_length=5.0*, *flatten=False*)
:   Ensure selected keyframes’ handles have equal length, optionally making them horizontal. Automatic, Automatic Clamped, or Vector handle types will be converted to Aligned

    Parameters:
    :   - **side** (enum in [`'LEFT'`, `'RIGHT'`, `'BOTH'`], (optional)) –

          Side, Side of the keyframes’ Bézier handles to affect

          - `LEFT`
            Left – Equalize selected keyframes’ left handles.
          - `RIGHT`
            Right – Equalize selected keyframes’ right handles.
          - `BOTH`
            Both – Equalize both of a keyframe’s handles.
        - **handle_length** (*float in* *[**0.1**,* *inf**]**,* *(**optional**)*) – Handle Length, Length to make selected keyframes’ Bézier handles
        - **flatten** (*boolean**,* *(**optional**)*) – Flatten, Make the values of the selected keyframes’ handles the same as their respective keyframes

bpy.ops.graph.euler_filter()
:   Fix large jumps and flips in the selected Euler Rotation F-Curves arising from rotation values being clipped when baking physics

bpy.ops.graph.extrapolation_type(*\**, *type='CONSTANT'*)
:   Set extrapolation mode for selected F-Curves

    Parameters:
    :   **type** (enum in [`'CONSTANT'`, `'LINEAR'`, `'MAKE_CYCLIC'`, `'CLEAR_CYCLIC'`], (optional)) –

        Type

        - `CONSTANT`
          Constant Extrapolation – Values on endpoint keyframes are held.
        - `LINEAR`
          Linear Extrapolation – Straight-line slope of end segments are extended past the endpoint keyframes.
        - `MAKE_CYCLIC`
          Make Cyclic (F-Modifier) – Add Cycles F-Modifier if one does not exist already.
        - `CLEAR_CYCLIC`
          Clear Cyclic (F-Modifier) – Remove Cycles F-Modifier if not needed anymore.

bpy.ops.graph.fmodifier_add(*\**, *type='NULL'*, *only_active=False*)
:   Add F-Modifier to the active/selected F-Curves

    Parameters:
    :   - **type** (enum in [Fmodifier Type Items](bpy_types_enum_items/fmodifier_type_items.html#rna-enum-fmodifier-type-items), (optional)) – Type
        - **only_active** (*boolean**,* *(**optional**)*) – Only Active, Only add F-Modifier to active F-Curve

bpy.ops.graph.fmodifier_copy()
:   Copy the F-Modifier(s) of the active F-Curve

bpy.ops.graph.fmodifier_paste(*\**, *only_active=False*, *replace=False*)
:   Add copied F-Modifiers to the selected F-Curves

    Parameters:
    :   - **only_active** (*boolean**,* *(**optional**)*) – Only Active, Only paste F-Modifiers on active F-Curve
        - **replace** (*boolean**,* *(**optional**)*) – Replace Existing, Replace existing F-Modifiers, instead of just appending to the end of the existing list

bpy.ops.graph.frame_jump()
:   Place the cursor on the midpoint of selected keyframes

bpy.ops.graph.gaussian_smooth(*\**, *factor=1.0*, *sigma=0.33*, *filter_width=6*)
:   Smooth the curve using a Gaussian filter

    Parameters:
    :   - **factor** (*float in* *[**0**,* *inf**]**,* *(**optional**)*) – Factor, How much to blend to the default value
        - **sigma** (*float in* *[**0.001**,* *inf**]**,* *(**optional**)*) – Sigma, The shape of the gaussian distribution, lower values make it sharper
        - **filter_width** (*int in* *[**1**,* *64**]**,* *(**optional**)*) – Filter Width, How far to each side the operator will average the key values

bpy.ops.graph.ghost_curves_clear()
:   Clear F-Curve snapshots (Ghosts) for active Graph Editor

bpy.ops.graph.ghost_curves_create()
:   Create snapshot (Ghosts) of selected F-Curves as background aid for active Graph Editor

bpy.ops.graph.handle_type(*\**, *type='FREE'*)
:   Set type of handle for selected keyframes

    Parameters:
    :   **type** (enum in [Keyframe Handle Type Items](bpy_types_enum_items/keyframe_handle_type_items.html#rna-enum-keyframe-handle-type-items), (optional)) – Type

bpy.ops.graph.hide(*\**, *unselected=False*)
:   Hide selected curves from Graph Editor view

    Parameters:
    :   **unselected** (*boolean**,* *(**optional**)*) – Unselected, Hide unselected rather than selected curves

bpy.ops.graph.interpolation_type(*\**, *type='CONSTANT'*)
:   Set interpolation mode for the F-Curve segments starting from the selected keyframes

    Parameters:
    :   **type** (enum in [Beztriple Interpolation Mode Items](bpy_types_enum_items/beztriple_interpolation_mode_items.html#rna-enum-beztriple-interpolation-mode-items), (optional)) – Type

bpy.ops.graph.keyframe_insert(*\**, *type='ALL'*)
:   Insert keyframes for the specified channels

    Parameters:
    :   **type** (enum in [`'ALL'`, `'SEL'`, `'ACTIVE'`, `'CURSOR_ACTIVE'`, `'CURSOR_SEL'`], (optional)) –

        Type

        - `ALL`
          All Channels – Insert a keyframe on all visible and editable F-Curves using each curve’s current value.
        - `SEL`
          Only Selected Channels – Insert a keyframe on selected F-Curves using each curve’s current value.
        - `ACTIVE`
          Only Active F-Curve – Insert a keyframe on the active F-Curve using the curve’s current value.
        - `CURSOR_ACTIVE`
          Active Channels at Cursor – Insert a keyframe for the active F-Curve at the cursor point.
        - `CURSOR_SEL`
          Selected Channels at Cursor – Insert a keyframe for selected F-Curves at the cursor point.

bpy.ops.graph.keyframe_jump(*\**, *next=True*)
:   Jump to previous/next keyframe

    Parameters:
    :   **next** (*boolean**,* *(**optional**)*) – Next Keyframe

bpy.ops.graph.keys_to_samples()
:   Convert selected channels to an uneditable set of samples to save storage space

bpy.ops.graph.match_slope(*\**, *factor=0.0*)
:   Blend selected keys to the slope of neighboring ones

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Factor, Defines which keys to use as slope and how much to blend towards them

bpy.ops.graph.mirror(*\**, *type='CFRA'*)
:   Flip selected keyframes over the selected mirror line

    Parameters:
    :   **type** (enum in [`'CFRA'`, `'VALUE'`, `'YAXIS'`, `'XAXIS'`, `'MARKER'`], (optional)) –

        Type

        - `CFRA`
          By Times Over Current Frame – Flip times of selected keyframes using the current frame as the mirror line.
        - `VALUE`
          By Values Over Cursor Value – Flip values of selected keyframes using the cursor value (Y/Horizontal component) as the mirror line.
        - `YAXIS`
          By Times Over Zero Time – Flip times of selected keyframes, effectively reversing the order they appear in.
        - `XAXIS`
          By Values Over Zero Value – Flip values of selected keyframes (i.e. negative values become positive, and vice versa).
        - `MARKER`
          By Times Over First Selected Marker – Flip times of selected keyframes using the first selected marker as the reference point.

bpy.ops.graph.paste(*\**, *offset='START'*, *value_offset='NONE'*, *merge='MIX'*, *flipped=False*)
:   Paste keyframes from the internal clipboard for the selected channels, starting on the current frame

    Parameters:
    :   - **offset** (enum in [Keyframe Paste Offset Items](bpy_types_enum_items/keyframe_paste_offset_items.html#rna-enum-keyframe-paste-offset-items), (optional)) – Frame Offset, Paste time offset of keys
        - **value_offset** (enum in [Keyframe Paste Offset Value Items](bpy_types_enum_items/keyframe_paste_offset_value_items.html#rna-enum-keyframe-paste-offset-value-items), (optional)) – Value Offset, Paste keys with a value offset
        - **merge** (enum in [Keyframe Paste Merge Items](bpy_types_enum_items/keyframe_paste_merge_items.html#rna-enum-keyframe-paste-merge-items), (optional)) – Type, Method of merging pasted keys and existing
        - **flipped** (*boolean**,* *(**optional**)*) – Flipped, Paste keyframes from mirrored bones if they exist

bpy.ops.graph.previewrange_set()
:   Set Preview Range based on range of selected keyframes

bpy.ops.graph.push_pull(*\**, *factor=1.0*)
:   Exaggerate or minimize the value of the selected keys

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Factor, Control how far to push or pull the keys

bpy.ops.graph.reveal(*\**, *select=True*)
:   Make previously hidden curves visible again in Graph Editor view

    Parameters:
    :   **select** (*boolean**,* *(**optional**)*) – Select

bpy.ops.graph.samples_to_keys()
:   Convert selected channels from samples to keyframes

bpy.ops.graph.scale_average(*\**, *factor=1.0*)
:   Scale selected key values by their combined average

    Parameters:
    :   **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Scale Factor, The scale factor applied to the curve segments

bpy.ops.graph.scale_from_neighbor(*\**, *factor=0.0*, *anchor='LEFT'*)
:   Increase or decrease the value of selected keys in relationship to the neighboring one

    Parameters:
    :   - **factor** (*float in* *[**-inf**,* *inf**]**,* *(**optional**)*) – Factor, The factor to scale keys with
        - **anchor** (enum in [`'LEFT'`, `'RIGHT'`], (optional)) – Reference Key, Which end of the segment to use as a reference to scale from

bpy.ops.graph.select_all(*\**, *action='TOGGLE'*)
:   Toggle selection of all keyframes

    Parameters:
    :   **action** (enum in [`'TOGGLE'`, `'SELECT'`, `'DESELECT'`, `'INVERT'`], (optional)) –

        Action, Selection action to execute

        - `TOGGLE`
          Toggle – Toggle selection for all elements.
        - `SELECT`
          Select – Select all elements.
        - `DESELECT`
          Deselect – Deselect all elements.
        - `INVERT`
          Invert – Invert selection of all elements.

bpy.ops.graph.select_box(*\**, *axis_range=False*, *include_handles=True*, *tweak=False*, *use_curve_selection=True*, *xmin=0*, *xmax=0*, *ymin=0*, *ymax=0*, *wait_for_input=True*, *mode='SET'*)
:   Select all keyframes within the specified region

    Parameters:
    :   - **axis_range** (*boolean**,* *(**optional**)*) – Axis Range
        - **include_handles** (*boolean**,* *(**optional**)*) – Include Handles, Are handles tested individually against the selection criteria, independently from their keys. When unchecked, handles are (de)selected in unison