feature/OP-7692_Folder_Batch_publishing_tool

This commit is contained in:
Braden Jennings 2024-03-07 16:27:53 +13:00
parent 24a1a15497
commit ebfb5eef5b
5 changed files with 25 additions and 26 deletions

View file

@ -52,13 +52,13 @@ class BatchPublishAddon(AYONAddon, IHostAddon, ITrayAction):
import ayon_core.hosts.batchpublisher.ui.batch_publisher_view
import ayon_core.hosts.batchpublisher.ui.window
# # TODO: These lines are only for testing current branch
# reload(ayon_core.hosts.batchpublisher.controller)
# reload(ayon_core.hosts.batchpublisher.ui.batch_publisher_model)
# reload(
# ayon_core.hosts.batchpublisher.ui.batch_publisher_delegate)
# reload(ayon_core.hosts.batchpublisher.ui.batch_publisher_view)
# reload(ayon_core.hosts.batchpublisher.ui.window)
# TODO: These lines are only for testing current branch
reload(ayon_core.hosts.batchpublisher.controller)
reload(ayon_core.hosts.batchpublisher.ui.batch_publisher_model)
reload(
ayon_core.hosts.batchpublisher.ui.batch_publisher_delegate)
reload(ayon_core.hosts.batchpublisher.ui.batch_publisher_view)
reload(ayon_core.hosts.batchpublisher.ui.window)
# from ayon_core.hosts.batchpublisher.ui.window \
# import BatchPublisherWindow

View file

@ -30,7 +30,8 @@ def publish_version_pyblish(
frame_start=None,
frame_end=None):
os.environ['AVALON_PROJECT'] = project_name
# os.environ["AVALON_PROJECT"] = project_name
os.environ["AYON_PROJECT_NAME"] = project_name
representation_name = list(expected_representations.keys())[0]
file_path = list(expected_representations.values())[0]
@ -56,10 +57,11 @@ def publish_version_pyblish(
family=family_name)
instance.data.update(
{
"family": family_name,
# "project": project_name,
"productType": family_name,
"asset": asset_name,
"task": task_name,
"subset": subset_name,
"productName": subset_name,
"publish": True,
"active": True,
# "source": file_path,

View file

@ -23,7 +23,8 @@ class BatchPublisherTableDelegate(QtWidgets.QStyledItemDelegate):
# NOTE: Project name has been disabled to change from this dialog
accepted, _project_name, folder_path, task_name = \
self._on_choose_context(ingest_file.folder_path)
if accepted and folder_path:
# if accepted and folder_path:
if folder_path:
for _index in view.selectedIndexes():
model.setData(
model.index(_index.row(), model.COLUMN_OF_FOLDER),
@ -161,19 +162,16 @@ class BatchPublisherTableDelegate(QtWidgets.QStyledItemDelegate):
dialog.set_context(
project_name=project_name)
accepted = dialog.exec_()
if accepted:
context = dialog.get_context()
project = context["project"]
asset = context["asset"]
# AYON version of dialog stores the folder path
folder_path = context.get("folder_path")
if folder_path:
# Folder path returned by ContextDialog is missing slash
folder_path = "/" + folder_path
folder_path = folder_path or asset
task_name = context["task"]
return accepted, project, folder_path, task_name
return accepted, None, None, None
# if accepted:
context = dialog.get_context()
project = context["project"]
asset = context["asset"]
# AYON version of dialog stores the folder path
folder_path = context.get("folder_path")
folder_path = folder_path or asset
task_name = context["task"]
return accepted, project, folder_path, task_name
# return accepted, None, None, None
class ComboBox(QtWidgets.QComboBox):

View file

@ -1,6 +1,6 @@
from qtpy import QtCore, QtGui
from openpype.plugins.publish import integrate
from ayon_core.plugins.publish import integrate
class BatchPublisherModel(QtCore.QAbstractTableModel):

View file

@ -43,7 +43,6 @@ class BatchPublisherTableView(QtWidgets.QTableView):
self._controller = controller
def set_current_directory(self, directory):
print("view set_current_directory", directory)
self._model.set_current_directory(directory)
def get_product_items(self):