ModelTranslator: QR use ExactQuadCount, authoritative QR_ENGINE override

真机验证发现 ExactQuadCount=0 自适应在高细节硬表面模型上面数暴涨
(well1500 目标2500->11500 quads)并连带 seam 展开重叠爆炸;改用 exact=True
尊重目标数后 well1500 得 5940 面/591 UV岛(优于 collapse 745)。
find_qr_engine 改为权威覆盖:QR_ENGINE 无效即 None,不再静默自动发现,
使强制回退可测、覆盖契约成立。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ud18010
2026-07-22 17:26:49 +08:00
co-authored by Claude Opus 4.8
parent 11036877fc
commit b8eb40f3e4
3 changed files with 19 additions and 4 deletions
@@ -83,6 +83,17 @@ class TestFindQrEngine(unittest.TestCase):
os.environ["APPDATA"] = tempfile.mkdtemp()
self.assertIsNone(qb.find_qr_engine())
def test_invalid_override_does_not_fall_through(self):
# QR_ENGINE 权威:显式设了但无效,即便 APPDATA 下装了真引擎也返回 None
root = tempfile.mkdtemp()
os.environ["QR_ENGINE"] = os.path.join(root, "nope.exe")
os.environ["APPDATA"] = root
eng_dir = os.path.join(root, "Blender Foundation", "Blender", "5.0",
"scripts", "addons", "QuadRemesher", "Engine")
os.makedirs(eng_dir)
open(os.path.join(eng_dir, "xremesh.exe"), "w").close()
self.assertIsNone(qb.find_qr_engine())
def test_globs_addon_path_picks_last(self):
root = tempfile.mkdtemp()
os.environ.pop("QR_ENGINE", None)