Skip to content

Fixed issue in the .babylon serializer #16524

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SergioRZMasson
Copy link
Contributor

@SergioRZMasson SergioRZMasson commented Apr 24, 2025

When serializing to .babylon file we are setting the _isExpanded property directly in the array object to flag if matrices indices are in compact or expanded form. However, JSON.stringify will remove those properties since it does not support properties in array objects. I'm moving those flags to the serializationObject itself to allows it to be properly exported. I'm also keeping the deserializer for it just in case someone has a file that somehow has that property in the array.

Releated to Exporters PR: BabylonJS/Exporters#1137

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 24, 2025

@@ -1204,7 +1204,7 @@ export class Geometry implements IGetSetVerticesData {

if (this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind)) {
serializationObject.matricesIndices = this._toNumberArray(this.getVerticesData(VertexBuffer.MatricesIndicesKind));
serializationObject.matricesIndices._isExpanded = true;
serializationObject.matricesIndicesExpanded = true;
Copy link
Contributor

@bghgary bghgary Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not the only property that has this problem. We should maybe fix all of them? Search for _updatable.

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

Successfully merging this pull request may close these issues.

4 participants