Codeboard.
Technical referenceAPI signaturesData shapes

Deformation types

Data shapes for deformation. See all type groups for other domains and shared units. Import public types from codeboard-studio; helper shapes are included to explain nested values.

SkinMeshInput

Code
export interface SkinMeshInput {
    source: MeshAnimation["source"];
    triangles: MeshAnimation["triangles"];
    joints: readonly {
        id: string;
        bind: Readonly<AffineMatrix>;
    }[];
    weights: readonly (readonly {
        jointId: string;
        weight: number;
    }[])[];
}

LayerSkinInput

Code
export interface LayerSkinInput extends SkinMeshInput {
    jointLayers: readonly {
        jointId: string;
        layerId: string;
    }[];
}

SkinJointPose

Code
export interface SkinJointPose {
    jointId: string;
    matrix: Readonly<AffineMatrix>;
}

Position

Code
type Position = {
    readonly x: number;
    readonly y: number;
};

CurveMeshPose

Code
export type CurveMeshPose = {
    curve: readonly [
        Position,
        Position,
        Position,
        Position
    ];
    width: number;
};

CurveMeshInput

Code
export interface CurveMeshInput {
    rest: CurveMeshPose;
    segments?: number;
    keyframes: readonly (CurveMeshPose & {
        frame: number;
        easing: Easing;
    })[];
}

EnvelopeMeshPose

Code
export type EnvelopeMeshPose = Record<"top" | "bottom" | "left" | "right", CurveMeshPose["curve"]>;

EnvelopeMeshInput

Code
export interface EnvelopeMeshInput {
    rest: EnvelopeMeshPose;
    columns?: number;
    rows?: number;
    keyframes: readonly {
        frame: number;
        pose: EnvelopeMeshPose;
        easing: Easing;
    }[];
}

ShotMeshBinding

Code
export type ShotMeshBinding = {
    layerId: string;
} & ({
    skin: LayerSkinInput;
    mesh?: never;
    curve?: never;
    envelope?: never;
} | {
    mesh: MeshAnimation;
    curve?: never;
    envelope?: never;
    skin?: never;
} | {
    curve: CurveMeshInput;
    mesh?: never;
    envelope?: never;
    skin?: never;
} | {
    envelope: EnvelopeMeshInput;
    mesh?: never;
    curve?: never;
    skin?: never;
});

MeshAnimation

Code
export interface MeshAnimation {
    source: readonly {
        readonly x: number;
        readonly y: number;
    }[];
    triangles: readonly (readonly [
        number,
        number,
        number
    ])[];
    keyframes: readonly {
        frame: number;
        vertices: readonly {
            readonly x: number;
            readonly y: number;
        }[];
        easing: Easing;
    }[];
}

On this page