[3d] move default values of showPreview, showGrid, cameraType to settings panel (#3443)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Terry Jia
2025-04-13 19:44:47 -04:00
committed by GitHub
parent e45f5bdebb
commit 1a066c7062
17 changed files with 187 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ import type { IWidget } from '@comfyorg/litegraph'
import Load3d from '@/extensions/core/load3d/Load3d'
import Load3dUtils from '@/extensions/core/load3d/Load3dUtils'
import { api } from '@/scripts/api'
import { useSettingStore } from '@/stores/settingStore'
class Load3DConfiguration {
constructor(private load3d: Load3d) {}
@@ -72,15 +73,21 @@ class Load3DConfiguration {
private setupDefaultProperties() {
const cameraType = this.load3d.loadNodeProperty(
'Camera Type',
'perspective'
useSettingStore().get('Comfy.Load3D.CameraType')
)
this.load3d.toggleCamera(cameraType)
const showGrid = this.load3d.loadNodeProperty('Show Grid', true)
const showGrid = this.load3d.loadNodeProperty(
'Show Grid',
useSettingStore().get('Comfy.Load3D.ShowGrid')
)
this.load3d.toggleGrid(showGrid)
const showPreview = this.load3d.loadNodeProperty('Show Preview', true)
const showPreview = this.load3d.loadNodeProperty(
'Show Preview',
useSettingStore().get('Comfy.Load3D.ShowPreview')
)
this.load3d.togglePreview(showPreview)