Collect metadata from glb file

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-10 19:52:08 -07:00
parent 0e91a69d29
commit 0c5c1c61d3
7 changed files with 125 additions and 4 deletions

View File

@@ -10,6 +10,10 @@ checkForGltf = function (e) {
const mvPreview = document.createElement('model-viewer')
mvPreview.style['width'] = '180px'
mvPreview.style['height'] = '180px'
mvPreview.addEventListener('load',(e) => {
mw.storage.session.set( 'mw_glbMeta', JSON.stringify($(e.target.originalGltfJson.asset)))
},
{once: true})
const dThumbCap = document.createElement('div')
dThumbCap.classList.add('thumbcaption')

View File

@@ -7,7 +7,7 @@ let currentSet = 'default'
* Disables hiding of various child items
* once model has loaded
*/
modelLoaded = function() {
modelLoaded = function(e) {
$('.awaiting-model').css('display', 'flex').removeClass('awaiting-model')
if (typeof enableMenu != 'undefined') {enableMenu()}
}