From 93ad1ad9a3b5cb19c43c0a13209202d95df7f26e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 28 Feb 2024 16:23:22 +0100 Subject: [PATCH] more folder naming --- client/ayon_core/tools/publisher/control.py | 10 +++++----- client/ayon_core/tools/publisher/control_qt.py | 9 +++------ .../publisher/widgets/create_context_widgets.py | 2 +- .../tools/publisher/widgets/create_widget.py | 14 +++++++------- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/client/ayon_core/tools/publisher/control.py b/client/ayon_core/tools/publisher/control.py index f59ffa9588..6408056c04 100644 --- a/client/ayon_core/tools/publisher/control.py +++ b/client/ayon_core/tools/publisher/control.py @@ -1062,7 +1062,7 @@ class AbstractPublisherController(object): creator_identifier, variant, task_name, - asset_name, + folder_path, instance_id=None ): """Get product name based on passed data. @@ -1072,7 +1072,7 @@ class AbstractPublisherController(object): responsible for product name creation. variant (str): Variant value from user's input. task_name (str): Name of task for which is instance created. - asset_name (str): Name of asset for which is instance created. + folder_path (str): Folder path for which is instance created. instance_id (Union[str, None]): Existing instance id when product name is updated. """ @@ -1091,7 +1091,7 @@ class AbstractPublisherController(object): creator_identifier (str): Identifier of Creator plugin. product_name (str): Calculated product name. instance_data (Dict[str, Any]): Base instance data with variant, - asset name and task name. + folder path and task name. options (Dict[str, Any]): Data from pre-create attributes. """ @@ -1667,10 +1667,10 @@ class PublisherController(BasePublisherController): @property def current_folder_path(self): - """Current context asset name defined by host. + """Current context folder path defined by host. Returns: - Union[str, None]: Asset name or None if asset is not set. + Union[str, None]: Folder path or None if folder is not set. """ return self._create_context.get_current_asset_name() diff --git a/client/ayon_core/tools/publisher/control_qt.py b/client/ayon_core/tools/publisher/control_qt.py index 46b1228dc9..ee08899cac 100644 --- a/client/ayon_core/tools/publisher/control_qt.py +++ b/client/ayon_core/tools/publisher/control_qt.py @@ -251,9 +251,6 @@ class QtRemotePublishController(BasePublisherController): pass - def get_asset_hierarchy(self): - pass - def get_existing_product_names(self, folder_path): pass @@ -299,7 +296,7 @@ class QtRemotePublishController(BasePublisherController): creator_identifier, variant, task_name, - asset_name, + folder_path, instance_id=None ): """Get product name based on passed data. @@ -309,7 +306,7 @@ class QtRemotePublishController(BasePublisherController): responsible for product name creation. variant (str): Variant value from user's input. task_name (str): Name of task for which is instance created. - asset_name (str): Name of asset for which is instance created. + folder_path (str): Folder path for which is instance created. instance_id (Union[str, None]): Existing instance id when product name is updated. """ @@ -328,7 +325,7 @@ class QtRemotePublishController(BasePublisherController): creator_identifier (str): Identifier of Creator plugin. product_name (str): Calculated product name. instance_data (Dict[str, Any]): Base instance data with variant, - asset name and task name. + folder path and task name. options (Dict[str, Any]): Data from pre-create attributes. """ diff --git a/client/ayon_core/tools/publisher/widgets/create_context_widgets.py b/client/ayon_core/tools/publisher/widgets/create_context_widgets.py index 7107f786c3..dc80f47631 100644 --- a/client/ayon_core/tools/publisher/widgets/create_context_widgets.py +++ b/client/ayon_core/tools/publisher/widgets/create_context_widgets.py @@ -211,7 +211,7 @@ class CreateContextWidget(QtWidgets.QWidget): return self._tasks_widget.get_selected_task_type() def update_current_context_btn(self): - # Hide set current asset if there is no one + # Hide set current folder if there is no one folder_path = self._controller.current_folder_path self._current_context_btn.setVisible(bool(folder_path)) diff --git a/client/ayon_core/tools/publisher/widgets/create_widget.py b/client/ayon_core/tools/publisher/widgets/create_widget.py index 728f1937d8..2e4ca34138 100644 --- a/client/ayon_core/tools/publisher/widgets/create_widget.py +++ b/client/ayon_core/tools/publisher/widgets/create_widget.py @@ -342,7 +342,7 @@ class CreateWidget(QtWidgets.QWidget): def _get_task_name(self): task_name = None if self._context_change_is_enabled(): - # Don't use selection of task if asset is not set + # Don't use selection of task if folder is not set folder_path = self._context_widget.get_selected_folder_path() if folder_path: task_name = self._context_widget.get_selected_task_name() @@ -367,7 +367,7 @@ class CreateWidget(QtWidgets.QWidget): current_folder_path = self._controller.current_folder_path current_task_name = self._controller.current_task_name - # Get context before refresh to keep selection of asset and + # Get context before refresh to keep selection of folder and # task widgets folder_path = self._get_folder_path() task_name = self._get_task_name() @@ -392,8 +392,8 @@ class CreateWidget(QtWidgets.QWidget): self._prereq_available = False - # Disable context widget so refresh of asset will use context asset - # name + # Disable context widget so refresh of folder will use context folder + # path self._set_context_enabled(False) # Refresh data before update of creators @@ -429,7 +429,7 @@ class CreateWidget(QtWidgets.QWidget): self._context_change_is_enabled() and self._get_folder_path() is None ): - # QUESTION how to handle invalid asset? + # QUESTION how to handle invalid folder? prereq_available = False creator_btn_tooltips.append("Context is not selected") @@ -451,7 +451,7 @@ class CreateWidget(QtWidgets.QWidget): def _refresh_product_name(self): folder_path = self._get_folder_path() - # Skip if asset did not change + # Skip if folder did not change if self._folder_path and self._folder_path == folder_path: return @@ -686,7 +686,7 @@ class CreateWidget(QtWidgets.QWidget): self._validate_product_name(product_name, variant_value) def _validate_product_name(self, product_name, variant_value): - # Get all products of the current asset + # Get all products of the current folder if self._product_names: existing_product_names = set(self._product_names) else: