COLLADA2GLTF
COLLADA2GLTF copied to clipboard
Inconsistent ordering of GLTF JSON name property
It seems that sometimes the name
property is written first, and sometimes last.
That's because the base class GLTF::Object::writeJSON
is not always called in the beginning of each override writeJSON method.
GLTF::Object::writeJSON
also writes other properties like extras
and extensions
.
I think it is easier to debug and read the JSON when the name
property always comes first?
Seems reasonable - I think we'll do this as part of #94.
Okay, nice. I already patched the code in a fork, and I also noticed that many objects derive from GLTF::Object
are not children-of-the-root, and according to the official GLTF schema, these should not have a name. So we might need to add an extra base-class GLTF::ChildOfRoot
or something, like in the schema.
Okay, nice. I already patched the code in a fork, and I also noticed that many objects derive from GLTF::Object are not children-of-the-root, and according to the official GLTF schema, these should not have a name.
Yes, I did see that conversation on the glTF repo - opened up #228 for tracking it here.
So we might need to add an extra base-class GLTF::ChildOfRoot or something, like in the schema.
I'd be open to that as a solution. ~~Inheritance-wise it's probably easier to remove the concept of name
from GLTF::Object
and create a subclass called GLTF::RootObject
that has a name
and all root objects inherit from that.~~ (edit: I misread, I think this is pretty much what you said above). Then, create a GLTF::NameExtra
class that we can add to the extras on non-root objects with COLLADA names.