2
0
Эх сурвалжийг харах

GLTFExporter: export BufferGeometry.userData

Takahiro 7 жил өмнө
parent
commit
12a7d80669

+ 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 ) {