xeolabs / scenejs-pycollada

Python-based COLLADA importer for SceneJS using pycollada
http://scenejs.wikispaces.com/scenejs-pycollada
21 stars 7 forks source link

Human-readable ordering of node properties in exported JSON #5

Open xeolabs opened 13 years ago

xeolabs commented 13 years ago

Output the properties of JSON scene nodes in the documentation-standard order for better human readability.

Currently they are like this:

 {
           eye:  {
                    y: -7.62713003159,
                    x: 8.66106128693,
                    z: 6.7982840538,
           },
           nodes: [
                   ...
           ],
           look: { ...},
           type: "lookAt",
           id: "foo"
}

Nicer to have like this, where "type" and "id" are first, then other properties, then "nodes" is last:

 {
           type: "lookAt",
           id: "foo"

           look: { ...},
           eye:  {
                    y: -7.62713003159,
                    x: 8.66106128693,
                    z: 6.7982840538,
           },
           nodes: [
                   ...
           ],
}
rehno-lindeque commented 13 years ago

True, also "x" "y" "z" should be output in the correct order. The pretty printing module needs to be updated with some ordering rules, unfortunately I don't have time for this myself.

xeolabs commented 13 years ago

No prob - let's just tag and bag any issues just to have them tracked. We can point contributors to these later.

rehno-lindeque commented 13 years ago

Sounds good to me. This one shouldn't be that hard for a newcomer - those ouput objects are extremely simple.