implemented append_user_scripts using OPENPYPE_BLENDER_USER_SCRIPTS env to load user scripts

This commit is contained in:
iLLiCiTiT 2021-05-19 10:40:58 +02:00
parent 424e9950e7
commit 5110374a1b

View file

@ -91,3 +91,15 @@ def load_scripts(paths):
"Warning, unregistered class: %s(%s)" %
(subcls.__name__, cls.__name__)
)
def append_user_scripts():
user_scripts = os.environ.get("OPENPYPE_BLENDER_USER_SCRIPTS")
if not user_scripts:
return
try:
load_scripts(user_scripts.split(os.pathsep))
except Exception:
print("Couldn't load user scripts \"{}\"".format(user_scripts))
traceback.print_exc()