[3d] move change background color button (#2365)

This commit is contained in:
Terry Jia
2025-01-27 20:06:01 -05:00
committed by GitHub
parent 99009a18f7
commit 55d63a8aef
4 changed files with 112 additions and 52 deletions

View File

@@ -11,7 +11,6 @@ class Load3DConfiguration {
loadFolder: 'input' | 'output',
modelWidget: IWidget,
material: IWidget,
bgColor: IWidget,
lightIntensity: IWidget,
upDirection: IWidget,
fov: IWidget,
@@ -25,7 +24,6 @@ class Load3DConfiguration {
postModelUpdateFunc
)
this.setupMaterial(material)
this.setupBackground(bgColor)
this.setupLighting(lightIntensity)
this.setupDirection(upDirection)
this.setupCamera(fov)
@@ -58,13 +56,6 @@ class Load3DConfiguration {
)
}
private setupBackground(bgColor: IWidget) {
bgColor.callback = (value: string) => {
this.load3d.setBackgroundColor(value)
}
this.load3d.setBackgroundColor(bgColor.value as string)
}
private setupLighting(lightIntensity: IWidget) {
lightIntensity.callback = (value: number) => {
this.load3d.setLightIntensity(value)
@@ -99,6 +90,10 @@ class Load3DConfiguration {
const showGrid = this.load3d.loadNodeProperty('Show Grid', true)
this.load3d.toggleGrid(showGrid)
const bgColor = this.load3d.loadNodeProperty('Background Color', '#282828')
this.load3d.setBackgroundColor(bgColor)
}
private createModelUpdateHandler(