scene switcher feature

This commit is contained in:
2025-12-06 09:30:50 +02:00
parent 7397c6dfe7
commit 82c3a0dec8
8 changed files with 228 additions and 67 deletions
@@ -0,0 +1,53 @@
<template>
<div>
<v-select label="Switch to scene" v-model="modelValue.switchScene" density="compact"
:items="scenes"></v-select>
<v-select label="Switch type" v-model="modelValue.switchType" density="compact"
:items="switchTypes"></v-select>
<!-- <div class="text-caption text-center">{{ modelValue.title }}</div> -->
</div>
</template>
<script>
import { computed } from 'vue';
import OffsetLine from '../SceneDesigner/OffsetLine.vue';
export default {
components:{ OffsetLine },
data(){
return {
active: false,
switchTypes: [
{ title: 'Award', value: 'award' },
{ title: 'Sphere', value: 'sphere' },
{ title: 'Sensor', value: 'sensor' }
]
}
},
mounted(){
this.active = true;
},
props:{
modelValue: Object
},
computed:{
scenes(){
return this.modelValue.__root.scenes.map(s=>({title: s.data.title, value: s.data.id}))
},
},
methods:{
},
__transform(data){
data.go_env = computed(()=>{
if (data.switchType == 'sphere' && data.switchScene){
return data.__root.scenes.find(s=>s.data.id == data.switchScene).data.environment;
}
})
}
}
</script>