Skip to content

Commit

Permalink
USDZExporter: Log a warning when matrixWorld has a negative scale.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jul 2, 2021
1 parent 688d1df commit a40bb1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/js/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@

const name = 'Object_' + object.id;
const transform = buildMatrix( object.matrixWorld );

if ( object.matrixWorld.determinant() < 0 ) {

console.warn( 'THREE.USDZExporter: USDZ does not support negative scales', object );

}

return `def Xform "${name}" (
prepend references = @./geometries/Geometry_${geometry.id}.usd@</Geometry>
)
Expand Down
6 changes: 6 additions & 0 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ function buildXform( object, geometry, material ) {
const name = 'Object_' + object.id;
const transform = buildMatrix( object.matrixWorld );

if ( object.matrixWorld.determinant() < 0 ) {

console.warn( 'THREE.USDZExporter: USDZ does not support negative scales', object );

}

return `def Xform "${ name }" (
prepend references = @./geometries/Geometry_${ geometry.id }.usd@</Geometry>
)
Expand Down

0 comments on commit a40bb1a

Please sign in to comment.