Toolchefs / kiko

animation curve format for the VFX industry
https://www.toolchefs.com
MIT License
101 stars 22 forks source link

Make kb format human-readable #5

Closed mottosso closed 4 years ago

mottosso commented 4 years ago

Hi toolchefs,

At the expense of diskspace, make outputted JSON human-readable by indenting and sorting keys.

This one is for discussion, and should not be merged as-is. The space cost is about 5x that of the original.

So likely something better suited for a user-specified option. Default to readable, which is good for beginners and first impression, and editable by studios/power-users looking to optimise.

Thoughts?

Before

{"data":{"channels":[],"children":[{"channels":[{"chunks":[{"opD
ata":{"value":0.0},"opName":"StaticOperator","opVer":1,"type
":"Chunk"}],"name":"translateX","type":"Channel"},{"chunks":
[{"opData":{"value":0.0},"opName":"StaticOperator","opVer":
1,"type":"Chunk"}],"name":"translateY","type":"Channel"},{"c
hunks":[{"opData":{"value":0.0},"opName":"StaticOperator","
opVer":1,"type":"Chunk"}],"name":"translateZ","type":"Chann
el"},{"chunks":[{"opData":{"value":0.0},"opName":"StaticOper
ator","opVer":1,"type":"Chunk"}],"name":"rotateX","type":"Ch
annel"},{"chunks":[{"opData":{"value":0.0},"opName":"StaticO
perator","opVer":1,"type":"Chunk"}],"name":"rotateY","type":"
Channel"},{"chunks":[{"opData...

After

{
  "data": {
    "channels": [], 
    "children": [
      {
        "channels": [
          {
            "chunks": [
              {
                "opData": {
                  "value": 0.0
                }, 
                "opName": "StaticOperator", 
                "opVer": 1, 
                "type": "Chunk"
              }
            ], 
            "name": "translateX", 
            "type": "Channel"
          }, 
          {
            "chunks": [
              {
                "opData": {
                  "value": 0.0
                }, 
                "opName": "StaticOperator", 
                "opVer": 1, 
                "type": "Chunk"
              }
...
danielefederico commented 4 years ago

Hello Marcus, this makes snse to me.

I'm merging this pull request.

Thanks, Daniele