Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Use constant to define Asset path
Browse files Browse the repository at this point in the history
  • Loading branch information
simonebarbieri committed Oct 26, 2023
1 parent 28c1c2d commit 2f48446
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions openpype/hosts/unreal/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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(".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def load(self, context, name, namespace, data):
"""

# 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:
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/unreal/plugins/load/load_geometrycache_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
Expand All @@ -24,7 +25,7 @@ class PointCacheAlembicLoader(plugin.Loader):
icon = "cube"
color = "orange"

root = "/Game/Ayon/Assets"
root = AYON_ASSET_DIR

@staticmethod
def get_task(
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/unreal/plugins/load/load_skeletalmesh_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/unreal/plugins/load/load_skeletalmesh_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/unreal/plugins/load/load_staticmesh_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
Expand All @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion openpype/hosts/unreal/plugins/load/load_staticmesh_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api.pipeline import (
AYON_ASSET_DIR,
create_container,
imprint,
)
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/unreal/plugins/load/load_uasset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def load(self, context, name, namespace, options):
"""

# 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}"
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/unreal/plugins/load/load_yeticache.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def load(self, context, name, namespace, options):
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}"
Expand Down

0 comments on commit 2f48446

Please sign in to comment.