• Shotcut QML Scripting API
  • org.shotcut.qml
  • KeyframesModel
  • KeyframesModel QML Type

    A two-level item model describing a filter's keyframeable parameters and their keyframes. More...

    Import Statement: import org.shotcut.qml

    Signals

    Methods

    Detailed Description

    KeyframesModel is available as the parameters context property in the Keyframes panel. The top level contains one row per keyframeable parameter; each parameter row contains one child row per keyframe.

    InterpolationType enum

    Passed to setInterpolation() and addKeyframe():

    ValueName
    0DiscreteInterpolation
    1LinearInterpolation
    2SmoothLooseInterpolation
    3SmoothNaturalInterpolation
    4SmoothTightInterpolation
    5–7EaseInSinusoidal / EaseOutSinusoidal / EaseInOutSinusoidal
    8–10EaseIn/Out/InOutQuadratic
    11–13EaseIn/Out/InOutCubic
    14–16EaseIn/Out/InOutQuartic
    17–19EaseIn/Out/InOutQuintic
    20–22EaseIn/Out/InOutExponential
    23–25EaseIn/Out/InOutCircular
    26–28EaseIn/Out/InOutBack
    29–31EaseIn/Out/InOutElastic
    32–34EaseIn/Out/InOutBounce

    Signal Documentation

    keyframeAdded(string parameter, int position)

    Emitted when a keyframe is added. parameter is the MLT property name; position is the frame number.

    Note: The corresponding handler is onKeyframeAdded.


    loaded()

    Emitted after the model has been populated for a new filter.

    Note: The corresponding handler is onLoaded.


    Method Documentation

    void addKeyframe(int parameterIndex, int position)

    Adds a keyframe at time position for parameterIndex using the current filter value.


    void addKeyframe(int parameterIndex, double value, int position, int type)

    Adds a keyframe at time position for parameterIndex with numeric value and interpolation type.


    bool advancedKeyframesInUse()

    Returns true if the filter is currently using advanced (per-keyframe) interpolation.


    bool isKeyframe(int parameterIndex, int position)

    Returns true if a keyframe exists at time position for parameterIndex.


    int keyframeIndex(int parameterIndex, int currentPosition)

    Returns the keyframe index at time currentPosition for the given parameterIndex, or -1 if no keyframe exists at that position.


    int parameterIndex(string propertyName)

    Returns the row index of the parameter identified by propertyName, or -1.


    void reload()

    Reloads the model from the current filter, refreshing all parameter and keyframe rows.


    bool remove(int parameterIndex, int keyframeIndex)

    Removes the keyframe at keyframeIndex on parameter parameterIndex. Returns true on success.


    void removeAdvancedKeyframes()

    Converts all advanced keyframes to simple (linear) keyframes.


    void removeSimpleKeyframes()

    Removes the simple keyframe animation, returning the filter to a static state.


    bool setInterpolation(int parameterIndex, int keyframeIndex, int type)

    Sets the interpolation type for the keyframe at keyframeIndex on parameterIndex. type is a value from the InterpolationType enum. Returns true on success.


    void setKeyframePosition(int parameterIndex, int keyframeIndex, int position)

    Moves the keyframe at keyframeIndex on parameterIndex to position (in frames).


    void setKeyframeValue(int parameterIndex, int keyframeIndex, double value)

    Sets the numeric value of an existing keyframe on parameter parameterIndex at keyframeIndex.


    void setKeyframeValuePosition(int parameterIndex, int keyframeIndex, double value, int position)

    Sets both the value and time position of keyframe keyframeIndex on parameter parameterIndex in one operation.


    bool simpleKeyframesInUse()

    Returns true if the filter is currently using simple (two-keyframe) animation.