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

Temporary workaround for MeshPart.MeshId writes #390

Closed
wants to merge 2 commits into from

Conversation

MaximumADHD
Copy link
Contributor

Not an ideal solution, but it works and takes a similar hacky measure to patching the Source of a Script via the ScriptEditorService. This can be killed off from rojo once the game:GetObjects hack is implemented.

@kennethloeffler
Copy link
Member

kennethloeffler commented Feb 20, 2024

Hi Max,

So this PR may seem like it works, but there is some hidden complexity around MeshPart.CollisionFidelity that it does not address.

MeshPart.CollisionFidelity is not serialized to file. Collision fidelity information is instead stored in a property called MeshPart.PhysicalConfigData, which is not reflected to Lua. This property contains a blob describing the collision geometry of the mesh. I think it's likely that you already know something about it, but there's some more information in this devforum post if you're interested: https://devforum.roblox.com/t/some-info-on-sharedstrings-for-custom-collision-data-meshparts-unions-etc/294588. This format is unstable, and will incur yet more maintenance burden, so rbx-dom will probably not accept PRs to parse it.

This being said, the implementation here will leave collision fidelity properties at the default if they're not specified in the project file, and may fail to reproduce the correct collision fidelity depending on the order in which Rojo's reconciler sets the mesh's properties. Quenty also added this functionality to his own fork of Rojo a little while ago, and used the same APIs. But his version seems like it also requires the user to specify MeshPart.CollisionFidelity in their project and also add tags to the meshes: Quenty/rojo@e29b35d. If you require MeshPart serving from Rojo right now, you may be able to use Quenty's fork, but failing that, you'll have to wait for rojo-rbx/rojo#786 in Rojo 7.5. Sorry! 🙁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants