From 590da42c3546b2dd6020e9a23310b7c5bf0005d0 Mon Sep 17 00:00:00 2001 From: Sam Wray Date: Sun, 17 Mar 2024 22:04:35 +0000 Subject: [PATCH] fix: three.js module initialisation from preset load (#905) --- src/application/worker/store/modules/modules.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/application/worker/store/modules/modules.js b/src/application/worker/store/modules/modules.js index 34b3afba..143627d5 100644 --- a/src/application/worker/store/modules/modules.js +++ b/src/application/worker/store/modules/modules.js @@ -366,6 +366,22 @@ const actions = { } } } else { + const { renderers } = rootState; + const { type } = module.meta; + + if (renderers[type].setupModule) { + try { + const newDef = await renderers[type].setupModule(moduleDefinition); + module.data = newDef.data; + } catch (e) { + console.error( + `Error in ${type} renderer setup whilst registering "${name}". This module was ommited from registration. \n\n${e}` + ); + + return false; + } + } + await initialiseModuleProperties( props, module,