mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-03 04:00:31 +00:00
[3d] better solution to support reading extra resource/texture (#4209)
This commit is contained in:
@@ -128,6 +128,9 @@ class Load3DConfiguration {
|
||||
if (!value) return
|
||||
|
||||
const filename = value as string
|
||||
|
||||
this.setResourceFolder(filename)
|
||||
|
||||
const modelUrl = api.apiURL(
|
||||
Load3dUtils.getResourceURL(
|
||||
...Load3dUtils.splitFilePath(filename),
|
||||
@@ -173,6 +176,21 @@ class Load3DConfiguration {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private setResourceFolder(filename: string): void {
|
||||
const pathParts = filename.split('/').filter((part) => part.trim())
|
||||
|
||||
if (pathParts.length <= 2) {
|
||||
return
|
||||
}
|
||||
|
||||
const subfolderParts = pathParts.slice(1, -1)
|
||||
const subfolder = subfolderParts.join('/')
|
||||
|
||||
if (subfolder) {
|
||||
this.load3d.node.properties['Resource Folder'] = subfolder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default Load3DConfiguration
|
||||
|
||||
Reference in New Issue
Block a user