blender customization
This commit is contained in:
1 parent
fb39e290c0
commit
8c0a639fba
12 files changed
+264
-8
No files matched your search
@@ -16,6 +16,12 @@ def slug(value):
|
||||
|
||||
def executable(name, explicit=None):
|
||||
candidate = explicit or os.environ.get("WORKSHOP_" + name.upper()) or shutil.which(name)
|
||||
if not candidate and name == "blender" and os.name == "nt":
|
||||
# Standard Windows installs do not necessarily add Blender to PATH.
|
||||
root = Path(os.environ.get("PROGRAMFILES", r"C:\Program Files")) / "Blender Foundation"
|
||||
installed = [path for path in root.glob("Blender */blender.exe") if path.is_file()]
|
||||
if installed:
|
||||
candidate = max(installed, key=lambda path: tuple(int(part) for part in re.findall(r"\d+", path.parent.name)))
|
||||
if candidate and Path(candidate).is_file():
|
||||
return str(Path(candidate).resolve())
|
||||
raise FileNotFoundError(
|
||||
|
||||
Reference in new issue
Block a user