Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Aug 21, 2023
1 parent 6394464 commit 021b603
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion javascript/MaterialXView/source/dropHandling.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import * as fflate from 'three/examples/jsm/libs/fflate.module.js';

const debugFileHandling = true;
const debugFileHandling = false;
let loadingCallback;

export function setLoadingCallback(cb) {
Expand Down
13 changes: 5 additions & 8 deletions javascript/MaterialXView/source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,20 @@ function init()
console.error(Number.isInteger(err) ? this.getMx().getExceptionMessage(err) : err);
})

// allow dropping files and directories
document.addEventListener('drop', dropHandler, false);
document.addEventListener('dragover', dragOverHandler, false);

setLoadingCallback(file => {
console.log("Loading callback", file);
materialFilename = file.fullPath || file.name;
viewer.getEditor().clearFolders();
viewer.getMaterial().loadMaterials(viewer, materialFilename);
viewer.getEditor().updateProperties(0.9);
viewer.getScene().setUpdateTransforms();
});

// allow dropping files and directories

document.addEventListener('drop', dropHandler, false);
document.addEventListener('dragover', dragOverHandler, false);

// enable three.js Cache
// enable three.js Cache so that dropped files can reference each other
THREE.Cache.enabled = true;
window.THREE = THREE;
}

function onWindowResize()
Expand Down

0 comments on commit 021b603

Please sign in to comment.