Sfoglia il codice sorgente

serialize userData in GLTFExporter

makc 6 anni fa
parent
commit
9614c89197
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      examples/js/exporters/GLTFExporter.js

+ 6 - 0
examples/js/exporters/GLTFExporter.js

@@ -1666,6 +1666,12 @@ THREE.GLTFExporter.prototype = {
 
 			}
 
+			if ( scene.userData && Object.keys( scene.userData ).length > 0 ) {
+
+				gltfScene.extras = serializeUserData( scene );
+
+			}
+
 			outputJSON.scenes.push( gltfScene );
 
 			var nodes = [];