Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

File Structure

The editor exports a unique .skf file, which can be unzipped to reveal:

  • armature.json - Armature data (bones, animations, etc)
  • atlasX.png - Texture atlas(es), starting from 0
  • editor.json - Editor-only data
  • thumbnail.png - Armature preview image
  • readme.md - Little note for runtime devs

This section will only cover the content in armature.json.

Table of Contents

Armature

KeyTypeDefaultDescription
versionString""Editor version that exported this file
baked_ikBoolfalseWas this file exported with baked IK frames?
img_formatString"PNG"Exported atlas image format (PNG, JPG, etc)
clear_colorColor1Transparent2Exported clear color of atlas images
bonesBone[][]Array of all bones
animationsAnimation[][]Array of all animations
atlasesAtlas[][]Array of all atlases
stylesStyles[][]Array of all styles
inverse_kinematicsInverseKinematics[][]Array of all bone inverse kinematics data
visualsVisuals[][]Array of all bone visuals (texture, mesh)
physicsPhysics[][]Array of all bone physics data

Bones

KeyTypeDefaultDescription
idUint0Bone ID
nameString""Name of bone
posVec2(0, 0)Position of bone
rotFloat0Rotation of bone
scaleVec2(1, 1)Scale of bone
parent_idInt-1Bone parent ID (-1 if none)
texString""Name of texture to use
zindexInt0Z-index of bone (higher index renders above lower)
hiddenBoolfalseWhether this bone is hidden
tintColor1White3Color tint
inverse_kinematics_idInt-1Inverse Kinematics ID
visuals_idInt-1Visuals ID
physics_idInt-1Physics ID

Inverse Kinematics

Inverse kinematics is stored in the root (first) bone of each set of IK bones.

KeyTypeDefaultDescription
family_idUint-1The ID of family this bone is in (-1 by default)
constraintString"None"Constraint (Clockwise, CounterClockwise)
modeString"FABRIK"Mode (FABRIK, Arc)
target_idUint-1Target bone ID
bone_idsUint[][]ID of all bones in this family
mimic_targetBoolfalseShould the last bone follow target’s rotation?
init_constraintStringconstraintInitial field for constraint4
init_modeStringmodeInitial field for mode
init_mimic_targetBoolmimic_targetInitial field for mimic_target

Visuals

Visual data of each bone (texture & mesh)

KeyTypeDefaultDescription
texString""Name of texture to use
zindexInt0Z-index of bone (higher index renders above lower)
tintColor1White3Multiplicative color tint for texture
verticesVertex[][]Array of vertices
indicesUint[][]Each index is vertex ID. Every 3 IDs forms 1 triangle.
bindsBind[][]Array of bone binds
pivot_posVec2(0, 0)Position of texture pivot
pivot_scaleVec2(0, 0)Scale of texture pivot
pivot_rot[Float]0Rotation of texture pivot
init_texString""Initial field for tex4
init_tintColor1White3Initial field for tint
init_zindexInt0Initial field for zindex

Vertex

A mesh is defined by its vertices, which describe how each point is positioned, as well as how the texture is mapped (UV).

KeyTypeDefaultDescription
idUint0ID of vertex
posVec2(0, 0)Position of vertex
uvVec2(0, 0)UV of vertex
init_posIntposHelper for initial vertex position4

Bind

Meshes can have ‘binding’ bones to influence a set of vertices. These are the primary method of animating vertices.

KeyTypeDefaultDescription
idInt-1ID of bind
is_pathBoolfalseShould this bind behave like a path?
vertsBindVert[][]Array of vertex data associated to this bind

BindVert

Vertices assigned to a bind.

KeyTypeDefaultDescription
idUint0ID of vertex
weightFloat1Weight assigned to this vertex

Physics

KeyTypeDefaultDescription
global_posVec2(0, 0)Bone’s position based on physics. Overrides bone.position in inheritance()
global_scaleVec2(0, 0)Bone’s scale based on physics. Overrides bone.scale in inheritance()
global_rotFloat0Bone’s rotation based on physics. Overrides bone.rotation in inheritance()
pos_dampingFloat0Higher damping makes position interpolate slower towards bone.position
scale_dampingFloat0Higher damping makes scale interpolate slower towards bone.scale
rot_dampingFloat0Higher damping makes rotation interpolate slower towards bone.rotation
pos_ratioFloat0Ranges from -1 to 1. -1-0: less Y, 0-1: less X
scale_ratioFloat0Ranges from -1 to 1. -1-0: less Y, 0-1: less X
global_orbitFloat0Bone’s parental orbit based on physics. Overrides orbitRot in inheritance()
global_orbit_diffFloat0Used to offset global_orbit by this much when swaying
global_orbit_velFloat0Used to calculate velocity when rot_bounce is more than 0
swayFloat0When bone’s parent is moved, how much should this bone sway?
rot_bounceFloat0Along with sway, makes bone bouncy/wiggly

Animations

KeyTypeDefaultDescription
idString0ID of animation
nameString""Name of animation
fpsUint0Frames per second of animation
keyframesKeyframes[][]Data of all keyframes of animation

Keyframes

Keyframes are defined by their element (what’s animated), as well as either value or value_str (what value to animate element to)

Eg: element: PosX with value: 20 means ‘Position X = 20 at frame

KeyTypeDefaultDescription
frameUint0frame of keyframe
bone_idUint0ID of bone that keyframe refers to
elementString""Element to be animated by this keyframe
valueFloat0Value to set element of bone to
value_strString""String variant of value
next_kfInt-1Index of the next associated keyframe
start_handleFloat0.333Handle to use for start of interpolation
end_handleFloat0.666Handle to use for end of interpolation

Atlases

Easily-accessible information about texture atlas files.

KeyTypeDefaultDescription
filenameString""Name of file for this atlas
sizeVec2(0, 0)Size of image (in pixels)

Styles

Groups of textures.

KeyTypeDefaultDescription
idUint0ID of style
nameString""Name of style
texturesTexture[]Array of textures

Textures

Note: Coordinates are in pixels.

KeyTypeDefaultDescription
nameString""Name of texture
offsetVec2(0, 0)Top-left corner of texture in the atlas
sizeVec2(0, 0)Append to offset to get bottom-right corner of texture
atlas_idxUint0Index of atlas that this texture lives in

Initial Fields

Some fields in Bones, Visuals, Inverse Kinematics, and Physics have init_ counterparts. Their value is duplicated from the original field.

While the original field is modified during animation, init_ fields are used to return the original field back to its initial state (see ResetBones()).

Constructed Bones

An extra set of bones is recommended for optimization in the Construct() generic function. This is a clone of the bones array, but with construction applied to it for use later with Draw().


  1. A variant of Vec4: (red, green, blue, alpha) ↩2 ↩3 ↩4

  2. Transparent: (0, 0, 0, 0)

  3. White: (255, 255, 255, 255) ↩2 ↩3

  4. See Initial Fields ↩2 ↩3