<div dir="ltr"><div>Hi Don,</div><div><br></div><div><br></div><div>> Something that jumps out is when you say "How would you make a Group that contains a Shape, a Transform and another Shape ?</div><div>> It can't be the following because an Object can't define property Shape twice".</div><div>></div><div>> That is indeed a serious constraint, if it is indeed correct - that wasn't clear about Javascript. (got a reference?)</div><div><br></div><div>Imagine this Javascript code:</div><div><br></div><div><span class="" style="white-space:pre">   </span>var myobj = {</div><div><span class="" style="white-space:pre">              </span>"value": 1,</div><div><span class="" style="white-space:pre">              </span>"value": 2,</div><div><span class="" style="white-space:pre">              </span>"value": 3</div><div><span class="" style="white-space:pre">       </span>};</div><div><br></div><div>What would you expect the value of "myobj.value" to be ?</div><div>Maybe it's 1, maybe it's 3 (most likely), maybe it's neither because it threw an exception because the property is already defined.<br></div><div><br></div><div>Regardless of the result, some of the information get lost; therefore if something needs multiple values, it's safer to use an Array instead.<br></div><div><br></div><div><br></div><div><br></div><div>> Wondering then, what about your repeated use of "_type", isn't that the same sort of repetition as repeating "Shape" and "Transform" ?</div><div><br></div><div>Using property "Shape" would require an extra Object between the Array and the object that contains the shape fields to be able to use a key/value pair.</div><div><br></div><div>Longer reply with code samples:</div><div><a href="https://github.com/wildpeaks/json-scenegraph/issues/3">https://github.com/wildpeaks/json-scenegraph/issues/3</a></div><div><br></div><div><br></div><div><br></div><div>> wondering then whether this slight variation using field name (containerField) is an alternative option:</div><div>>     "_children": "Shape"</div><div>>     ...</div><div>> },</div><div>> {</div><div>>    "_children": "Transform"</div><div>>    ...</div><div>> },</div><div>> {</div><div>>    "_children": "Shape"</div><div><br></div><div>It would have two downsides:</div><div> - SFNode gets written a different way based on where it is in the scenegraph</div><div> - you can't know the list of nodes in a given field unless you parse the whole list of nodes</div><div><br></div><div>Longer reply with code samples:</div><div><a href="https://github.com/wildpeaks/json-scenegraph/issues/4">https://github.com/wildpeaks/json-scenegraph/issues/4</a></div><div><br></div><div><br></div><div>See you,</div><div>Cecile</div></div>