Sfoglia il codice sorgente

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 anno fa
parent
commit
10d16220d1
1 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  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;
 
 }