瀏覽代碼

Points: export normals and colors (#25235)

WestLangley 2 年之前
父節點
當前提交
35ea2e5dee
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      examples/jsm/exporters/PLYExporter.js

+ 7 - 0
examples/jsm/exporters/PLYExporter.js

@@ -97,8 +97,15 @@ class PLYExporter {
 				const geometry = mesh.geometry;
 
 				const vertices = geometry.getAttribute( 'position' );
+				const normals = geometry.getAttribute( 'normal' );
+				const colors = geometry.getAttribute( 'color' );
+
 				vertexCount += vertices.count;
 
+				if ( normals !== undefined ) includeNormals = true;
+
+				if ( colors !== undefined ) includeColors = true;
+
 				includeIndices = false;
 
 			}