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
+5
View File
@@ -103,8 +103,13 @@ def _rewire_emit(mat, input_name, warnings):
else:
v = sock.default_value
if isinstance(v, float):
# 该通道无贴图,把常量值直接烘入
warnings.append("%s.%s 无贴图,(常量) %.3f 烘入" % (mat.name, input_name, v))
emit.inputs['Color'].default_value = (v, v, v, 1.0)
else: # Base Color 是 4 分量
# 该通道无贴图,把常量色直接烘入
warnings.append("%s.%s 无贴图,(常量色 %.3f/%.3f/%.3f) 烘入"
% (mat.name, input_name, v[0], v[1], v[2]))
emit.inputs['Color'].default_value = (v[0], v[1], v[2], 1.0)
for l in list(out.inputs['Surface'].links):
nt.links.remove(l)