ModelTranslator: model_decimate 渲染 UV 观察图 PNG 并清理 sidecar

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
ud18010
2026-07-21 11:44:37 +08:00
co-authored by Claude Opus 4.8
parent 1b8656270d
commit c1a1a0e490
+11
View File
@@ -33,6 +33,17 @@ def main():
overlap = "%.1f%%" % (u["overlap"] * 100) if u["overlap"] is not None else "n/a"
print(" UV: 模式=%s 岛数=%d 利用率=%.1f%% 翻转=%.1f%% 重叠=%s" %
(u["mode"], u["islands"], u["fill"] * 100, u["flipped"] * 100, overlap))
if s.get("uv_polys"):
try:
import json as _json
from uv_preview import render_uv_png
with open(s["uv_polys"], encoding="utf-8") as fp:
polys = _json.load(fp)
render_uv_png(polys, s["uv_preview"])
os.remove(s["uv_polys"])
print(" UV 观察图: %s" % s["uv_preview"])
except Exception as e:
print(" [警告] UV 观察图渲染失败:%s" % e)
for w in s["warnings"]:
print(" [警告] %s" % w)