更新打包配置,完善组件入参模式,新增事件总线

This commit is contained in:
2025-05-08 11:34:35 +08:00
parent cfbfda520d
commit 4a648c2f97
14 changed files with 1091 additions and 26609 deletions

View File

@@ -5,6 +5,7 @@ import { Viewer } from './Viewer';
import { PMREMGenerator3 } from './PMREMGenerator2';
import type { PhysicalMaterialRecord, TextureTableRecord } from 'webcad_ue4_api';
import { MaterialEditorCameraControl } from './MaterialMouseControl';
import { GetConfig } from '../lib/libOutputConfig';
async function textureRenderUpdate(textureRecord:TextureTableRecord){
const texture = textureRecord['texture'] as Texture;
@@ -81,11 +82,6 @@ export class MaterialEditor extends Singleton
this.Viewer.UpdateRender();
this.Viewer.Fov = 90;
}
else
{
this.Canvas.appendChild(document);
}
}
SetViewer(canvas: HTMLElement)
{
@@ -119,8 +115,8 @@ export class MaterialEditor extends Singleton
return new Promise(async (res, rej) =>
{
let urls = ['right.webp', 'left.webp', 'top.webp', 'bottom.webp', 'front.webp', 'back.webp'];
new CubeTextureLoader().setPath('./')
let urls = [...GetConfig().envTextureSrc];
new CubeTextureLoader()
.load(urls, (t) =>
{
t.encoding = sRGBEncoding;
@@ -148,8 +144,8 @@ export class MaterialEditor extends Singleton
this.exrPromise = new Promise<Texture>((res, rej) =>
{
let urls = ['right-gray.webp', 'left-gray.webp', 'top-gray.webp', 'bottom-gray.webp', 'front-gray.webp', 'back-gray.webp'];
new CubeTextureLoader().setPath('./')
let urls = [...GetConfig().grayEnvTextureSrc];
new CubeTextureLoader()
.load(urls, (t) =>
{
t.encoding = sRGBEncoding;