From d9f792e5aa61d8ad66545010d3de6646c9912fb6 Mon Sep 17 00:00:00 2001 From: Davey van der Woert Date: Thu, 25 Jan 2024 20:41:35 +0000 Subject: [PATCH] trying to disable background textures? --- core/client/src/controls/image.ts | 2 +- plugins/three/src/scene.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/client/src/controls/image.ts b/core/client/src/controls/image.ts index db68eb76..30a6d644 100644 --- a/core/client/src/controls/image.ts +++ b/core/client/src/controls/image.ts @@ -11,7 +11,7 @@ export default class ImageControl extends Control { ) { // if key is not present, it must be an HTMLImageElement and we can use the 'src' key const isHTMLImageElement = !key && 'src' in reference; - super(reference || new Image(), isHTMLImageElement || !key ? 'src' : key); + super(reference, isHTMLImageElement || !key ? 'src' : key); if (!key) { this.label('Image'); diff --git a/plugins/three/src/scene.ts b/plugins/three/src/scene.ts index 86f4e384..d7beaa39 100644 --- a/plugins/three/src/scene.ts +++ b/plugins/three/src/scene.ts @@ -1,10 +1,10 @@ import { Scene, Color } from 'three'; import { - NumberControl, + // NumberControl, Layer, Folder, ColorControl, - ImageControl, + // ImageControl, } from '@magic-circle/client'; import { RecursiveSettings, recursive } from './recursive'; @@ -25,12 +25,12 @@ export function scene(scene: Scene, opts: SceneSettings = {}): Layer { // Background if (scene.background instanceof Color) { background.push(new ColorControl(scene, 'background').range(1)); - } else if (scene.background && scene.background?.source.data) { - background.push( - new ImageControl(scene.background?.source, 'data'), - new NumberControl(scene, 'backgroundIntensity').range(0, 1), - new NumberControl(scene, 'backgroundBlurriness').range(0, 1) - ); + } else if (scene.background) { + // background.push( + // new ImageControl(scene.background?.source, 'data'), + // new NumberControl(scene, 'backgroundIntensity').range(0, 1), + // new NumberControl(scene, 'backgroundBlurriness').range(0, 1) + // ); } new Folder('Background', background).addTo(rootLayer);