useStudioObjectsRegistry
Examples
Section titled “Examples”import { useStudioObjectsRegistry } from '@threlte/studio/extensions'
const registry = useStudioObjectsRegistry()
// get all currently registered studio objectsconsole.log(registry.objects)
// add a studio object to the registryregistry.addObject(object)
// remove a studio object from the registryregistry.removeObject(object)
// check if an object is or is a child of a studio objectconsole.log(registry.isOrIsChildOfStudioObject(object)) // true | falseCreating a studio object reference
Section titled “Creating a studio object reference”<script lang="ts"> import { useStudioObjectsRegistry } from '@threlte/studio/extensions'
const registry = useStudioObjectsRegistry() const studioObject = registry.studioObjectRef()</script>
<T.Mesh bind:ref={studioObject.ref} />