9427686d42
* fix(fe2): unfollow on camera move * WIP new state hydration function * WIP sync state * minor cleanup * fix coloring not being tracked * fix for post thread close camera pos restore * supporting duplicate users * preventing guest commenting + state reset fixes * fixed guests not receiving viewer comment updates * post-thread creation opens new thread * removing gap between 'X is typing' and bubble appearing * reset filters will also reset colors now * fixed thread full context * camera reset fix * thread reset fix * fixed router concurrency issues * followed user avatar fix * TONS OF DEBUGGING FOR ROUTER QUEUING * removing queued routing debugging stuff + disabling spotlight cancelation * WIP async URL updates * missing authLogger fixed * fix for broken projection * fix for bubbles positions not updating correctly * queued routing cleanup * fixed spotlight mode disabling unnecessarily * added back stoplight stop on ctrl * undid spotlight debugging
65 lines
2.0 KiB
Vue
65 lines
2.0 KiB
Vue
<template>
|
|
<div>
|
|
<div v-show="!hasAddedOverlay">
|
|
<p class="text-sm">
|
|
Speckle allows you to load multiple models in the same viewer.
|
|
<span v-show="!hasAddedOverlay">
|
|
<FormButton
|
|
size="sm"
|
|
link
|
|
:icon-right="hasAddedOverlay ? CheckIcon : null"
|
|
:disabled="hasAddedOverlay"
|
|
@click="addOverlay()"
|
|
>
|
|
Click here
|
|
</FormButton>
|
|
to give it a try!
|
|
</span>
|
|
</p>
|
|
</div>
|
|
<div v-show="hasAddedOverlay">
|
|
<p class="text-sm">
|
|
Nice - you've just created a "federated" model. Ready for what's next?
|
|
<!-- <br />
|
|
<br />
|
|
Let's go to the next step. -->
|
|
</p>
|
|
<!-- <p class="text-sm">You can overlay as many models as you want.</p> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { CheckIcon } from '@heroicons/vue/24/solid'
|
|
import { SpeckleViewer } from '@speckle/shared'
|
|
import { useQuery } from '@vue/apollo-composable'
|
|
import { latestModelsQuery } from '~~/lib/projects/graphql/queries'
|
|
import {
|
|
useInjectedViewerRequestedResources,
|
|
useInjectedViewerLoadedResources
|
|
} from '~~/lib/viewer/composables/setup'
|
|
|
|
const { items } = useInjectedViewerRequestedResources()
|
|
const { project, modelsAndVersionIds } = useInjectedViewerLoadedResources()
|
|
const id = project.value?.id as string
|
|
|
|
const { result: models } = useQuery(latestModelsQuery, () => ({ projectId: id }))
|
|
|
|
const hasAddedOverlay = ref(false)
|
|
async function addOverlay() {
|
|
const allmodels = models.value?.project?.models.items
|
|
const currentModelId = modelsAndVersionIds.value[0].model.id
|
|
const otherModelId = allmodels?.find((m) => m.id !== currentModelId)?.id as string
|
|
await items.update([
|
|
...items.value,
|
|
...SpeckleViewer.ViewerRoute.resourceBuilder().addModel(otherModelId).toResources()
|
|
])
|
|
|
|
hasAddedOverlay.value = true
|
|
}
|
|
|
|
onBeforeUnmount(() => {
|
|
if (hasAddedOverlay.value) return
|
|
addOverlay()
|
|
})
|
|
</script>
|