diff --git a/client/ayon_core/host/host.py b/client/ayon_core/host/host.py index f79c22824b..d9739603d7 100644 --- a/client/ayon_core/host/host.py +++ b/client/ayon_core/host/host.py @@ -108,7 +108,7 @@ class HostBase(object): return os.environ.get("AYON_PROJECT_NAME") - def get_current_asset_name(self): + def get_current_folder_path(self): """ Returns: Union[str, None]: Current asset name. @@ -139,7 +139,7 @@ class HostBase(object): return { "project_name": self.get_current_project_name(), - "folder_path": self.get_current_asset_name(), + "folder_path": self.get_current_folder_path(), "task_name": self.get_current_task_name() } diff --git a/client/ayon_core/hosts/aftereffects/plugins/create/workfile_creator.py b/client/ayon_core/hosts/aftereffects/plugins/create/workfile_creator.py index 282e06d0bf..0dae779496 100644 --- a/client/ayon_core/hosts/aftereffects/plugins/create/workfile_creator.py +++ b/client/ayon_core/hosts/aftereffects/plugins/create/workfile_creator.py @@ -39,7 +39,7 @@ class AEWorkfileCreator(AutoCreator): context = self.create_context project_name = context.get_current_project_name() - asset_name = context.get_current_asset_name() + asset_name = context.get_current_folder_path() task_name = context.get_current_task_name() host_name = context.host_name diff --git a/client/ayon_core/hosts/aftereffects/plugins/publish/validate_instance_asset.py b/client/ayon_core/hosts/aftereffects/plugins/publish/validate_instance_asset.py index e8f2e29a2f..bf54ec2115 100644 --- a/client/ayon_core/hosts/aftereffects/plugins/publish/validate_instance_asset.py +++ b/client/ayon_core/hosts/aftereffects/plugins/publish/validate_instance_asset.py @@ -1,6 +1,6 @@ import pyblish.api -from ayon_core.pipeline import get_current_asset_name +from ayon_core.pipeline import get_current_folder_path from ayon_core.pipeline.publish import ( ValidateContentsOrder, PublishXmlValidationError, @@ -30,7 +30,7 @@ class ValidateInstanceAssetRepair(pyblish.api.Action): for instance in instances: data = stub.read(instance[0]) - data["folderPath"] = get_current_asset_name() + data["folderPath"] = get_current_folder_path() stub.imprint(instance[0].instance_id, data) @@ -54,7 +54,7 @@ class ValidateInstanceAsset(pyblish.api.InstancePlugin): def process(self, instance): instance_asset = instance.data["folderPath"] - current_asset = get_current_asset_name() + current_asset = get_current_folder_path() msg = ( f"Instance asset {instance_asset} is not the same " f"as current context {current_asset}." diff --git a/client/ayon_core/hosts/blender/api/ops.py b/client/ayon_core/hosts/blender/api/ops.py index dcbc44bcad..91a79f9049 100644 --- a/client/ayon_core/hosts/blender/api/ops.py +++ b/client/ayon_core/hosts/blender/api/ops.py @@ -16,7 +16,7 @@ import bpy import bpy.utils.previews from ayon_core import style -from ayon_core.pipeline import get_current_asset_name, get_current_task_name +from ayon_core.pipeline import get_current_folder_path, get_current_task_name from ayon_core.tools.utils import host_tools from .workio import OpenFileCacher @@ -388,7 +388,7 @@ class TOPBAR_MT_avalon(bpy.types.Menu): else: pyblish_menu_icon_id = 0 - asset = get_current_asset_name() + asset = get_current_folder_path() task = get_current_task_name() context_label = f"{asset}, {task}" context_label_item = layout.row() diff --git a/client/ayon_core/hosts/blender/api/pipeline.py b/client/ayon_core/hosts/blender/api/pipeline.py index fcac285f74..3270564b09 100644 --- a/client/ayon_core/hosts/blender/api/pipeline.py +++ b/client/ayon_core/hosts/blender/api/pipeline.py @@ -20,7 +20,7 @@ from ayon_core.client import get_asset_by_name from ayon_core.pipeline import ( schema, get_current_project_name, - get_current_asset_name, + get_current_folder_path, register_loader_plugin_path, register_creator_plugin_path, deregister_loader_plugin_path, @@ -223,7 +223,7 @@ def message_window(title, message): def get_asset_data(): project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() asset_doc = get_asset_by_name(project_name, asset_name) return asset_doc.get("data") diff --git a/client/ayon_core/hosts/blender/plugins/create/create_workfile.py b/client/ayon_core/hosts/blender/plugins/create/create_workfile.py index ead3ed7749..29a03cb369 100644 --- a/client/ayon_core/hosts/blender/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/blender/plugins/create/create_workfile.py @@ -33,7 +33,7 @@ class CreateWorkfile(BaseCreator, AutoCreator): ) project_name = self.project_name - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.create_context.host_name diff --git a/client/ayon_core/hosts/fusion/api/menu.py b/client/ayon_core/hosts/fusion/api/menu.py index a2b0a7b628..2f6a1fa808 100644 --- a/client/ayon_core/hosts/fusion/api/menu.py +++ b/client/ayon_core/hosts/fusion/api/menu.py @@ -13,7 +13,7 @@ from ayon_core.hosts.fusion.api.lib import ( set_asset_framerange, set_asset_resolution, ) -from ayon_core.pipeline import get_current_asset_name +from ayon_core.pipeline import get_current_folder_path from ayon_core.resources import get_ayon_icon_filepath from ayon_core.tools.utils import get_qt_app @@ -131,7 +131,7 @@ class OpenPypeMenu(QtWidgets.QWidget): def on_task_changed(self): # Update current context label - label = get_current_asset_name() + label = get_current_folder_path() self.asset_label.setText(label) def register_callback(self, name, fn): diff --git a/client/ayon_core/hosts/fusion/plugins/create/create_workfile.py b/client/ayon_core/hosts/fusion/plugins/create/create_workfile.py index dfd9da3df1..53e2a0ff62 100644 --- a/client/ayon_core/hosts/fusion/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/fusion/plugins/create/create_workfile.py @@ -67,7 +67,7 @@ class FusionWorkfileCreator(AutoCreator): break project_name = self.create_context.get_current_project_name() - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.create_context.host_name diff --git a/client/ayon_core/hosts/harmony/plugins/publish/validate_instances.py b/client/ayon_core/hosts/harmony/plugins/publish/validate_instances.py index fdba834de6..fa3d2e22cb 100644 --- a/client/ayon_core/hosts/harmony/plugins/publish/validate_instances.py +++ b/client/ayon_core/hosts/harmony/plugins/publish/validate_instances.py @@ -1,7 +1,7 @@ import pyblish.api import ayon_core.hosts.harmony.api as harmony -from ayon_core.pipeline import get_current_asset_name +from ayon_core.pipeline import get_current_folder_path from ayon_core.pipeline.publish import ( ValidateContentsOrder, PublishXmlValidationError, @@ -27,7 +27,7 @@ class ValidateInstanceRepair(pyblish.api.Action): # Apply pyblish.logic to get the instances for the plug-in instances = pyblish.api.instances_by_plugin(failed, plugin) - folder_path = get_current_asset_name() + folder_path = get_current_folder_path() for instance in instances: data = harmony.read(instance.data["setMembers"][0]) data["folderPath"] = folder_path @@ -44,7 +44,7 @@ class ValidateInstance(pyblish.api.InstancePlugin): def process(self, instance): instance_asset = instance.data["folderPath"] - current_asset = get_current_asset_name() + current_asset = get_current_folder_path() msg = ( "Instance asset is not the same as current asset:" f"\nInstance: {instance_asset}\nCurrent: {current_asset}" diff --git a/client/ayon_core/hosts/hiero/api/menu.py b/client/ayon_core/hosts/hiero/api/menu.py index ba0cbdd120..632b11c7d3 100644 --- a/client/ayon_core/hosts/hiero/api/menu.py +++ b/client/ayon_core/hosts/hiero/api/menu.py @@ -11,7 +11,7 @@ from ayon_core.tools.utils import host_tools from ayon_core.settings import get_project_settings from ayon_core.pipeline import ( get_current_project_name, - get_current_asset_name, + get_current_folder_path, get_current_task_name ) @@ -25,7 +25,7 @@ self._change_context_menu = None def get_context_label(): return "{}, {}".format( - get_current_asset_name(), + get_current_folder_path(), get_current_task_name() ) diff --git a/client/ayon_core/hosts/houdini/api/creator_node_shelves.py b/client/ayon_core/hosts/houdini/api/creator_node_shelves.py index 57fdef753a..273d532d5a 100644 --- a/client/ayon_core/hosts/houdini/api/creator_node_shelves.py +++ b/client/ayon_core/hosts/houdini/api/creator_node_shelves.py @@ -94,7 +94,7 @@ def create_interactive(creator_identifier, **kwargs): project_name=context.get_current_project_name(), asset_doc=get_asset_by_name( project_name=context.get_current_project_name(), - asset_name=context.get_current_asset_name() + asset_name=context.get_current_folder_path() ), task_name=context.get_current_task_name(), variant=variant, diff --git a/client/ayon_core/hosts/houdini/api/lib.py b/client/ayon_core/hosts/houdini/api/lib.py index ea62a1f0a6..fc1808b225 100644 --- a/client/ayon_core/hosts/houdini/api/lib.py +++ b/client/ayon_core/hosts/houdini/api/lib.py @@ -17,7 +17,7 @@ from ayon_core.settings import get_current_project_settings from ayon_core.pipeline import ( Anatomy, get_current_project_name, - get_current_asset_name, + get_current_folder_path, registered_host, get_current_context, get_current_host_name, @@ -97,7 +97,7 @@ def generate_ids(nodes, asset_id=None): if asset_id is None: project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() # Get the asset ID from the database for the asset of current context asset_doc = get_asset_by_name(project_name, asset_name, fields=["_id"]) @@ -531,7 +531,7 @@ def reset_framerange(): # Get asset data project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() # Get the asset ID from the database for the asset of current context asset_doc = get_asset_by_name(project_name, asset_name) asset_data = asset_doc["data"] diff --git a/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py b/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py index 631ef6ce77..898fe5e5f9 100644 --- a/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/houdini/plugins/create/create_workfile.py @@ -26,7 +26,7 @@ class CreateWorkfile(plugin.HoudiniCreatorBase, AutoCreator): ), None) project_name = self.project_name - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.host_name diff --git a/client/ayon_core/hosts/houdini/startup/MainMenuCommon.xml b/client/ayon_core/hosts/houdini/startup/MainMenuCommon.xml index b2ea142cd5..25e8c9177b 100644 --- a/client/ayon_core/hosts/houdini/startup/MainMenuCommon.xml +++ b/client/ayon_core/hosts/houdini/startup/MainMenuCommon.xml @@ -8,8 +8,8 @@ return os.environ.get("AYON_MENU_LABEL") or "AYON" ]]> diff --git a/client/ayon_core/hosts/max/plugins/create/create_workfile.py b/client/ayon_core/hosts/max/plugins/create/create_workfile.py index 1552149413..d3ae3382bc 100644 --- a/client/ayon_core/hosts/max/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/max/plugins/create/create_workfile.py @@ -24,7 +24,7 @@ class CreateWorkfile(plugin.MaxCreatorBase, AutoCreator): if instance.creator_identifier == self.identifier ), None) project_name = self.project_name - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.create_context.host_name diff --git a/client/ayon_core/hosts/maya/api/commands.py b/client/ayon_core/hosts/maya/api/commands.py index ad669980df..75931e301a 100644 --- a/client/ayon_core/hosts/maya/api/commands.py +++ b/client/ayon_core/hosts/maya/api/commands.py @@ -5,7 +5,7 @@ from maya import cmds from ayon_api import get_project from ayon_core.client import get_asset_by_name -from ayon_core.pipeline import get_current_project_name, get_current_asset_name +from ayon_core.pipeline import get_current_project_name, get_current_folder_path class ToolWindows: @@ -75,7 +75,7 @@ def reset_resolution(): # Get resolution from asset project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() asset_doc = get_asset_by_name(project_name, asset_name) resolution = _resolution_from_document(asset_doc) # Try get resolution from project diff --git a/client/ayon_core/hosts/maya/api/lib.py b/client/ayon_core/hosts/maya/api/lib.py index dc242ebd15..fc084d9e23 100644 --- a/client/ayon_core/hosts/maya/api/lib.py +++ b/client/ayon_core/hosts/maya/api/lib.py @@ -31,7 +31,7 @@ from ayon_core.client import ( from ayon_core.settings import get_project_settings from ayon_core.pipeline import ( get_current_project_name, - get_current_asset_name, + get_current_folder_path, get_current_task_name, discover_loader_plugins, loaders_from_representation, @@ -1668,7 +1668,7 @@ def generate_ids(nodes, asset_id=None): if asset_id is None: # Get the asset ID from the database for the asset of current context project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() asset_doc = get_asset_by_name(project_name, asset_name, fields=["_id"]) assert asset_doc, "No current asset found in Session" asset_id = asset_doc['_id'] @@ -2499,7 +2499,7 @@ def get_fps_for_current_context(): """ project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() asset_doc = get_asset_by_name( project_name, asset_name, fields=["data.fps"] ) or {} @@ -2531,7 +2531,7 @@ def get_frame_range(include_animation_range=False): # Set frame start/end project_name = get_current_project_name() - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() asset = get_asset_by_name(project_name, asset_name) frame_start = asset["data"].get("frameStart") diff --git a/client/ayon_core/hosts/maya/api/menu.py b/client/ayon_core/hosts/maya/api/menu.py index 70347e91b6..8de025bfe5 100644 --- a/client/ayon_core/hosts/maya/api/menu.py +++ b/client/ayon_core/hosts/maya/api/menu.py @@ -8,7 +8,7 @@ import maya.utils import maya.cmds as cmds from ayon_core.pipeline import ( - get_current_asset_name, + get_current_folder_path, get_current_task_name, registered_host ) @@ -43,7 +43,7 @@ def _get_menu(menu_name=None): def get_context_label(): return "{}, {}".format( - get_current_asset_name(), + get_current_folder_path(), get_current_task_name() ) diff --git a/client/ayon_core/hosts/maya/api/plugin.py b/client/ayon_core/hosts/maya/api/plugin.py index 1151b0e248..5d6ffe0384 100644 --- a/client/ayon_core/hosts/maya/api/plugin.py +++ b/client/ayon_core/hosts/maya/api/plugin.py @@ -454,7 +454,7 @@ class RenderlayerCreator(NewCreator, MayaCreatorBase): # this instance will not have the `instance_node` data yet # until it's been saved/persisted at least once. project_name = self.create_context.get_current_project_name() - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() instance_data = { "folderPath": asset_name, "task": self.create_context.get_current_task_name(), diff --git a/client/ayon_core/hosts/maya/api/workfile_template_builder.py b/client/ayon_core/hosts/maya/api/workfile_template_builder.py index 6ae2a075e3..abe8f458dc 100644 --- a/client/ayon_core/hosts/maya/api/workfile_template_builder.py +++ b/client/ayon_core/hosts/maya/api/workfile_template_builder.py @@ -4,7 +4,7 @@ from maya import cmds from ayon_core.pipeline import ( registered_host, - get_current_asset_name, + get_current_folder_path, AYON_INSTANCE_ID, AVALON_INSTANCE_ID, ) @@ -74,7 +74,7 @@ class MayaTemplateBuilder(AbstractTemplateBuilder): return True # update imported sets information - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() for node in imported_sets: if not cmds.attributeQuery("id", node=node, exists=True): continue diff --git a/client/ayon_core/hosts/maya/plugins/create/create_multishot_layout.py b/client/ayon_core/hosts/maya/plugins/create/create_multishot_layout.py index e7b903312f..c640c9f52a 100644 --- a/client/ayon_core/hosts/maya/plugins/create/create_multishot_layout.py +++ b/client/ayon_core/hosts/maya/plugins/create/create_multishot_layout.py @@ -10,7 +10,7 @@ from ayon_core.hosts.maya.api import plugin from ayon_core.lib import BoolDef, EnumDef, TextDef from ayon_core.pipeline import ( Creator, - get_current_asset_name, + get_current_folder_path, get_current_project_name, ) from ayon_core.pipeline.create import CreatorError @@ -45,7 +45,7 @@ class CreateMultishotLayout(plugin.MayaCreator): """ project_name = get_current_project_name() - folder_path = get_current_asset_name() + folder_path = get_current_folder_path() if "/" in folder_path: current_folder = get_folder_by_path(project_name, folder_path) else: diff --git a/client/ayon_core/hosts/maya/plugins/create/create_workfile.py b/client/ayon_core/hosts/maya/plugins/create/create_workfile.py index 5eb32e1c90..1c6922f942 100644 --- a/client/ayon_core/hosts/maya/plugins/create/create_workfile.py +++ b/client/ayon_core/hosts/maya/plugins/create/create_workfile.py @@ -25,7 +25,7 @@ class CreateWorkfile(plugin.MayaCreatorBase, AutoCreator): ), None) project_name = self.project_name - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.create_context.host_name diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index f745d4ff4b..01ddf52dad 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -44,7 +44,7 @@ from ayon_core.pipeline import ( Anatomy, get_current_host_name, get_current_project_name, - get_current_asset_name, + get_current_folder_path, AYON_INSTANCE_ID, AVALON_INSTANCE_ID, ) @@ -1462,7 +1462,7 @@ class WorkfileSettings(object): Context._project_entity = project_entity self._project_name = project_name - self._asset = get_current_asset_name() + self._asset = get_current_folder_path() self._asset_entity = get_asset_by_name(project_name, self._asset) self._root_node = root_node or nuke.root() self._nodes = self.get_nodes(nodes=nodes) @@ -2108,7 +2108,7 @@ Reopening Nuke should synchronize these paths and resolve any discrepancies. from .utils import set_context_favorites work_dir = os.getenv("AYON_WORKDIR") - asset = get_current_asset_name() + asset = get_current_folder_path() favorite_items = OrderedDict() # project diff --git a/client/ayon_core/hosts/nuke/api/pipeline.py b/client/ayon_core/hosts/nuke/api/pipeline.py index 582df952d3..1189f79a07 100644 --- a/client/ayon_core/hosts/nuke/api/pipeline.py +++ b/client/ayon_core/hosts/nuke/api/pipeline.py @@ -21,7 +21,7 @@ from ayon_core.pipeline import ( AYON_INSTANCE_ID, AVALON_INSTANCE_ID, AVALON_CONTAINER_ID, - get_current_asset_name, + get_current_folder_path, get_current_task_name, registered_host, ) @@ -224,7 +224,7 @@ def _show_workfiles(): def get_context_label(): return "{0}, {1}".format( - get_current_asset_name(), + get_current_folder_path(), get_current_task_name() ) diff --git a/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py b/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py index 0a0467787a..de46e02b37 100644 --- a/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py +++ b/client/ayon_core/hosts/nuke/plugins/create/workfile_creator.py @@ -27,7 +27,7 @@ class WorkfileCreator(AutoCreator): ) project_name = self.create_context.get_current_project_name() - asset_name = self.create_context.get_current_asset_name() + asset_name = self.create_context.get_current_folder_path() task_name = self.create_context.get_current_task_name() host_name = self.create_context.host_name diff --git a/client/ayon_core/hosts/photoshop/lib.py b/client/ayon_core/hosts/photoshop/lib.py index 6d5be48bc2..de3bc2ea6e 100644 --- a/client/ayon_core/hosts/photoshop/lib.py +++ b/client/ayon_core/hosts/photoshop/lib.py @@ -40,7 +40,7 @@ class PSAutoCreator(AutoCreator): context = self.create_context project_name = context.get_current_project_name() - asset_name = context.get_current_asset_name() + asset_name = context.get_current_folder_path() task_name = context.get_current_task_name() host_name = context.host_name diff --git a/client/ayon_core/hosts/photoshop/plugins/create/create_flatten_image.py b/client/ayon_core/hosts/photoshop/plugins/create/create_flatten_image.py index 11bf92d5fb..36b5e1577d 100644 --- a/client/ayon_core/hosts/photoshop/plugins/create/create_flatten_image.py +++ b/client/ayon_core/hosts/photoshop/plugins/create/create_flatten_image.py @@ -32,7 +32,7 @@ class AutoImageCreator(PSAutoCreator): context = self.create_context project_name = context.get_current_project_name() - asset_name = context.get_current_asset_name() + asset_name = context.get_current_folder_path() task_name = context.get_current_task_name() host_name = context.host_name asset_doc = get_asset_by_name(project_name, asset_name) diff --git a/client/ayon_core/hosts/photoshop/plugins/publish/validate_instance_asset.py b/client/ayon_core/hosts/photoshop/plugins/publish/validate_instance_asset.py index 67a7303316..937d68eeff 100644 --- a/client/ayon_core/hosts/photoshop/plugins/publish/validate_instance_asset.py +++ b/client/ayon_core/hosts/photoshop/plugins/publish/validate_instance_asset.py @@ -1,6 +1,6 @@ import pyblish.api -from ayon_core.pipeline import get_current_asset_name +from ayon_core.pipeline import get_current_folder_path from ayon_core.pipeline.publish import ( ValidateContentsOrder, PublishXmlValidationError, @@ -28,7 +28,7 @@ class ValidateInstanceAssetRepair(pyblish.api.Action): # Apply pyblish.logic to get the instances for the plug-in instances = pyblish.api.instances_by_plugin(failed, plugin) stub = photoshop.stub() - current_asset_name = get_current_asset_name() + current_asset_name = get_current_folder_path() for instance in instances: data = stub.read(instance[0]) data["folderPath"] = current_asset_name @@ -55,7 +55,7 @@ class ValidateInstanceAsset(OptionalPyblishPluginMixin, def process(self, instance): instance_asset = instance.data["folderPath"] - current_asset = get_current_asset_name() + current_asset = get_current_folder_path() if instance_asset != current_asset: msg = ( diff --git a/client/ayon_core/hosts/resolve/plugins/publish/precollect_workfile.py b/client/ayon_core/hosts/resolve/plugins/publish/precollect_workfile.py index a147c9a905..71c3aa4571 100644 --- a/client/ayon_core/hosts/resolve/plugins/publish/precollect_workfile.py +++ b/client/ayon_core/hosts/resolve/plugins/publish/precollect_workfile.py @@ -1,7 +1,7 @@ import pyblish.api from pprint import pformat -from ayon_core.pipeline import get_current_asset_name +from ayon_core.pipeline import get_current_folder_path from ayon_core.hosts.resolve import api as rapi from ayon_core.hosts.resolve.otio import davinci_export @@ -14,7 +14,7 @@ class PrecollectWorkfile(pyblish.api.ContextPlugin): order = pyblish.api.CollectorOrder - 0.5 def process(self, context): - current_asset_name = get_current_asset_name() + current_asset_name = get_current_folder_path() asset_name = current_asset_name.split("/")[-1] product_name = "workfileMain" diff --git a/client/ayon_core/hosts/substancepainter/api/pipeline.py b/client/ayon_core/hosts/substancepainter/api/pipeline.py index 843c120d8e..a14d398808 100644 --- a/client/ayon_core/hosts/substancepainter/api/pipeline.py +++ b/client/ayon_core/hosts/substancepainter/api/pipeline.py @@ -250,8 +250,8 @@ class SubstanceHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost): has_formatting_entries = any("{" in item["value"] for item in shelves) if has_formatting_entries: project_name = self.get_current_project_name() - asset_name = self.get_current_asset_name() - task_name = self.get_current_asset_name() + asset_name = self.get_current_folder_path() + task_name = self.get_current_task_name() project_settings = get_project_settings(project_name) formatting_data = get_template_data_with_names( project_name, asset_name, task_name, project_settings diff --git a/client/ayon_core/hosts/tvpaint/plugins/create/create_render.py b/client/ayon_core/hosts/tvpaint/plugins/create/create_render.py index dc53ccb9ca..28d21d69e6 100644 --- a/client/ayon_core/hosts/tvpaint/plugins/create/create_render.py +++ b/client/ayon_core/hosts/tvpaint/plugins/create/create_render.py @@ -1069,7 +1069,7 @@ class TVPaintSceneRenderCreator(TVPaintAutoCreator): create_context = self.create_context host_name = create_context.host_name project_name = create_context.get_current_project_name() - asset_name = create_context.get_current_asset_name() + asset_name = create_context.get_current_folder_path() task_name = create_context.get_current_task_name() asset_doc = get_asset_by_name(project_name, asset_name) @@ -1118,7 +1118,7 @@ class TVPaintSceneRenderCreator(TVPaintAutoCreator): create_context = self.create_context host_name = create_context.host_name project_name = create_context.get_current_project_name() - asset_name = create_context.get_current_asset_name() + asset_name = create_context.get_current_folder_path() task_name = create_context.get_current_task_name() existing_name = existing_instance.get("folderPath") diff --git a/client/ayon_core/pipeline/__init__.py b/client/ayon_core/pipeline/__init__.py index 679e9a195e..d5813286da 100644 --- a/client/ayon_core/pipeline/__init__.py +++ b/client/ayon_core/pipeline/__init__.py @@ -94,7 +94,7 @@ from .context_tools import ( get_current_context, get_current_host_name, get_current_project_name, - get_current_asset_name, + get_current_folder_path, get_current_task_name ) install = install_host @@ -195,7 +195,7 @@ __all__ = ( "get_current_context", "get_current_host_name", "get_current_project_name", - "get_current_asset_name", + "get_current_folder_path", "get_current_task_name", # Backwards compatible function names diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 7fa3def33a..93fc329081 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -385,10 +385,10 @@ def get_current_project_name(): return get_global_context()["project_name"] -def get_current_asset_name(): +def get_current_folder_path(): host = registered_host() if isinstance(host, HostBase): - return host.get_current_asset_name() + return host.get_current_folder_path() return get_global_context()["folder_path"] @@ -439,7 +439,7 @@ def get_current_project_asset(asset_name=None, asset_id=None, fields=None): return get_asset_by_id(project_name, asset_id, fields=fields) if not asset_name: - asset_name = get_current_asset_name() + asset_name = get_current_folder_path() # Skip if is not set even on context if not asset_name: return None diff --git a/client/ayon_core/pipeline/create/context.py b/client/ayon_core/pipeline/create/context.py index 425de4305f..091ae902c6 100644 --- a/client/ayon_core/pipeline/create/context.py +++ b/client/ayon_core/pipeline/create/context.py @@ -1402,7 +1402,7 @@ class CreateContext: ).format(joined_methods)) self._current_project_name = None - self._current_asset_name = None + self._current_folder_path = None self._current_task_name = None self._current_workfile_path = None @@ -1557,14 +1557,14 @@ class CreateContext: return self._current_project_name - def get_current_asset_name(self): + def get_current_folder_path(self): """Asset name which was used as current context on context reset. Returns: Union[str, None]: Asset name. """ - return self._current_asset_name + return self._current_folder_path def get_current_task_name(self): """Task name which was used as current context on context reset. @@ -1612,7 +1612,7 @@ class CreateContext: ) return ( self._current_project_name != project_name - or self._current_asset_name != asset_name + or self._current_folder_path != asset_name or self._current_task_name != task_name or self._current_workfile_path != workfile_path ) @@ -1718,7 +1718,7 @@ class CreateContext: ) self._current_project_name = project_name - self._current_asset_name = asset_name + self._current_folder_path = asset_name self._current_task_name = task_name self._current_workfile_path = workfile_path diff --git a/client/ayon_core/pipeline/workfile/build_workfile.py b/client/ayon_core/pipeline/workfile/build_workfile.py index 34d8ef0c8f..1f07493f9a 100644 --- a/client/ayon_core/pipeline/workfile/build_workfile.py +++ b/client/ayon_core/pipeline/workfile/build_workfile.py @@ -102,7 +102,7 @@ class BuildWorkfile: from ayon_core.pipeline.context_tools import ( get_current_project_name, - get_current_asset_name, + get_current_folder_path, get_current_task_name, ) @@ -110,7 +110,7 @@ class BuildWorkfile: # Get current asset name and entity project_name = get_current_project_name() - current_folder_path = get_current_asset_name() + current_folder_path = get_current_folder_path() current_asset_doc = get_asset_by_name( project_name, current_folder_path ) diff --git a/client/ayon_core/pipeline/workfile/workfile_template_builder.py b/client/ayon_core/pipeline/workfile/workfile_template_builder.py index c889e0cafb..1b5a848ea2 100644 --- a/client/ayon_core/pipeline/workfile/workfile_template_builder.py +++ b/client/ayon_core/pipeline/workfile/workfile_template_builder.py @@ -128,9 +128,9 @@ class AbstractTemplateBuilder(object): return os.getenv("AYON_PROJECT_NAME") @property - def current_asset_name(self): + def current_folder_path(self): if isinstance(self._host, HostBase): - return self._host.get_current_asset_name() + return self._host.get_current_folder_path() return os.getenv("AYON_FOLDER_PATH") @property @@ -144,7 +144,7 @@ class AbstractTemplateBuilder(object): return self._host.get_current_context() return { "project_name": self.project_name, - "folder_path": self.current_asset_name, + "folder_path": self.current_folder_path, "task_name": self.current_task_name } @@ -158,7 +158,7 @@ class AbstractTemplateBuilder(object): def current_asset_doc(self): if self._current_asset_doc is None: self._current_asset_doc = get_asset_by_name( - self.project_name, self.current_asset_name + self.project_name, self.current_folder_path ) return self._current_asset_doc diff --git a/client/ayon_core/plugins/publish/collect_from_create_context.py b/client/ayon_core/plugins/publish/collect_from_create_context.py index 8218806c4c..36d44def41 100644 --- a/client/ayon_core/plugins/publish/collect_from_create_context.py +++ b/client/ayon_core/plugins/publish/collect_from_create_context.py @@ -53,7 +53,7 @@ class CollectFromCreateContext(pyblish.api.ContextPlugin): context.data.update(create_context.context_data_to_store()) context.data["newPublishing"] = True # Update context data - asset_name = create_context.get_current_asset_name() + asset_name = create_context.get_current_folder_path() task_name = create_context.get_current_task_name() for key, value in ( ("AYON_PROJECT_NAME", project_name), diff --git a/client/ayon_core/tools/creator/window.py b/client/ayon_core/tools/creator/window.py index 7bf65ea510..bda7ebb11e 100644 --- a/client/ayon_core/tools/creator/window.py +++ b/client/ayon_core/tools/creator/window.py @@ -10,7 +10,7 @@ from ayon_core.settings import get_current_project_settings from ayon_core.tools.utils.lib import qt_app_context from ayon_core.pipeline import ( get_current_project_name, - get_current_asset_name, + get_current_folder_path, get_current_task_name, ) from ayon_core.pipeline.create import ( @@ -372,7 +372,7 @@ class CreatorWindow(QtWidgets.QDialog): self.setStyleSheet(style.load_stylesheet()) def refresh(self): - self._folder_path_input.setText(get_current_asset_name()) + self._folder_path_input.setText(get_current_folder_path()) self._creators_model.reset() diff --git a/client/ayon_core/tools/publisher/control.py b/client/ayon_core/tools/publisher/control.py index 712142f662..f6153da47f 100644 --- a/client/ayon_core/tools/publisher/control.py +++ b/client/ayon_core/tools/publisher/control.py @@ -1673,7 +1673,7 @@ class PublisherController(BasePublisherController): Union[str, None]: Folder path or None if folder is not set. """ - return self._create_context.get_current_asset_name() + return self._create_context.get_current_folder_path() @property def current_task_name(self): diff --git a/client/ayon_core/tools/utils/assets_widget.py b/client/ayon_core/tools/utils/assets_widget.py index 2ac30b1ec1..e7036ff8e8 100644 --- a/client/ayon_core/tools/utils/assets_widget.py +++ b/client/ayon_core/tools/utils/assets_widget.py @@ -521,7 +521,7 @@ class _AssetsWidget(QtWidgets.QWidget): self._last_btns_height = None - self._current_asset_name = None + self._current_folder_path = None self.model_selection = {} @@ -536,7 +536,7 @@ class _AssetsWidget(QtWidgets.QWidget): self._model.set_project_name(project_name, refresh) def set_current_asset_name(self, asset_name): - self._current_asset_name = asset_name + self._current_folder_path = asset_name def _create_source_model(self): model = _AssetModel(parent=self) @@ -560,8 +560,8 @@ class _AssetsWidget(QtWidgets.QWidget): def stop_refresh(self): self._model.stop_refresh() - def _get_current_asset_name(self): - return self._current_asset_name + def _get_current_folder_path(self): + return self._current_folder_path def _on_current_asset_click(self): """Trigger change of asset to current context asset. @@ -572,7 +572,7 @@ class _AssetsWidget(QtWidgets.QWidget): self.select_current_asset() def select_current_asset(self): - asset_name = self._get_current_asset_name() + asset_name = self._get_current_folder_path() if asset_name: self.select_asset_by_name(asset_name) diff --git a/client/ayon_core/tools/utils/host_tools.py b/client/ayon_core/tools/utils/host_tools.py index 8841a377cf..1eff746b9e 100644 --- a/client/ayon_core/tools/utils/host_tools.py +++ b/client/ayon_core/tools/utils/host_tools.py @@ -7,12 +7,9 @@ import os import pyblish.api -from ayon_core.host import IWorkfileHost, ILoadHost +from ayon_core.host import ILoadHost from ayon_core.lib import Logger -from ayon_core.pipeline import ( - registered_host, - get_current_asset_name, -) +from ayon_core.pipeline import registered_host from .lib import qt_app_context