Skip to content

SkeletonAsset Guide

Peter Robinson edited this page Jun 25, 2026 · 4 revisions

Introduction

All assets are known engine types that allow instances to be created at runtime. The "SkeletonAsset" — actually the SpineAsset class — is derived from a base type of "AssetBase", so it includes all of that type's fields plus its own.

A SkeletonAsset points the engine at the files exported from a skeletal-animation program. The only program supported is Spine. The asset references two exported files — a Spine atlas (the packed texture + region data) and a Spine skeleton data file (the JSON or binary skeleton). A SkeletonAsset is then used in a scene through a SkeletonObject.

A note on naming: these pages are titled "Skeleton", but the actual engine class is SpineAsset and its skeleton-file field is SpineFile. The frozen masterspine branch is inconsistent here — some bundled example assets still use the older SkeletonAsset / SkeletonFile names. The _ScriptBinding.h is the source of truth.

⚠️ Spine support is not in the main engine

Using Spine requires a valid Spine license from Esoteric Software — and merely including the Spine runtime in a project triggers that requirement, even if a game doesn't use it. For that reason Spine was removed from the main engine and lives only on a separate masterspine branch, so the SpineAsset class is not present in a normal checkout.

See SkeletonObject for the full step-by-step on enabling Spine support (forking, merging masterspine, and wiring it into the CMake build) — and for an important warning that the bundled runtime is the old Spine 3.8 (current Spine is 4.3), so skeleton data exported from a modern Spine editor will not load without updating the runtime yourself.

TorqueScript Bindings

(On the masterspine branch.)

Exposed Fields

The SpineAsset type exposes the following fields in addition to those it inherits. Shown are the equivalent methods available that perform the same action in setting and getting the respective field:

  • AtlasFile
  • setAtlasFile(string)
  • getAtlasFile()
  • SpineFile
  • setSpineFile(string)
  • getSpineFile()
  • PreMultipliedAlpha — whether the texture was built with pre-multiplied alpha. (Set as a field; no dedicated get/set method.)

The following is a complete description of each of these fields.

AtlasFile (string)

The file path of the Spine atlas file. If your .asset.taml lives in the same folder as the atlas file, only the file name is needed.

%spineAsset.setAtlasFile("goblins.atlas");

SpineFile (string)

The file path of the Spine skeleton data file (the JSON or binary skeleton exported from Spine). If your .asset.taml lives in the same folder as the skeleton file, only the file name is needed.

%spineAsset.setSpineFile("goblins.json");

TAML Format

A SkeletonAsset is normally defined in a .asset.taml file alongside its atlas and skeleton files. Here is the example in XML format:

<SpineAsset
    AssetName="goblins"
    AtlasFile="goblins.atlas"
    SpineFile="goblins.json" />

Note: the SpineToy example shipped in masterspine still uses the older <SkeletonAsset … SkeletonFile="…"> form. That older tag predates the current SpineAsset class — use the field names shown above and verify against SpineAsset_ScriptBinding.h.

Clone this wiki locally