material-editor/src/lib/libOutputConfig.ts

46 lines
1.6 KiB
TypeScript
Raw Normal View History

import type { DeepReadonly } from "vue"
import type { MaterialRequest } from "../components/MaterialAdjuster.vue"
let _libOutputConfig = {
2025-05-29 15:53:01 +08:00
host:'https://tapi.cfcad.cn:7779',
2025-05-30 10:44:53 +08:00
textureSrc: [],
2025-05-09 19:29:09 +08:00
file: undefined,
submitCallback: undefined,
cancelCallback: undefined,
envTextureSrc: ['./right.webp', './left.webp', './top.webp', './bottom.webp', './front.webp', './back.webp'],
grayEnvTextureSrc: ['./right-gray.webp', './left-gray.webp', './top-gray.webp', './bottom-gray.webp', './front-gray.webp', './back-gray.webp'],
} as LibOutputConfig
export function ConfigureLibOutput(config: Partial<LibOutputConfig>) {
Object.assign(_libOutputConfig, {
...config
});
// _libOutputConfig = config;
}
export type LibOutputConfig = {
2025-05-29 15:53:01 +08:00
/**
*
*/
host: string,
2025-05-30 10:44:53 +08:00
/** 材质贴图链接列表,场景会只会载入第一个链接作为纹理预览,但是导出提交时会为所有链接创建材质 */
textureSrc: Array<string>,
2025-05-09 19:29:09 +08:00
/** 材质预设数据base64编码 */
file?: string,
/** 环境贴图链接(立方体贴图,按照顺序输入[右左上下前后] */
envTextureSrc: string[],
/** 灰度环境贴图链接,输入格式与环境贴图一致 */
grayEnvTextureSrc: string[],
/** 提交材质时的回调 */
2025-05-30 10:44:53 +08:00
submitCallback?: (data: Array<MaterialRequest>) => void,
/**
*
* @deprecated 使
*/
cancelCallback?: () => void
}
export function GetConfig(): DeepReadonly<typeof _libOutputConfig>
{
return _libOutputConfig;
}