|
|
|
@ -32,7 +32,7 @@ import { DynamicInputManage } from "../../../DynamicPrompt/DynamicInputManage";
|
|
|
|
|
import { PromptBlock } from "../../../DynamicPrompt/PromptBlock";
|
|
|
|
|
import { InsertTemplateByBasePoint } from "../../Template/InsertTemplateByBasePoint";
|
|
|
|
|
import { AppToaster } from "../../Toaster";
|
|
|
|
|
import { Folder, ModuleData, ModuleDetail, ModuleSource, ResourceBrands, ResourceClass, ResourceParams, ResType } from "./ResourceInterfaces";
|
|
|
|
|
import { Folder, ModuleData, ModuleSource, ResourceBrands, ResourceClass, ResourceParams, ResType } from "./ResourceInterfaces";
|
|
|
|
|
import { ResourcePanelType } from "./ResourcePanel";
|
|
|
|
|
import { getClassList, getModuleDetail, getModuleList, GetUserCollectDir, GetUserCollection } from "./ResourcesData";
|
|
|
|
|
|
|
|
|
@ -136,7 +136,7 @@ export default class ResourceStore
|
|
|
|
|
{
|
|
|
|
|
if (module_detail.type === ResType.Mtl)
|
|
|
|
|
{
|
|
|
|
|
let mtl = await this.PraseMaterial(module_detail);
|
|
|
|
|
let mtl = await this.PraseMaterial(module_detail.path);
|
|
|
|
|
for (let o of selectObj)
|
|
|
|
|
{
|
|
|
|
|
let en = GetEntity(o);
|
|
|
|
@ -322,13 +322,13 @@ export default class ResourceStore
|
|
|
|
|
}, module_detail.type === ResType.Mtl ? CommandNames.ApplyMtl : "绘制模型");
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
PraseMaterial = async (module_detail: ModuleDetail) =>
|
|
|
|
|
PraseMaterial = async (mtlPath: string) =>
|
|
|
|
|
{
|
|
|
|
|
let name = ParseUrlName(module_detail.path);
|
|
|
|
|
let name = ParseUrlName(mtlPath);
|
|
|
|
|
let mtl = app.Database.MaterialTable.GetAt(name);
|
|
|
|
|
if (!mtl)
|
|
|
|
|
{
|
|
|
|
|
let url = "/Data/MAT_INST基础材质库" + module_detail.path;
|
|
|
|
|
let url = "/Data/MAT_INST基础材质库" + mtlPath;
|
|
|
|
|
|
|
|
|
|
let dataString = await (await fetch(GenerateCdnUrl(`/Paks/paks_cooked/ue_resource/Content${encodeURI(url)}.json`))).text();
|
|
|
|
|
let data = JSON.parse(dataString);
|
|
|
|
@ -340,7 +340,7 @@ export default class ResourceStore
|
|
|
|
|
mtl.transparent = false;
|
|
|
|
|
mtl.opacity = 1;
|
|
|
|
|
mtl.bumpScale = 0.0005;
|
|
|
|
|
mtl.ref = module_detail.path;
|
|
|
|
|
mtl.ref = mtlPath;
|
|
|
|
|
|
|
|
|
|
let color = new Color;
|
|
|
|
|
let texturePath = data.baseColor_texturePath as string;
|
|
|
|
|