Skip to content

Commit

Permalink
fix: three.js module initialisation from preset load (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
2xAA committed May 4, 2024
1 parent cb955ae commit f39311d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/application/worker/store/modules/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f39311d

Please sign in to comment.