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

export_lua should figure out what fields are non-default #26

Open
mkhan45 opened this issue Aug 14, 2020 · 3 comments
Open

export_lua should figure out what fields are non-default #26

mkhan45 opened this issue Aug 14, 2020 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@mkhan45
Copy link
Owner

mkhan45 commented Aug 14, 2020

Right now all fields are serialized even if they aren't default, making each shape span multiple lines. Realistically the defaults won't change, so it should be safe to only serialize fields that are not default.

@mkhan45 mkhan45 added enhancement New feature or request good first issue Good for newcomers labels Aug 14, 2020
@mkhan45 mkhan45 modified the milestones: 1.1.0, 1.3.0 Aug 14, 2020
@mkhan45
Copy link
Owner Author

mkhan45 commented Dec 10, 2020

pub fn export_lua(&self, filename: impl AsRef<std::path::Path> + std::clone::Clone) {

Should be as simple as making a global const Rust variable for each default field and manually comparing them

@shyamjayakannan
Copy link

@mkhan45 could you provide more context as to what you mean by default fields?

@mkhan45
Copy link
Owner Author

mkhan45 commented Apr 9, 2024

Hey @shyamjayakannan, thanks for the interest, but this repo is essentially deprecated at this point so I'm not looking for contributions.

In case you were just curious, the idea was that bodies have default parameters, e.g. a mass of 10. In that case, you could write a scene without specifying mass but the serialized version of that scene would specify the mass to 10, which can make the serialized file much longer in some cases.

It's kind of an unnecessary change in hindsight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants