Sfoglia il codice sorgente

USDExporter: Clean up

Mr.doob 4 anni fa
parent
commit
73eedf069b
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      examples/jsm/exporters/USDZExporter.js

+ 8 - 2
examples/jsm/exporters/USDZExporter.js

@@ -338,8 +338,8 @@ function buildMaterial( material ) {
         {
         {
             uniform token info:id = "UsdTransform2d"
             uniform token info:id = "UsdTransform2d"
             float2 inputs:in.connect = </Materials/Material_${ material.id }/uvReader_st.outputs:result>
             float2 inputs:in.connect = </Materials/Material_${ material.id }/uvReader_st.outputs:result>
-            float2 inputs:scale = (${ texture.repeat.x },${ texture.repeat.y })
-            float2 inputs:translation = (${ texture.offset.x },${ texture.offset.y })
+            float2 inputs:scale = ${ buildVector2( texture.repeat ) }
+            float2 inputs:translation = ${ buildVector2( texture.offset ) }
             float2 outputs:result
             float2 outputs:result
         }
         }
 
 
@@ -456,4 +456,10 @@ function buildColor( color ) {
 
 
 }
 }
 
 
+function buildVector2( vector ) {
+
+	return `(${ vector.x }, ${ vector.y })`;
+
+}
+
 export { USDZExporter };
 export { USDZExporter };