mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
[TS] Type component ref for 3D components (#3127)
This commit is contained in:
@@ -95,7 +95,7 @@ const backgroundImage = ref('')
|
|||||||
const upDirection = ref<UpDirection>('original')
|
const upDirection = ref<UpDirection>('original')
|
||||||
const materialMode = ref<MaterialMode>('original')
|
const materialMode = ref<MaterialMode>('original')
|
||||||
const edgeThreshold = ref(85)
|
const edgeThreshold = ref(85)
|
||||||
const load3DSceneRef = ref(null)
|
const load3DSceneRef = ref<InstanceType<typeof Load3DScene> | null>(null)
|
||||||
|
|
||||||
const showPreviewButton = computed(() => {
|
const showPreviewButton = computed(() => {
|
||||||
return !type.includes('Preview')
|
return !type.includes('Preview')
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ const showPreviewButton = computed(() => {
|
|||||||
return !type.includes('Preview')
|
return !type.includes('Preview')
|
||||||
})
|
})
|
||||||
|
|
||||||
const load3DAnimationSceneRef = ref(null)
|
const load3DAnimationSceneRef = ref<InstanceType<
|
||||||
|
typeof Load3DAnimationScene
|
||||||
|
> | null>(null)
|
||||||
|
|
||||||
const handleMouseEnter = () => {
|
const handleMouseEnter = () => {
|
||||||
const sceneRef = load3DAnimationSceneRef.value?.load3DSceneRef
|
const sceneRef = load3DAnimationSceneRef.value?.load3DSceneRef
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
|
||||||
import Load3DScene from '@/components/load3d/Load3DScene.vue'
|
import Load3DScene from '@/components/load3d/Load3DScene.vue'
|
||||||
|
import Load3dAnimation from '@/extensions/core/load3d/Load3dAnimation'
|
||||||
import {
|
import {
|
||||||
CameraType,
|
CameraType,
|
||||||
Load3DAnimationNodeType,
|
Load3DAnimationNodeType,
|
||||||
@@ -63,7 +64,7 @@ const upDirection = ref(props.upDirection)
|
|||||||
const materialMode = ref(props.materialMode)
|
const materialMode = ref(props.materialMode)
|
||||||
const showFOVButton = ref(props.showFOVButton)
|
const showFOVButton = ref(props.showFOVButton)
|
||||||
const showLightIntensityButton = ref(props.showLightIntensityButton)
|
const showLightIntensityButton = ref(props.showLightIntensityButton)
|
||||||
const load3DSceneRef = ref(null)
|
const load3DSceneRef = ref<InstanceType<typeof Load3DScene> | null>(null)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.cameraType,
|
() => props.cameraType,
|
||||||
@@ -124,21 +125,24 @@ watch(
|
|||||||
watch(
|
watch(
|
||||||
() => props.playing,
|
() => props.playing,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
load3DSceneRef.value.load3d.toggleAnimation(newValue)
|
const load3d = load3DSceneRef.value?.load3d as Load3dAnimation | null
|
||||||
|
load3d?.toggleAnimation(newValue)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.selectedSpeed,
|
() => props.selectedSpeed,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
load3DSceneRef.value.load3d.setAnimationSpeed(newValue)
|
const load3d = load3DSceneRef.value?.load3d as Load3dAnimation | null
|
||||||
|
load3d?.setAnimationSpeed(newValue)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.selectedAnimation,
|
() => props.selectedAnimation,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
load3DSceneRef.value.load3d.updateSelectedAnimation(newValue)
|
const load3d = load3DSceneRef.value?.load3d as Load3dAnimation | null
|
||||||
|
load3d?.updateSelectedAnimation(newValue)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user