Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsm/Addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export * as SceneUtils from './utils/SceneUtils.js';
export * from './utils/ShadowMapViewer.js';
export * as SkeletonUtils from './utils/SkeletonUtils.js';
export * as SortUtils from './utils/SortUtils.js';
export * from './utils/TextureUtils.js';
export * from './utils/WebGLTextureUtils.js';
export * from './utils/UVsDebug.js';
export * from './utils/WorkerPool.js';

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
Quaternion,
REVISION
} from 'three';
import { decompress } from './../utils/TextureUtils.js';
import { decompress } from './../utils/WebGLTextureUtils.js';


/**
Expand Down
24 changes: 21 additions & 3 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,20 @@ import {
zipSync,
} from '../libs/fflate.module.js';

import { decompress } from './../utils/TextureUtils.js';

class USDZExporter {

constructor() {

this.textureUtils = null;

}

setTextureUtils( utils ) {

this.textureUtils = utils;

}

parse( scene, onDone, onError, options ) {

this.parseAsync( scene, options ).then( onDone ).catch( onError );
Expand Down Expand Up @@ -98,7 +108,15 @@ class USDZExporter {

if ( texture.isCompressedTexture === true ) {

texture = decompress( texture );
if ( this.textureUtils === null ) {

throw new Error( 'THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.' );

} else {

texture = await this.textureUtils.decompress( texture );

}

}

Expand Down