Repository: mrdoob/three.js (JavaScript)

Issue:
Increment metadata.version in Material.toJSON
### Description

Hi, the handling of `bumpScale` was changed in [#26899](https://github.com/mrdoob/three.js/pull/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. 

### Solution

I can create a PR incrementing the version to 4.7, either just for the material or all assets.
Also if feasible we can add the the three.js revision/version as well(in json metadata and gltf exporter asset), so it wont be required to increment after every change.

### Alternatives

-

### Additional context

Similar - #25989


Discussion: Bumping the material version sounds fine. The line to updated should be:

https://github.com/mrdoob/three.js/blob/b77e864e73bb3190b293fa50c6b3dfdd01684a3c/src/materials/Material.js#L618



Fix (patch):
diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js
index 13915ebedde11f..8cf0cba4460a4c 100644
--- a/src/core/BufferGeometry.js
+++ b/src/core/BufferGeometry.js
@@ -1201,7 +1201,7 @@ class BufferGeometry extends EventDispatcher {
 
 		const data = {
 			metadata: {
-				version: 4.6,
+				version: 4.7,
 				type: 'BufferGeometry',
 				generator: 'BufferGeometry.toJSON'
 			}
diff --git a/src/core/Object3D.js b/src/core/Object3D.js
index 39a337bde0a7aa..74089879c44367 100644
--- a/src/core/Object3D.js
+++ b/src/core/Object3D.js
@@ -1246,7 +1246,7 @@ class Object3D extends EventDispatcher {
 			};
 
 			output.metadata = {
-				version: 4.6,
+				version: 4.7,
 				type: 'Object',
 				generator: 'Object3D.toJSON'
 			};
diff --git a/src/extras/core/Curve.js b/src/extras/core/Curve.js
index 88491b81ffaed2..fc239ed36687b3 100644
--- a/src/extras/core/Curve.js
+++ b/src/extras/core/Curve.js
@@ -483,7 +483,7 @@ class Curve {
 
 		const data = {
 			metadata: {
-				version: 4.6,
+				version: 4.7,
 				type: 'Curve',
 				generator: 'Curve.toJSON'
 			}
diff --git a/src/materials/Material.js b/src/materials/Material.js
index 8c2ed346f703e2..1bd28e95732b2b 100644
--- a/src/materials/Material.js
+++ b/src/materials/Material.js
@@ -615,7 +615,7 @@ class Material extends EventDispatcher {
 
 		const data = {
 			metadata: {
-				version: 4.6,
+				version: 4.7,
 				type: 'Material',
 				generator: 'Material.toJSON'
 			}
diff --git a/src/nodes/core/Node.js b/src/nodes/core/Node.js
index 6a0dcfd86a8854..4eeca0add3037c 100644
--- a/src/nodes/core/Node.js
+++ b/src/nodes/core/Node.js
@@ -858,7 +858,7 @@ class Node extends EventDispatcher {
 				type,
 				meta,
 				metadata: {
-					version: 4.6,
+					version: 4.7,
 					type: 'Node',
 					generator: 'Node.toJSON'
 				}
diff --git a/src/objects/Skeleton.js b/src/objects/Skeleton.js
index 64dd274d11ace8..526316a5d1c3b1 100644
--- a/src/objects/Skeleton.js
+++ b/src/objects/Skeleton.js
@@ -350,7 +350,7 @@ class Skeleton {
 
 		const data = {
 			metadata: {
-				version: 4.6,
+				version: 4.7,
 				type: 'Skeleton',
 				generator: 'Skeleton.toJSON'
 			},
diff --git a/src/textures/Texture.js b/src/textures/Texture.js
index 496971e6ee2db9..072bdd1f24102a 100644
--- a/src/textures/Texture.js
+++ b/src/textures/Texture.js
@@ -529,7 +529,7 @@ class Texture extends EventDispatcher {
 		const output = {
 
 			metadata: {
-				version: 4.6,
+				version: 4.7,
 				type: 'Texture',
 				generator: 'Texture.toJSON'
 			},