Skip to content

Commit

Permalink
Add build-examples script (#21584)
Browse files Browse the repository at this point in the history
* Ignore ifc folder when linting

* Add build-examples script

* Normalize fflate imports

* Wrap the output in an IIFE to avoid polluting the global scope

* Add missing dep

* Remove eslint comment not necessary anymore
  • Loading branch information
marcofugaro committed Apr 6, 2021
1 parent 9bf1555 commit 157fd1c
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 6,360 deletions.
6 changes: 3 additions & 3 deletions examples/jsm/exporters/USDZExporter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { zipSync, strToU8 } from '../libs/fflate.module.min.js';
import * as fflate from '../libs/fflate.module.min.js';

class USDZExporter {

Expand Down Expand Up @@ -34,7 +34,7 @@ class USDZExporter {
output += buildMaterials( materials );
output += buildTextures( textures );

const files = { 'model.usda': strToU8( output ) };
const files = { 'model.usda': fflate.strToU8( output ) };

for ( const uuid in textures ) {

Expand Down Expand Up @@ -70,7 +70,7 @@ class USDZExporter {

}

return zipSync( files, { level: 0 } );
return fflate.zipSync( files, { level: 0 } );

}

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/loaders/LottieLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class LottieLoader extends Loader {
container.style.height = data.h + 'px';
document.body.appendChild( container );

// eslint-disable-next-line no-undef
const animation = bodymovin.loadAnimation( {
container: container,
animType: 'canvas',
Expand Down
6 changes: 3 additions & 3 deletions examples/jsm/loaders/TiltLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Quaternion,
Vector3
} from '../../../build/three.module.js';
import { unzipSync, strFromU8 } from '../libs/fflate.module.min.js';
import * as fflate from '../libs/fflate.module.min.js';

class TiltLoader extends Loader {

Expand Down Expand Up @@ -56,7 +56,7 @@ class TiltLoader extends Loader {
const group = new Group();
// https://docs.google.com/document/d/11ZsHozYn9FnWG7y3s3WAyKIACfbfwb4PbaS8cZ_xjvo/edit#

const zip = unzipSync( new Uint8Array( buffer.slice( 16 ) ) );
const zip = fflate.unzipSync( new Uint8Array( buffer.slice( 16 ) ) );

/*
const thumbnail = zip[ 'thumbnail.png' ].buffer;
Expand All @@ -65,7 +65,7 @@ class TiltLoader extends Loader {
document.body.appendChild( img );
*/

const metadata = JSON.parse( strFromU8( zip[ 'metadata.json' ] ) );
const metadata = JSON.parse( fflate.strFromU8( zip[ 'metadata.json' ] ) );

/*
const blob = new Blob( [ zip[ 'data.sketch' ].buffer ], { type: 'application/octet-stream' } );
Expand Down
Loading

0 comments on commit 157fd1c

Please sign in to comment.