User:Jacek Antonelli/Object Import and Export/Object Structure

This describes the hypothetical structure of exported objects, in a format-agnostic way (i.e. the structure could be expressed as JSON, YAML, or XML).

Conventions
key : value means an entry in a hash/dict/map structure. Key must be a string, value can be anything.

@Whatever is a reference or stand in for a structure of type "Whatever" (e.g. @Permissions refers to Permissions Structure).

[whatever, ...] means an array of one or more whatevers.

(A &#124; B &#124; C) means it can be one of A or B or C.

string(whatever) means a string containing a whatever (e.g. string(uuid) would be a string containing a UUID, string(name group) would be a string containing a group name)

Object Structure

 * group : ( null | "active" | string(uuid) | string(group name) )
 * deeded : bool
 * sale : @Sales
 * permissions : @Permissions
 * phantom : bool
 * physical : bool
 * locked : bool
 * temporary : bool
 * position : [x, y, z]
 * rotation : [x, y, z]
 * attachment point : ( null | string )
 * prims : [ @Prim, ...]

Notes: position and rotation are global, and only correspond to the position and rotation of the root prim if the root prim's local position is [0,0,0] and its local rotation is [0,0,0,1].

Sales Structure

 * for sale : bool
 * price : number
 * sale type : ( "original" | "copy" | "contents" )

Permissions Structure

 * free to copy : bool
 * share with group : bool
 * next owner :
 * modify : bool
 * copy : bool
 * transfer : bool

Prim Structure

 * name : string
 * description : string
 * click action : ( "touch" | "pay" | "buy" | "sit" | etc. )
 * position : [x, y, z]
 * rotation : [x, y, z]
 * scale : [x, y, z]
 * material : "wood" | "rubber" | etc.
 * shape : @Shape
 * texture: { ( "all" | string(side number) ) : @Texture, ... }
 * contents : ( [] | [ @Item, ...] )

Notes: position and rotation are relative to the global values defined in the Object Structure

Texture Structure

 * color : ( [red, green, blue] | [red, green, blue, opacity] )
 * scale : [horizontal, vertical]
 * offset : [horizontal, vertical]
 * rotation : number
 * bump : null | string(bump pattern)
 * shiny : number
 * fullbright : bool
 * mapping : ( "default" | "planar" )
 * glow : number
 * image : ( null | string(uuid) | string(file) | string(inventory item) )

Notes: color values range from 0.0 to 1.0. opacity is the inverse of transparency (used in the viewer), i.e. opacity = 1.0 - transparency.

Shape Structure

 * type : ( "cube" | "cylinder" | "prism" | "sphere" | "torus" | "tube" | "ring" )
 * cut : [begin, end]
 * hollow : number
 * hollow shape : ( "default" | "square" | "circle" | "triangle" )
 * twist : [begin, end]
 * taper : [x, y]
 * top shear : [x, y]
 * slice : [begin, end]
 * thickness [x, y]
 * radius offset : number
 * revolutions : number
 * skew : number

Notes: "cut" is "Path Cut". "slice" is "Slice", "Dimple", and "Profile Cut". "thickness" is "Hole Size".

Item Structure

 * type : ( "object" | "snapshot" | "script" | etc. )
 * name : string
 * description : string
 * sale : @Sales
 * permissions : @Permissions