rbx-dom
rbx-dom copied to clipboard
Write metadata to models and places
The only piece of metadata in the engine is ExplicitAutoJoints right now. For the best compatibility and least-surprising behavior, we should always write that value to true in the metadata section of all formats.
Since there might be more metadata added to the engine related to content versioning, rbx_dom_weak and related packages should probably gear up for handling more metadata. This can happen either as a property of a tree or as a parameter to serialization.
One way to approach this would be to introduce a new member to WeakDom named metadata, perhaps of type HashMap<String, String>.
What do you mean by metadata and why is ExplicitAutoJoints the only one?
It's a section that's literally called META in the binary format. ExplicitAutoJoints is the only one because it's the only case where extra metadata attached to a piece of content has been necessary to preserve compatibility!
If ExplicitAutoJoints is unset or set to false, then the engine will automatically join touching surfaces with compatible types, which might not be what you want.
If ExplicitAutoJoints is set to true, the engine won't do this anymore. All the content that Roblox exports has this value set now, so for the best compatibility, we should set it in every case, or at least expose the option to set it.
In February, it's going to be forced anyway, no? Or will old models still preserve their metadata?
I've thought about this more. This could probably be a member of RbxTree, since we'll also need to do interesting things like keep a SharedString index anyways.