Skip to content

Commit

Permalink
fix: allow same asset to be loaded again
Browse files Browse the repository at this point in the history
- add file as currentRootfile when dropped
- clear stage when dropping a new asset
  • Loading branch information
beersandrew committed Jul 8, 2024
1 parent d69afcc commit d0fb696
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ async function loadFile(fileOrHandle, isRootFile = true, fullPath = undefined) {
reader.onerror = reject;
});
reader.onload = function(event) {
clearStage();
let fileName = file.name;
let directory = "/";
if (fullPath !== undefined) {
Expand All @@ -489,6 +490,7 @@ async function loadFile(fileOrHandle, isRootFile = true, fullPath = undefined) {
}
Usd.FS_createPath("", directory, true, true);
Usd.FS_createDataFile(directory, fileName, new Uint8Array(event.target.result), true, true, true);
currentRootFileName = fileName;
loadUsdFile(directory, fileName, fullPath, isRootFile);
};
reader.readAsArrayBuffer(file);
Expand Down

0 comments on commit d0fb696

Please sign in to comment.