Merge pull request #2 from ynput/enhancement/blender-env-variable

Blender: Env variable to user scripts
This commit is contained in:
Jakub Trllo 2024-02-07 17:21:13 +01:00 committed by GitHub
commit 6c511ec081
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View file

@ -35,10 +35,10 @@ class BlenderAddon(OpenPypeModule, IHostAddon):
# loops - will be removed at the end
previous_user_scripts.add(implementation_user_script_path)
openpype_blender_user_scripts = (
env.get("OPENPYPE_BLENDER_USER_SCRIPTS") or ""
ayon_blender_user_scripts = (
env.get("AYON_BLENDER_USER_SCRIPTS") or ""
)
for path in openpype_blender_user_scripts.split(os.pathsep):
for path in ayon_blender_user_scripts.split(os.pathsep):
if path:
previous_user_scripts.add(os.path.normpath(path))
@ -53,7 +53,7 @@ class BlenderAddon(OpenPypeModule, IHostAddon):
env["BLENDER_USER_SCRIPTS"] = implementation_user_script_path
# Set custom user scripts env
env["OPENPYPE_BLENDER_USER_SCRIPTS"] = os.pathsep.join(
env["AYON_BLENDER_USER_SCRIPTS"] = os.pathsep.join(
previous_user_scripts
)

View file

@ -123,7 +123,7 @@ def load_scripts(paths):
def append_user_scripts():
user_scripts = os.environ.get("OPENPYPE_BLENDER_USER_SCRIPTS")
user_scripts = os.environ.get("AYON_BLENDER_USER_SCRIPTS")
if not user_scripts:
return
@ -142,7 +142,7 @@ def set_app_templates_path():
# We look among the scripts paths for one of the paths that contains
# the app templates. The path must contain the subfolder
# `startup/bl_app_templates_user`.
paths = os.environ.get("OPENPYPE_BLENDER_USER_SCRIPTS").split(os.pathsep)
paths = os.environ.get("AYON_BLENDER_USER_SCRIPTS").split(os.pathsep)
app_templates_path = None
for path in paths:

View file

@ -13,7 +13,7 @@ from ayon_core.hosts.blender.api.pipeline import (
AVALON_PROPERTY,
)
logger = logging.getLogger("openpype").getChild("blender").getChild("load_action")
logger = logging.getLogger("ayon").getChild("blender").getChild("load_action")
class BlendActionLoader(plugin.AssetLoader):