Mesh Export: AutoSave last output folder

This commit is contained in:
Bruno Fargnoli 2026-07-23 22:54:28 +02:00
parent 096c5e7851
commit 66eb43a9cf
3 changed files with 64 additions and 1 deletions

View file

@ -0,0 +1,37 @@
{
"1": {
"inputs": {
"model_name": "Qwen3-VL-4B-Instruct",
"quantization": "None (FP16)",
"attention_mode": "auto",
"use_torch_compile": false,
"device": "auto",
"prompt_text": "",
"enhancement_style": "📝 Enhance",
"custom_system_prompt": "",
"max_tokens": 1024,
"temperature": 0.7,
"top_p": 0.9,
"repetition_penalty": 1.1,
"keep_model_loaded": false,
"seed": 12345
},
"class_type": "AILab_QwenVL_PromptEnhancer",
"_meta": {
"title": "QwenVL Prompt Enhancer"
}
},
"2": {
"inputs": {
"output": "",
"source": [
"1",
0
]
},
"class_type": "Display Any (rgthree)",
"_meta": {
"title": "Display Any (rgthree)"
}
}
}

View file

@ -683,6 +683,19 @@
"Outputs": [
{ "Node": "10", "Name": "Save Mesh", "Type": "Mesh" }
]
},
{
"Name": "Prompt Enhancer",
"File": "setup/Prompt Enhancer.json",
"Inputs": [
{ "Node": "1", "Input": "prompt_text", "Name": "Source Prompt", "Type": "String" },
{ "Node": "1", "Input": "max_tokens", "Name": "Max Tokens", "Type": "Number" },
{ "Node": "1", "Input": "keep_model_loaded", "Name": "Keep Model Loaded", "Type": "Boolean" },
{ "Node": "1", "Input": "seed", "Name": "Seed", "Type": "Number" }
],
"Outputs": [
{ "Node": "2", "Name": "Enhanced Prompt", "Type": "String" }
]
}
]
}

View file

@ -1,7 +1,8 @@
import { useState } from 'react'
import { useEffect, useState } from 'react'
import FolderBrowserDialog from './FolderBrowserDialog'
import {
EXPORT_FORMATS,
browseFolders,
exportObject3D,
isGlbUrl,
loadObject3DFromUrl,
@ -11,6 +12,8 @@ import {
import { convertMesh, ensureDesktopService } from '../utils/meshTools'
import './ExportMeshDialog.css'
const LAST_OUTPUT_FOLDER_KEY = 'exportMeshDialog:lastOutputFolder'
// Reusable export popup. Provide either `getObject3D` (an async function that
// returns the in-memory THREE.Object3D to export) or `meshUrl` (a mesh URL the
// dialog loads itself). `defaultName` seeds the output file name.
@ -31,6 +34,15 @@ export default function ExportMeshDialog({ getObject3D, meshUrl, defaultName = '
const formats = getObject3D ? EXPORT_FORMATS.filter(entry => entry.kind === 'local') : EXPORT_FORMATS
const selectedFormat = formats.find(entry => entry.value === format) || formats[0]
// Recall the last folder used, but drop it silently if it no longer exists.
useEffect(() => {
const saved = localStorage.getItem(LAST_OUTPUT_FOLDER_KEY)
if (!saved) return
browseFolders(saved)
.then(() => setOutputFolder(saved))
.catch(() => localStorage.removeItem(LAST_OUTPUT_FOLDER_KEY))
}, [])
// Source GLB for the preset paths. When the asset is already a .glb, use its
// original bytes (perfect fidelity — skin weights, clips and textures
// untouched); otherwise serialize through three.js, which now carries the
@ -103,6 +115,7 @@ export default function ExportMeshDialog({ getObject3D, meshUrl, defaultName = '
setProgress({ frac: 0.97, message: 'Writing files…' })
const result = await writeExportedFiles(folder, files)
localStorage.setItem(LAST_OUTPUT_FOLDER_KEY, folder)
const writtenNames = (result?.written || files.map(file => file.filename)).join(', ')
setSuccess(`Exported ${files.length} file${files.length === 1 ? '' : 's'}: ${writtenNames}${convertNote}`)
} catch (err) {