ModelTranslator: 审查修复——导出仅选中对象、常量通道日志、--tris 校验、超差警告

This commit is contained in:
ud18010
2026-07-16 11:05:19 +08:00
parent 59cf9b3663
commit cf237ffbf3
3 changed files with 13 additions and 1 deletions
+6 -1
View File
@@ -104,11 +104,16 @@ def main():
cur = len(obj.data.polygons)
if within_tolerance(target, cur) or cur <= target:
break
# 重试用尽仍超差且偏多:记录警告,交由上层决定是否可接受
if not within_tolerance(target, cur) and cur > target:
warnings.append("修正 %d 轮后仍超差:%d 面(目标 %d ±3%%" % (MAX_RETRY, cur, target))
_smart_unwrap(obj)
out_dir = os.path.dirname(os.path.abspath(out_fbx))
os.makedirs(out_dir, exist_ok=True)
bpy.ops.export_scene.fbx(filepath=out_fbx, path_mode='STRIP', embed_textures=False)
# 仅导出合并后的对象;整场景导出会把 armature/empty 等非 mesh 带进 _low.fbx
bpy.ops.export_scene.fbx(filepath=out_fbx, use_selection=True,
path_mode='STRIP', embed_textures=False)
print("MT_SUMMARY " + json.dumps(
{"src": os.path.basename(src), "fbx": os.path.basename(out_fbx),