Skip to content

Commit

Permalink
testing out prebuilt usdjs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizzFTD committed Sep 21, 2024
1 parent c10fa07 commit 021edef
Show file tree
Hide file tree
Showing 10 changed files with 31,457 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/source/_static/usdweb/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import './emHdBindings.js';

export const usd = await globalThis["NEEDLE:USD:GET"]({
mainScriptUrlOrBlob: "/emHdBindings.js",
debug: true
});
console.log('loaded usd');

//export const stage = usd.UsdStage.CreateNew("test.usda");

// https://github.com/needle-tools/usd-viewer/blob/d69afccda742d46adc96f8696a92900aaf87b001/usd-wasm/README.md?plain=1#L42
const blob = await fetch("lab_inspiration01_mini.usdz");
console.log('fetched');
const arrayBuffer = await blob.arrayBuffer();
console.log('created buffer');

usd.FS_createDataFile("", "lab_inspiration01_mini.usdz", new Uint8Array(arrayBuffer), true, true, true);
console.log('created data file');
export const stage = usd.UsdStage.Open("lab_inspiration01_mini.usdz");

console.log("loaded stage")
Loading

0 comments on commit 021edef

Please sign in to comment.