ModelTranslator: model_decimate 渲染 UV 观察图 PNG 并清理 sidecar
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
1b8656270d
commit
c1a1a0e490
@@ -33,6 +33,17 @@ def main():
|
|||||||
overlap = "%.1f%%" % (u["overlap"] * 100) if u["overlap"] is not None else "n/a"
|
overlap = "%.1f%%" % (u["overlap"] * 100) if u["overlap"] is not None else "n/a"
|
||||||
print(" UV: 模式=%s 岛数=%d 利用率=%.1f%% 翻转=%.1f%% 重叠=%s" %
|
print(" UV: 模式=%s 岛数=%d 利用率=%.1f%% 翻转=%.1f%% 重叠=%s" %
|
||||||
(u["mode"], u["islands"], u["fill"] * 100, u["flipped"] * 100, overlap))
|
(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"]:
|
for w in s["warnings"]:
|
||||||
print(" [警告] %s" % w)
|
print(" [警告] %s" % w)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user