ModelTranslator: 烘焙前应用物体变换——修未应用缩放(cm单位FBX)致射线距离失效的脏色

well_uv.fbx(scale=0.01) 烘焙 22-33% 像素脏色,应用变换后与 well5k 像素级一致(<0.04%)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ud18010
2026-07-16 15:16:04 +08:00
co-authored by Claude Opus 4.8
parent e693a2edcf
commit 75d9244525
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -57,7 +57,14 @@ def _import_fbx_joined(path, warnings):
% (os.path.basename(path), ", ".join(skipped)))
if not meshes:
return None
return join_meshes(meshes)
obj = join_meshes(meshes)
# 应用物体变换(世界坐标不变):cage_extrusion/max_ray_distance 按低模局部空间解释,
# 未应用的缩放(如 cm 单位 FBX 的 scale=0.01)会把射线距离缩到近零导致大面积打空(脏色)
bpy.ops.object.select_all(action='DESELECT')
obj.select_set(True)
bpy.context.view_layer.objects.active = obj
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
return obj
def _setup_bake_target(low, stem):