rbx-dom icon indicating copy to clipboard operation
rbx-dom copied to clipboard

Write metadata to models and places

Open LPGhatguy opened this issue 6 years ago • 4 comments
trafficstars

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>.

LPGhatguy avatar Jan 10 '19 00:01 LPGhatguy

What do you mean by metadata and why is ExplicitAutoJoints the only one?

Kampfkarren avatar Jan 10 '19 01:01 Kampfkarren

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.

LPGhatguy avatar Jan 10 '19 18:01 LPGhatguy

In February, it's going to be forced anyway, no? Or will old models still preserve their metadata?

Kampfkarren avatar Jan 10 '19 18:01 Kampfkarren

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.

LPGhatguy avatar Apr 25 '19 06:04 LPGhatguy