WIP: MaterialX addon #104594

Closed
Bogdan Nagirniak wants to merge 34 commits from BogdanNagirniak/blender-addons:materialx-addon into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 17 additions and 0 deletions
Showing only changes of commit abcd6a82d1 - Show all commits

View File

@ -29,6 +29,7 @@ from . import (
nodes,
matlib,
material,
utils,
)
from . import logging
@ -53,6 +54,8 @@ def register():
def unregister():
log("unregister")
utils.clear_temp_dir()
matlib.unregister()
material.unregister()
nodes.unregister()

View File

@ -335,6 +335,20 @@ def temp_dir():
return d
def clear_temp_dir():
d = temp_dir()
paths = tuple(d.iterdir())
if not paths:
return
log("Clearing temp dir", d)
for path in paths:
if path.is_dir():
shutil.rmtree(path, ignore_errors=True)
else:
os.remove(path)
def get_temp_file(suffix, name=None, is_rand=False):
if not name:
return Path(tempfile.mktemp(suffix, "tmp", temp_dir()))