Skip to content

Commit cea7a35

Browse files
committed
USDZExporter: Fixed inputs:scale handling.
1 parent 46e71bf commit cea7a35

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/jsm/exporters/USDZExporter.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ function buildMaterial( material, textures, quickLookCompatible = false ) {
504504
uniform token info:id = "UsdUVTexture"
505505
asset inputs:file = @textures/Texture_${ id }.png@
506506
float2 inputs:st.connect = </Materials/Material_${ material.id }/Transform2d_${ mapType }.outputs:result>
507-
float4 inputs:scale = (${ color.r }, ${ color.g }, ${ color.b }, 1)
507+
${ color !== undefined ? 'float4 inputs:scale = ' + buildColor4( color ) : '' }
508508
token inputs:sourceColorSpace = "${ texture.colorSpace === THREE.NoColorSpace ? 'raw' : 'sRGB' }"
509509
token inputs:wrapS = "${ WRAPPINGS[ texture.wrapS ] }"
510510
token inputs:wrapT = "${ WRAPPINGS[ texture.wrapT ] }"
@@ -646,6 +646,12 @@ function buildColor( color ) {
646646

647647
}
648648

649+
function buildColor4( color ) {
650+
651+
return `(${ color.r }, ${ color.g }, ${ color.b }, 1.0)`;
652+
653+
}
654+
649655
function buildVector2( vector ) {
650656

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

0 commit comments

Comments
 (0)