Przeglądaj źródła

Merge pull request #14163 from takahirox/GLTFExporterGeometryUserData

GLTFExporter: export BufferGeometry.userData
Mr.doob 7 lat temu
rodzic
commit
4fab7a7d3e
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      examples/js/exporters/GLTFExporter.js

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

@@ -1182,6 +1182,8 @@ THREE.GLTFExporter.prototype = {
 
 			}
 
+			var extras = ( Object.keys( geometry.userData ).length > 0 ) ? serializeUserData( geometry ) : undefined;
+
 			var forceIndices = options.forceIndices;
 			var isMultiMaterial = Array.isArray( mesh.material );
 
@@ -1223,6 +1225,8 @@ THREE.GLTFExporter.prototype = {
 					attributes: attributes,
 				};
 
+				if ( extras ) primitive.extras = extras;
+
 				if ( targets.length > 0 ) primitive.targets = targets;
 
 				if ( geometry.index !== null ) {