Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/AYON-Menu-_reorder-the-menu-i…
Browse files Browse the repository at this point in the history
…tems-to-more-following-the-workflow-logic
  • Loading branch information
moonyuet authored Dec 8, 2024
2 parents 16676a1 + b8d0d14 commit ef94526
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 48 deletions.
3 changes: 2 additions & 1 deletion client/ayon_unreal/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,11 +1123,12 @@ def remove_map_and_sequence(container):
unreal.EditorAssetLibrary.delete_directory(f"{AYON_ROOT_DIR}/tmp")


def update_container(container, repre_entity, loaded_assets=None):
def update_container(container, project_name, repre_entity, loaded_assets=None):
asset_dir = container.get('namespace')
data = {
"representation": repre_entity["id"],
"parent": repre_entity["versionId"],
"project_name": project_name
}
if loaded_assets is not None:
data["loaded_assets"] = loaded_assets
Expand Down
2 changes: 2 additions & 0 deletions client/ayon_unreal/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def imprint(
asset_dir,
asset_name,
container_name,
project_name,
hierarchy_dir=None
):
data = {
Expand All @@ -427,6 +428,7 @@ def imprint(
"parent": context["representation"]["versionId"],
"family": context["product"]["productType"],
"loaded_assets": loaded_assets,
"project_name": project_name
}
if hierarchy_dir is not None:
data["master_directory"] = hierarchy_dir
Expand Down
12 changes: 8 additions & 4 deletions client/ayon_unreal/plugins/load/load_alembic_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def imprint(
frameStart,
frameEnd,
representation,
product_type
product_type,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -147,7 +148,8 @@ def imprint(
"frameEnd": frameEnd,
# TODO these should be probably removed
"asset": folder_path,
"family": product_type
"family": product_type,
"project_name": project_name
}
unreal_pipeline.imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -224,7 +226,8 @@ def load(self, context, name, namespace, options):
folder_entity["attrib"]["frameStart"],
folder_entity["attrib"]["frameEnd"],
context["representation"],
product_type
product_type,
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down Expand Up @@ -275,7 +278,8 @@ def update(self, container, context):
container.get("frameStart", "1"),
container.get("frameEnd", "1"),
repre_entity,
product_type
product_type,
context["project"]["name"]
)
asset_content = unreal.EditorAssetLibrary.list_assets(
asset_dir, recursive=True, include_folder=True
Expand Down
12 changes: 8 additions & 4 deletions client/ayon_unreal/plugins/load/load_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ def imprint(
asset_name,
representation,
product_type,
folder_entity
folder_entity,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -369,7 +370,8 @@ def imprint(
"asset": folder_path,
"family": product_type,
"frameStart": folder_entity["attrib"]["frameStart"],
"frameEnd": folder_entity["attrib"]["frameEnd"]
"frameEnd": folder_entity["attrib"]["frameEnd"],
"project_name": project_name
}
unreal_pipeline.imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -441,7 +443,8 @@ def load(self, context, name, namespace, options):
asset_name,
context["representation"],
product_type,
folder_entity
folder_entity,
context["project"]["name"]
)

imported_content = EditorAssetLibrary.list_assets(
Expand Down Expand Up @@ -501,7 +504,8 @@ def update(self, container, context):
asset_name,
repre_entity,
product_type,
folder_entity
folder_entity,
context["project"]["name"]
)

asset_content = EditorAssetLibrary.list_assets(
Expand Down
13 changes: 9 additions & 4 deletions client/ayon_unreal/plugins/load/load_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def imprint(
representation,
folder_name,
product_type,
folder_entity):
folder_entity,
project_name
):
data = {
"schema": "ayon:container-2.0",
"id": AYON_CONTAINER_ID,
Expand All @@ -96,7 +98,8 @@ def imprint(
"asset": folder_name,
"family": product_type,
"frameStart": folder_entity["attrib"]["frameStart"],
"frameEnd": folder_entity["attrib"]["frameEnd"]
"frameEnd": folder_entity["attrib"]["frameEnd"],
"project_name": project_name
}
imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -215,7 +218,8 @@ def load(self, context, name, namespace, options):
context["representation"],
folder_name,
context["product"]["productType"],
folder_entity
folder_entity,
context["project"]["name"]
)

EditorLevelLibrary.save_all_dirty_levels()
Expand Down Expand Up @@ -270,7 +274,8 @@ def update(self, container, context):
context["representation"],
folder_entity["name"],
context["product"]["productType"],
folder_entity
folder_entity,
context["project"]["name"]
)

EditorLevelLibrary.save_all_dirty_levels()
Expand Down
12 changes: 8 additions & 4 deletions client/ayon_unreal/plugins/load/load_geometrycache_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def imprint(
representation,
frame_start,
frame_end,
product_type
product_type,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -164,7 +165,8 @@ def imprint(
"folder_path": folder_path,
# TODO these should be probably removed
"family": product_type,
"asset": folder_path
"asset": folder_path,
"project_name": project_name
}
imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -236,7 +238,8 @@ def load(self, context, name, namespace, options):
context["representation"],
frame_start,
frame_end,
context["product"]["productType"]
context["product"]["productType"],
context["project"]["name"]
)
asset_content = unreal.EditorAssetLibrary.list_assets(
asset_dir, recursive=True, include_folder=True
Expand Down Expand Up @@ -284,7 +287,8 @@ def update(self, container, context):
repre_entity,
frame_start,
frame_end,
product_type
product_type,
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down
24 changes: 14 additions & 10 deletions client/ayon_unreal/plugins/load/load_image_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ def import_and_containerize(
create_container(container=container_name, path=asset_dir)

def imprint(
self,
folder_path,
asset_dir,
container_name,
asset_name,
repre_entity,
product_type
self,
folder_path,
asset_dir,
container_name,
asset_name,
repre_entity,
product_type,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -144,7 +145,8 @@ def imprint(
"product_type": product_type,
# TODO these shold be probably removed
"asset": folder_path,
"family": product_type
"family": product_type,
"project_name": project_name
}
imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -198,7 +200,8 @@ def load(self, context, name, namespace, options):
container_name,
asset_name,
context["representation"],
context["product"]["productType"]
context["product"]["productType"],
context["project"]["name"]
)

asset_contents = unreal.EditorAssetLibrary.list_assets(
Expand Down Expand Up @@ -236,7 +239,8 @@ def update(self, container, context):
container_name,
asset_name,
repre_entity,
product_type
product_type,
context["project"]["name"]
)

asset_contents = unreal.EditorAssetLibrary.list_assets(
Expand Down
5 changes: 3 additions & 2 deletions client/ayon_unreal/plugins/load/load_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def load(self, context, name, namespace, options):
asset_dir,
asset_name,
container_name,
context["project"]["name"],
hierarchy_dir=hierarchy_dir
)
save_dir = hierarchy_dir if create_sequences else asset_dir
Expand All @@ -362,6 +363,7 @@ def load(self, context, name, namespace, options):
return asset_content

def update(self, container, context):
project_name = context["project"]["name"]
data = get_current_project_settings()
create_sequences = (
data["unreal"]["import_settings"]["level_sequences_for_layouts"]
Expand Down Expand Up @@ -421,15 +423,14 @@ def update(self, container, context):

if create_sequences:
EditorLevelLibrary.save_current_level()
project_name = get_current_project_name()
source_path = get_representation_path(repre_entity)

loaded_assets = self._process(
source_path, project_name, asset_dir, sequence,
loaded_extension=self.folder_representation_type,
force_loaded=self.force_loaded)

update_container(container, repre_entity, loaded_assets=loaded_assets)
update_container(container, project_name, repre_entity, loaded_assets=loaded_assets)

EditorLevelLibrary.save_current_level()

Expand Down
3 changes: 2 additions & 1 deletion client/ayon_unreal/plugins/load/load_layout_existing.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def load(self, context, name, namespace, options):
loaded_assets,
curr_asset_dir,
asset_name,
container_name
container_name,
context["project"]["name"]
)

def update(self, container, context):
Expand Down
10 changes: 7 additions & 3 deletions client/ayon_unreal/plugins/load/load_skeletalmesh_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def imprint(
representation,
product_type,
frameStart,
frameEnd
frameEnd,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -175,7 +176,8 @@ def imprint(
"frameEnd": frameEnd,
# TODO these should be probably removed
"asset": folder_path,
"family": product_type
"family": product_type,
"project_name": project_name
}

imprint(f"{asset_dir}/{container_name}", data)
Expand Down Expand Up @@ -241,6 +243,7 @@ def load(self, context, name, namespace, options):
product_type,
folder_entity["attrib"]["frameStart"],
folder_entity["attrib"]["frameEnd"],
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down Expand Up @@ -286,7 +289,8 @@ def update(self, container, context):
repre_entity,
product_type,
container.get("frameStart", 1),
container.get("frameEnd", 1)
container.get("frameEnd", 1),
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down
12 changes: 8 additions & 4 deletions client/ayon_unreal/plugins/load/load_skeletalmesh_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def imprint(
container_name,
asset_name,
representation,
product_type
product_type,
project_name
):
data = {
"schema": "ayon:container-2.0",
Expand All @@ -116,7 +117,8 @@ def imprint(
"product_type": product_type,
# TODO these should be probably removed
"asset": folder_path,
"family": product_type
"family": product_type,
"project_name": project_name
}
imprint(f"{asset_dir}/{container_name}", data)

Expand Down Expand Up @@ -169,7 +171,8 @@ def load(self, context, name, namespace, options):
container_name,
asset_name,
context["representation"],
product_type
product_type,
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down Expand Up @@ -206,7 +209,8 @@ def update(self, container, context):
container_name,
asset_name,
repre_entity,
product_type
product_type,
context["project"]["name"]
)

asset_content = unreal.EditorAssetLibrary.list_assets(
Expand Down
Loading

0 comments on commit ef94526

Please sign in to comment.