Use constant to define Asset path

This commit is contained in:
Simone Barbieri 2023-10-26 13:13:17 +01:00
parent 28c1c2dbb6
commit 2f4844613e
9 changed files with 14 additions and 8 deletions

View file

@ -30,6 +30,7 @@ import unreal # noqa
logger = logging.getLogger("openpype.hosts.unreal")
AYON_CONTAINERS = "AyonContainers"
AYON_ASSET_DIR = "/Game/Ayon/Assets"
CONTEXT_CONTAINER = "Ayon/context.json"
UNREAL_VERSION = semver.VersionInfo(
*os.getenv("AYON_UNREAL_VERSION").split(".")

View file

@ -69,7 +69,7 @@ class AnimationAlembicLoader(plugin.Loader):
"""
# Create directory for asset and ayon container
root = "/Game/Ayon/Assets"
root = unreal_pipeline.AYON_ASSET_DIR
asset = context.get('asset').get('name')
suffix = "_CON"
if asset:

View file

@ -8,6 +8,7 @@ from openpype.pipeline import (
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
@ -24,7 +25,7 @@ class PointCacheAlembicLoader(plugin.Loader):
icon = "cube"
color = "orange"
root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR
@staticmethod
def get_task(

View file

@ -8,6 +8,7 @@ from openpype.pipeline import (
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
@ -23,7 +24,7 @@ class SkeletalMeshAlembicLoader(plugin.Loader):
icon = "cube"
color = "orange"
root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR
@staticmethod
def get_task(filename, asset_dir, asset_name, replace, default_conversion):

View file

@ -8,6 +8,7 @@ from openpype.pipeline import (
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
@ -23,7 +24,7 @@ class SkeletalMeshFBXLoader(plugin.Loader):
icon = "cube"
color = "orange"
root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR
@staticmethod
def get_task(filename, asset_dir, asset_name, replace):

View file

@ -8,6 +8,7 @@ from openpype.pipeline import (
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
@ -23,7 +24,7 @@ class StaticMeshAlembicLoader(plugin.Loader):
icon = "cube"
color = "orange"
root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR
@staticmethod
def get_task(filename, asset_dir, asset_name, replace, default_conversion):

View file

@ -8,6 +8,7 @@ from openpype.pipeline import (
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
@ -23,7 +24,7 @@ class StaticMeshFBXLoader(plugin.Loader):
icon = "cube"
color = "orange"
root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR
@staticmethod
def get_task(filename, asset_dir, asset_name, replace):

View file

@ -41,7 +41,7 @@ class UAssetLoader(plugin.Loader):
"""
# Create directory for asset and Ayon container
root = "/Game/Ayon/Assets"
root = unreal_pipeline.AYON_ASSET_DIR
asset = context.get('asset').get('name')
suffix = "_CON"
asset_name = f"{asset}_{name}" if asset else f"{name}"

View file

@ -86,7 +86,7 @@ class YetiLoader(plugin.Loader):
raise RuntimeError("Groom plugin is not activated.")
# Create directory for asset and Ayon container
root = "/Game/Ayon/Assets"
root = unreal_pipeline.AYON_ASSET_DIR
asset = context.get('asset').get('name')
suffix = "_CON"
asset_name = f"{asset}_{name}" if asset else f"{name}"