|
@@ -1,6 +1,7 @@
|
|
|
-import { useInstanceCreator } from '/@/core'
|
|
|
import { App, ref, Component, Ref, provide } from 'vue'
|
|
|
import * as THREE from 'three'
|
|
|
+import { useInstanceCreator } from '/@/core'
|
|
|
+import { useLogger } from '/@/composables'
|
|
|
import { TresCatalogue } from '/@/types'
|
|
|
|
|
|
const catalogue: Ref<TresCatalogue> = ref({ ...THREE })
|
|
@@ -9,6 +10,7 @@ delete catalogue.value.Scene
|
|
|
|
|
|
let localApp: App
|
|
|
export function useCatalogue(app?: App, prefix = 'Tres') {
|
|
|
+ const { logError } = useLogger()
|
|
|
if (!localApp && app) {
|
|
|
localApp = app
|
|
|
}
|
|
@@ -17,6 +19,11 @@ export function useCatalogue(app?: App, prefix = 'Tres') {
|
|
|
provide('catalogue', catalogue)
|
|
|
|
|
|
const extend = (objects: any) => {
|
|
|
+ if (!objects) {
|
|
|
+ logError('No objects provided to extend catalogue')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
catalogue.value = Object.assign(catalogue.value, objects)
|
|
|
const components = createComponentInstances(ref(objects))
|
|
|
|