Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhysicalProperties fail to deserialize in non-human-readable format #427

Open
DervexDev opened this issue Jul 22, 2024 · 0 comments
Open
Labels
module: rbx_types type: bug Something isn't working

Comments

@DervexDev
Copy link
Contributor

Currently, it's impossible to deserialize PhysicalProperties in a non-human-readable format such as MessagePack. I encounter this problem when deserializing rbx_dom_lua encoded values. As a temporary fix, I replaced:

return {
	density = roblox.Density,
	friction = roblox.Friction,
	elasticity = roblox.Elasticity,
	frictionWeight = roblox.FrictionWeight,
	elasticityWeight = roblox.ElasticityWeight,
}

with:

return {
	Custom = {
		density = roblox.Density,
		friction = roblox.Friction,
		elasticity = roblox.Elasticity,
		frictionWeight = roblox.FrictionWeight,
		elasticityWeight = roblox.ElasticityWeight,
	},
}

in rbx_dom_lua/src/EncodedValue.lua and it works just fine. However, the problem, is that it breaks deserialization of human-readable formats like JSON.

To fix this issue we should modify TaggedPhysicalProperties in rbx_types/src/physical_properties.rs. Unfortunately, I don't have time to investigate so I'm just leaving this as a tracking issue.

@Dekkonot Dekkonot added type: bug Something isn't working module: rbx_types labels Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: rbx_types type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants