浏览代码

Updated USDZExporter.js : Add support for exporting vertex colors to USDZ format (#27943)

* Update USDZExporter.js

Add handling for vertex colors

* Update USDZExporter.js

Clean up.

---------

Co-authored-by: Michael Herzog <[email protected]>
Sahaj Singh 1 年之前
父节点
当前提交
10d16220d1
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      examples/jsm/exporters/USDZExporter.js

+ 15 - 0
examples/jsm/exporters/USDZExporter.js

@@ -409,6 +409,21 @@ function buildPrimvars( attributes ) {
 
 	}
 
+	// vertex colors
+
+	const colorAttribute = attributes.color;
+
+	if ( colorAttribute !== undefined ) {
+
+		const count = colorAttribute.count;
+
+		string += `
+	color3f[] primvars:displayColor = [${buildVector3Array( colorAttribute, count )}] (
+		interpolation = "vertex"
+		)`;
+
+	}
+
 	return string;
 
 }