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

Writing a model file always generates a unique file, leading to diff noise #61

Closed
filiptibell opened this issue Jul 3, 2023 · 1 comment
Labels
bug Something isn't working roblox Issues pertaining to the built-in Roblox library

Comments

@filiptibell
Copy link
Collaborator

local roblox = require("@lune/roblox")

local gameFile = fs.readFile("place.rbxl")
local game = roblox.deserializePlace(gameFile)

local model = game.Workspace.Model
local modelFile = roblox.serializeModel({ model })

fs.writeFile("model.rbxm", modelFile)

As of Lune version 0.7.2 this will always generate a completely unique model.rbxm file, which can be problematic when many models are extracted from a place using an automated process, and then stored in version control.

The root of the issue is that writing a model file will clone the instance within the same dom before transfer out into the dom that will then be written to the model file. This leads to unique id collisions, and new ids being generated (source). Relevant methods in our roblox library - from_instance_array, clone_into_external_dom

This could be solved by rbx-dom (#282, #284), but we could also solve the first linked issue here ourselves in Lune by stripping unique ids in from_instance_array.

@filiptibell filiptibell added bug Something isn't working roblox Issues pertaining to the built-in Roblox library labels Jul 3, 2023
@filiptibell
Copy link
Collaborator Author

I bit the bullet and implemented removal of unique ids in model serialization, so this is fixed in 0.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working roblox Issues pertaining to the built-in Roblox library
Projects
None yet
Development

No branches or pull requests

1 participant