mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
[3d] improve Preview 3d node (#1918)
This commit is contained in:
@@ -1638,6 +1638,15 @@ app.registerExtension({
|
|||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
name: 'Comfy.Preview3D',
|
name: 'Comfy.Preview3D',
|
||||||
|
|
||||||
|
async beforeRegisterNodeDef(nodeType, nodeData) {
|
||||||
|
if (
|
||||||
|
// @ts-expect-error ComfyNode
|
||||||
|
['Preview3D'].includes(nodeType.comfyClass)
|
||||||
|
) {
|
||||||
|
nodeData.input.required.image = ['PREVIEW_3D']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getCustomWidgets(app) {
|
getCustomWidgets(app) {
|
||||||
return {
|
return {
|
||||||
PREVIEW_3D(node, inputName) {
|
PREVIEW_3D(node, inputName) {
|
||||||
@@ -1734,17 +1743,25 @@ app.registerExtension({
|
|||||||
(w: IWidget) => w.name === 'up_direction'
|
(w: IWidget) => w.name === 'up_direction'
|
||||||
)
|
)
|
||||||
|
|
||||||
configureLoad3D(
|
const onExecuted = node.onExecuted
|
||||||
load3d,
|
|
||||||
'output',
|
node.onExecuted = function (message: any) {
|
||||||
modelWidget,
|
onExecuted?.apply(this, arguments)
|
||||||
showGrid,
|
|
||||||
cameraType,
|
modelWidget.value = message.model_file[0]
|
||||||
view,
|
|
||||||
material,
|
configureLoad3D(
|
||||||
bgColor,
|
load3d,
|
||||||
lightIntensity,
|
'output',
|
||||||
upDirection
|
modelWidget,
|
||||||
)
|
showGrid,
|
||||||
|
cameraType,
|
||||||
|
view,
|
||||||
|
material,
|
||||||
|
bgColor,
|
||||||
|
lightIntensity,
|
||||||
|
upDirection
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user