Skip to content

Core: Increase version of Object/Scene format. #31096

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

Merged
merged 2 commits into from
May 16, 2025

Conversation

repalash
Copy link
Contributor

Fixes: #31095

Description

Updated the version to 4.7 in Material.toJSON, can do the same for other classes - Object3D, BufferGeometry etc if you want to keep it consistent.

The handling of bumpScale was changed in #26899, which is saved in Material.toJSON.

To distinguish between old and new files metadata.version is checked while loading, so that either a warning can be shown to the user or some heuristic can be used to automatically adjust the value.

This contribution is funded by ThreePipe

Copy link

github-actions bot commented May 13, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 337.26
78.64
337.26
78.64
+0 B
+0 B
WebGPU 550.09
152.49
550.09
152.49
+0 B
+0 B
WebGPU Nodes 549.45
152.33
549.45
152.33
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 468.12
113.14
468.12
113.14
+0 B
+0 B
WebGPU 625.46
169.27
625.46
169.27
+0 B
+0 B
WebGPU Nodes 580.32
158.58
580.32
158.58
+0 B
+0 B

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2025

Updated the version to 4.7 in Material.toJSON, can do the same for other classes - Object3D, BufferGeometry etc if you want to keep it consistent.

Yeah, lets keep it consistent 🙏

@mrdoob mrdoob added this to the r177 milestone May 14, 2025
@repalash
Copy link
Contributor Author

Done for all the places the json version was 4.6

@Mugen87 Mugen87 changed the title Increment version in Material.toJSON Core: Increase version of Object/Scene format. May 16, 2025
@Mugen87 Mugen87 merged commit 64b50b0 into mrdoob:dev May 16, 2025
12 checks passed
@Mugen87
Copy link
Collaborator

Mugen87 commented May 16, 2025

FYI: I've noted the version bump in the migration guide, just to be on the safe side^^:

https://github.com/mrdoob/three.js/wiki/Migration-Guide#176--177

RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* Increment version in Material.toJSON

* Increment json metadata version in core
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
* Increment version in Material.toJSON

* Increment json metadata version in core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increment metadata.version in Material.toJSON
3 participants