Skip to content

Commit

Permalink
USDZExporter: Fixed inputs:scale handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed May 10, 2023
1 parent 46e71bf commit cea7a35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ function buildMaterial( material, textures, quickLookCompatible = false ) {
uniform token info:id = "UsdUVTexture"
asset inputs:file = @textures/Texture_${ id }.png@
float2 inputs:st.connect = </Materials/Material_${ material.id }/Transform2d_${ mapType }.outputs:result>
float4 inputs:scale = (${ color.r }, ${ color.g }, ${ color.b }, 1)
${ color !== undefined ? 'float4 inputs:scale = ' + buildColor4( color ) : '' }
token inputs:sourceColorSpace = "${ texture.colorSpace === THREE.NoColorSpace ? 'raw' : 'sRGB' }"
token inputs:wrapS = "${ WRAPPINGS[ texture.wrapS ] }"
token inputs:wrapT = "${ WRAPPINGS[ texture.wrapT ] }"
Expand Down Expand Up @@ -646,6 +646,12 @@ function buildColor( color ) {

}

function buildColor4( color ) {

return `(${ color.r }, ${ color.g }, ${ color.b }, 1.0)`;

}

function buildVector2( vector ) {

return `(${ vector.x }, ${ vector.y })`;
Expand Down

0 comments on commit cea7a35

Please sign in to comment.