ModelTranslator: uvgate 回退标注改前缀匹配——兼容 +uvpm 后缀

- 新增 seam_fallback_label 纯函数:前缀匹配转换 seam* → seam_fallback*,保留后缀
- main() 调用改为函数式,避免等值判断失效
- 测试覆盖:plain seam、seam+uvpm、smart_fallback 透传

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
ud18010
2026-07-20 12:23:55 +08:00
co-authored by Claude Haiku 4.5
parent 4e948ffc50
commit 9fe93f3c92
2 changed files with 31 additions and 2 deletions
+8 -2
View File
@@ -7,6 +7,13 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def seam_fallback_label(mode):
"""回退产物标注:seam 系模式改 seam_fallback(保留 +uvpm 等后缀)。"""
if mode.startswith("seam"):
return "seam_fallback" + mode[len("seam"):]
return mode
def main():
import bpy
import json
@@ -42,8 +49,7 @@ def main():
warnings.append("%s 输出无 UV,回退 seam" % mode_label)
m = _do_unwrap(obj, "seam", warnings) # 内部自带 smart 回退
if m["mode"] == "seam":
m["mode"] = "seam_fallback"
m["mode"] = seam_fallback_label(m["mode"])
bpy.ops.object.select_all(action='DESELECT')
obj.select_set(True)
bpy.ops.export_scene.fbx(filepath=os.path.abspath(fbx), use_selection=True,