User:Jacek Antonelli/Object Import and Export/YAML Format

This is a YAML expression of the proposed object structure. Compare to the JSON expression of the same object.

Pros & Cons

 * Pro: Much less verbose and more readable than XML, maybe even than JSON.
 * Pro: The YAML specification includes a comment syntax (#).
 * Pro: YAML supports &anchors and *aliases to help avoid unnecessary repetition of data.
 * Pro: YAML supports !tags, so we can e.g. explicitly mark a string as being a UUID (!uuid "...").
 * Con: The syntax feels a bit funky to me. We could do a more JSON-ish variation of it, though.
 * Con: Meaningful indentation feels icky to me...

Example
--- objects: - group:  null deeded: no

sale: for sale:  no    price:      0 sale type: contents

permissions: free to copy:     no      share with group:  no

next owner: modify:   no        copy:      no        transfer:  yes

phantom:   no    physical:   no    locked:     no    temporary:  no

position:  [126, 124.5, 25.5941811] rotation:  [0, 0, 0, 1]

attachment point: null

prims:

- name:         Parent Prim description:  A cube

click action: touch

position:     [0, 0, 0] rotation:     [0, 0, 0, 1] scale:        [0.5, 0.5, 0.5]

material:     wood

shape: type:         cube cut:          [0, 1] hollow:       0 hollow shape: null twist:        [0, 0] taper:        [0, 0] top shear:    [0, 0] slice:        [0, 1]

flexible: enabled:      no          softness:      2 gravity:      0.3 drag:         2 wind:         0 tension:      1 force:        [0, 0, 0]

light: enabled:      no          color:         [1, 1, 1] intensity:    1 radius:       10 falloff:      0.75

textures: all sides: &texturesettings1 color:      [1, 1, 1, 1] scale:      [1, 1] offset:     [0, 0] rotation:   0 bump:       null shiny:      0 fullbright: no            mapping:     default glow:       0 image:      !uuid "89556747-24cb-43ed-920b-47caed15465f"

contents:

- type:        object name:        Contents Object description:

permissions: free to copy:     no              share with group:  no

next owner: modify:   no                copy:      no                transfer:  yes

- type:        snapshot name:        Contents Snapshot description: Snapshot Description

permissions: free to copy:     no              share with group:  no

next owner: modify:  yes copy:    yes transfer: yes

- name:         First Child Prim description:  A sphere

click action: touch

position: [0, 0, 0.5] rotation: [0, 0.707106769, 0, 0.707106769] scale:   [0.5, 0.5, 0.5]

material:     wood

shape: type:         sphere cut:          [0, 1] hollow:       0 hollow shape: null twist:        [0, 0] slice:        [0, 1]

light:    null textures: *texturesettings1 contents: null

- name:         Second Child Prim description:  A torus

click action: touch

position:     [0, 0, 0.5] rotation:     [0, 0.707106769, 0, 0.707106769] scale:        [0.5, 0.5, 0.5]

material:     wood

shape: type:          torus cut:           [0, 1] hollow:        0 hollow shape:  null twist:         [0, 0] taper:         [0, 0] top shear:     [0, 0] thickness:     [0, 0] slice:         [0, 1] radius offset: 0 revolutions:   0

light:    null textures: *texturesettings1 contents: null ...