Windows support: install-path probing + platform notes
- Blender discovery adds the Windows versioned install dir (Program Files/ Blender Foundation/Blender */blender.exe); ODA adds Program Files/ODA (both still env > PATH first; shutil.which resolves .exe via PATHEXT) - README cross-platform section: pathlib + explicit UTF-8 I/O + bytes-decoded subprocesses throughout; Windows advice (PYTHONUTF8=1, LongPathsEnabled, ODA as the primary DWG path since libredwg is rare there) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import fnmatch
|
||||
import json
|
||||
import os
|
||||
@@ -93,6 +94,13 @@ def oda_converter() -> str | None:
|
||||
found = shutil.which("ODAFileConverter")
|
||||
if found:
|
||||
return found
|
||||
if sys.platform == "win32":
|
||||
hits = sorted(
|
||||
glob.glob(r"C:/Program Files/ODA/*/ODAFileConverter.exe")
|
||||
+ glob.glob(r"C:/Program Files (x86)/ODA/*/ODAFileConverter.exe")
|
||||
)
|
||||
if hits:
|
||||
return hits[-1]
|
||||
default = Path("/Applications/ODAFileConverter.app/Contents/MacOS/ODAFileConverter")
|
||||
return str(default) if default.exists() else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user