Parcourir la source

GLTFExporter: force node names to be strings.

If an object name is a number it is currently copied to the gltfNode as a number. This results in gltf validator errors:

 "code": "TYPE_MISMATCH",
                "message": "Type mismatch. Property value 26 is not a 'string'.",
                "severity": 0,
                "pointer": "/nodes/1/name"

This change ensures gltfNode.name is a string in all cases.
Christopher Cook il y a 7 ans
Parent
commit
e22f146ef0
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      examples/js/exporters/GLTFExporter.js

+ 1 - 1
examples/js/exporters/GLTFExporter.js

@@ -1070,7 +1070,7 @@ THREE.GLTFExporter.prototype = {
 
 			if ( object.name ) {
 
-				gltfNode.name = object.name;
+				gltfNode.name = String(object.name);
 
 			}