← Back to Docs
  • index.html
  • Clayground
  • Clayground.Character3D
  • MoveSet
  • Clayground 2026.7
  • MoveSet QML Type

    A loadable set of named moves, played onto one Character. More...

    Import Statement: import Clayground.Character3D
    Inherited By:

    MartialArts

    Properties

    Signals

    Methods

    Detailed Description

    Sets are optional and are loaded on demand, unlike the basic animations every character carries; see Character.moveSet, which is the way one is normally loaded and the way it is given its entity.

    A set is this type plus a model: a Qt-free JavaScript library answering moves(), derive(move, opts), poseAt(table, t), mixPose(a, b, k) and restMove(). MartialArts is the set that ships with the plugin and the worked example of the shape.

    // movesets/MartialArts.qml
    import "../animation"
    import "martialarts.js" as MA
    
    MoveSet {
        name: "martial arts"
        model: ({ moves: MA.moves, derive: MA.derive, poseAt: MA.poseAt,
                  mixPose: MA.mixPose, restMove: MA.restMove })
    }

    See also Character::moveSet, MartialArts, and ActionCycleAnim.

    Property Documentation

    autoRest : bool

    Whether a one-shot hands back to restMove when it ends.

    On by default: a jab that leaves the body wherever the punch finished reads as the animation stopping rather than as a punch being thrown. A move the model marks as holding its last frame is exempt.


    blendMs : int

    How long a move takes to ease out of the pose the body was already in, in milliseconds.

    Zero cuts straight to the move's first frame.


    entity : var

    The Character whose joints this writes.

    Set by Character when it loads the set; a set with no entity does nothing rather than failing.


    handPose : string [read-only]

    What the current frame wants the hands to be doing, "" when the set is idle - a fist through most of a fighting set, a flat hand where one is planted on the floor.


    holding : bool [read-only]

    True while the set owns the joints - playing a move, or sitting on the last frame of one that holds.

    What Character consults before it lets the idle pose take the body back: a knockdown that is handed to the idle animation stands up again within a fifth of a second.


    intensity : real

    How hard the moves are thrown, 0..1.

    Speed and size, never a different pose - the same contract actionIntensity has, and it is fed from there.


    model : var

    The set's pose model - the object answering moves(), derive(), poseAt(), mixPose() and restMove().


    move : string [read-only]

    The move being played, or the one whose last frame is being held; "" when the set is idle.


    moves : var [read-only]

    What the set offers: a list of {name, label, group, loop, holds}, in the model's own order.


    name : string

    What the set is called, for a UI to show.


    phase : real

    Where in the move it is, 0..1. Set it with the animation stopped to hold one frame.


    playing : bool [read-only]

    True while a move is actually animating.


    restMove : string [read-only]

    The move a character in this set stands in when it is doing nothing else, "" when the set names none.


    Signal Documentation

    finished(string move)

    Emitted when a one-shot move reaches its end, before any hand-back to restMove.

    Note: The corresponding handler is onFinished.


    Method Documentation

    void apply(string move, real t)

    Freezes the joints at phase t of move, running or not.

    For looking, not for playing: a row of characters frozen at successive phases is the move on one sheet.


    bool has(string move)

    Whether the set offers move.


    bool play(string move)

    Starts move, easing out of whatever the body is holding. Returns false, and does nothing, when the set has no such move.


    var poseAt(string move, real t)

    The joint angles move holds at phase t, 0..1, with nothing running.

    Pure, and the same answer the running move gives at that moment - this type plays this very function. The wrist roll comes back as a fraction of a quarter turn; the degrees are the character's.


    void stop()

    Stops whatever is playing and lets go of the joints, which stay where the last frame left them.


    var tableFor(string move)

    The derived numbers move is replayed from at this set's intensity and this character's build - its cycleMs among them. Null when the set has no such move.