Skip to content

JSON Data Specification

Luna edited this page Mar 26, 2022 · 8 revisions

NOTE

This documentation is currently out of date and will be updated soon!

Table of Contents

 

Puppets

Puppet

The puppet is the root of every puppet in your scene.

Type Tag Value Data
PuppetMeta meta Metadata of the puppet.
Node nodes A tree of nodes starting from the auto-generated Root node.

 

PuppetMeta

The meta section of a puppet contains the meta information about a puppet

Type Tag Value Data
string name The name of the puppet
string version The semver version of Inochi2D used to export the puppet
string[] authors An array of authors whom have contributed to the creation of the puppet
string copyright (OPTIONAL) Copyright string for the puppet, usually first author
string contact (OPTIONAL) Contact information of the (first) author, usually an email address.
string reference (OPTIONAL) URI of where the puppet originates, eg. BOOTH sale.
uint thumbnail_id (OPTIONAL) Texture Id to be used as a thumbnail.

 

 

 

Nodes

Node

Note: All subnodes inherit the values from Node

Type Tag Value Data
string type The Node's Type Id
UUID uuid The Node's unique ID
string name (OPTIONAL) Name of the Node
bool enabled Whether the node is enabled
float zsort Z Sorting base value
Transform transform The Node's transform
Node[] children Child nodes

 

Drawable

Inherits from Node
Note: All subnodes inherit the values from Drawable

Type Tag Value Data
MeshData mesh Mesh data of this drawable.

 

Part

Inherits from Drawable
Note: This node is subject to change!

Type Tag Value Data
uint[] textures Texture IDs of the textures this part use
float opacity The opacity of the Part
MaskingMode mask_mode The masking mode in use, Mask or Dodge
float mask_threshold Threshold of pixel opacity before it counts as a mask
UUID[] masked_by List of UUIDs this node is masked by.

 

Mask

Inherits from Drawable
Mask has no unique values, see Drawable.

 

PathDeform

Inherits from Node

Type Tag Value Data
vec2[] joints The joints in the path
JointBindingData[] bindings Bindings to parts

 

JointBindingData

This contains the data needed for a PathDeform to create a binding. This is not a node but just intermediary data.

Type Tag Value Data
UUID bound_to The Drawable this PathDeform is bound to
size_t[][] bind_data The actual binding data, see encoding of binding data below

bind_data is encoded as size_t[][<Joint>], where size_t[] is every index that gets affected by that joint.


 

 

 

Node Data

MeshData

Type Tag Value Data
float[] verts Vertex data, NEEDS TO BE IN PAIRS OF TWOS!
float[] uvs (OPTIONAL) UV data, NEEDS TO BE IN PAIRS OF TWOS!
ushort[] indices Index data

 

UUIDs

UUIDs are encoded as unsigned integers, see the page about UUIDs

 

Masking Mode

Enumeration encoded as strings, possible values are "Mask" and "Dodge".


 

 

 

Math and Other

Transform

Contains mixed 3D/2D transformation data.

Type Tag Value Data
vec3 trans Translation vector
bool[3] trans_lock (OPTIONAL) Translation locking state
vec3 rot Euler rotation vector
bool[3] rot_lock (OPTIONAL) Rotation locking state
vec2 scale Scaling vector
bool[2] scale_lock (OPTIONAL) Scaling locking state

 

vec2

Encoded as a float[2]

 

vec3

Encoded as a float[3]

 

size_t

Depends on platform, on 32 bit systems it's uint, on 64 it's ulong.
For the most part it shouldn't matter.