Skip to content

Commit a40bb1a

Browse files
committed
USDZExporter: Log a warning when matrixWorld has a negative scale.
1 parent 688d1df commit a40bb1a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

examples/js/exporters/USDZExporter.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@
141141

142142
const name = 'Object_' + object.id;
143143
const transform = buildMatrix( object.matrixWorld );
144+
145+
if ( object.matrixWorld.determinant() < 0 ) {
146+
147+
console.warn( 'THREE.USDZExporter: USDZ does not support negative scales', object );
148+
149+
}
150+
144151
return `def Xform "${name}" (
145152
prepend references = @./geometries/Geometry_${geometry.id}.usd@</Geometry>
146153
)

examples/jsm/exporters/USDZExporter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ function buildXform( object, geometry, material ) {
155155
const name = 'Object_' + object.id;
156156
const transform = buildMatrix( object.matrixWorld );
157157

158+
if ( object.matrixWorld.determinant() < 0 ) {
159+
160+
console.warn( 'THREE.USDZExporter: USDZ does not support negative scales', object );
161+
162+
}
163+
158164
return `def Xform "${ name }" (
159165
prepend references = @./geometries/Geometry_${ geometry.id }.usd@</Geometry>
160166
)

0 commit comments

Comments
 (0)