ModelTranslator: support pure-mesh FBX via naming-convention texture discovery and auto material

This commit is contained in:
ud18010
2026-07-15 16:39:00 +08:00
parent 78b250355b
commit 253f03273d
3 changed files with 82 additions and 14 deletions
+3 -1
View File
@@ -51,7 +51,9 @@ def write_unity_assets(outdir, summary, max_size):
with open(mix_png + ".meta", "w", encoding="utf-8", newline="\n") as f:
f.write(ua.texture_meta(mix_guid, srgb=False, max_size=max_size))
mat_name = "%s_%s" % (summary["model"], m["safe_name"])
# 与 bl_convert 的贴图命名一致:材质名等于模型名时不重复拼接
mat_name = summary["model"] if m["safe_name"] == summary["model"] \
else "%s_%s" % (summary["model"], m["safe_name"])
mat_path = os.path.join(outdir, mat_name + ".mat")
mat_guid = ua.guid_for(mat_path)
with open(mat_path, "w", encoding="utf-8", newline="\n") as f: