OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

Publisher: Prepare publisher controller for remote publishing

Open iLLiCiTiT opened this issue 3 years ago • 3 comments

Brief description

Preparation for remote publisher UI. Controller was modified to not be Qt based and the import of base Publisher controller does not require available Qt binding in python/sys path.

Description

Main change is that UI does not have ability to work with logic related objects directly (e.g. with creators, publish plugin or their actions). For that purposes were created warpper classes that hold just information and reference to real objects. They can be serialized and deserialized so they can be passed across processes. Attribute definitions have required attribute type and can be serialized/deserialized too. CreatedInstance has prepared few helper functions to recreate data and pass their changes to origin object. Creators are wrapped into CreatorItem which contain all information needed for UI and to trigger it's logic. All triggered events in controller must contain only json serializable data which simplified some logic. Attribute changes that were "dynamic" now have explicit setters which trigger event about the value change which helps to send that information from client controller to remote controller.

All of that is based on object idenfitiers as strings. For instances is used instance id for creators it's their identifier for actions on publish plugins it's their ids. Asset document ids are for UI purposes also converted to string.

Idea is that one controller is running in client (DCC) and second controller in different UI process. There must be 2-way communication between them so controller in client can send data to process where UI is running and UI can trigger callbacks on client side.

Additional info

Remote controller is not tested and will probably require some tweaks and changes based on first feedback (probably in Unreal). This is preparation PR to make the feature available the default behavior should still work the same way as before.

Testing notes:

  1. Publisher functionality should not change at all in current implementations
  • [ ] TrayPublisher
  • [ ] Houdini (PR)
  • [ ] Fusion (PR)

PR is based on branch from this PR.

iLLiCiTiT avatar Oct 12 '22 12:10 iLLiCiTiT

Task linked: OP-4194 Remote publisher controller

ynbot avatar Oct 12 '22 12:10 ynbot

I was testing it on TrayPublisher Editorial Simple edit data. It is normally going throughout without any hiccups, even here it went alreight, except the Validation issue notification

Not sure what's wrong actually?

EDITED: Found it out. The validation error appeared even if there was none. Fixed.

iLLiCiTiT avatar Oct 14 '22 07:10 iLLiCiTiT

Houdini 19.5 with python 3.9:

Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\utils\host_tools.py", line 450, in show_publisher
    _SingletonPoint.show_tool_by_name("publisher", parent)
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\utils\host_tools.py", line 396, in show_tool_by_name
    cls.helper.show_tool_by_name(tool_name, parent, *args, **kwargs)
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\utils\host_tools.py", line 368, in show_tool_by_name
    self.show_publisher_tool(parent, *args, **kwargs)
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\utils\host_tools.py", line 290, in show_publisher_tool
    dialog = self.get_publisher_tool(controller, parent)
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\utils\host_tools.py", line 281, in get_publisher_tool
    publisher_window = PublisherWindow(
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\window.py", line 67, in __init__
    help_dialog = HelpDialog(controller, self)
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\widgets\help_widget.py", line 65, in __init__
    controller.event_system.add_callback(
AttributeError: 'PySide2.QtWidgets.QWidget' object has no attribute 'event_system'

antirotor avatar Oct 17 '22 15:10 antirotor

Houdini 19.5 with python 3.9:

Should work now. I swapped arguments.

iLLiCiTiT avatar Oct 17 '22 15:10 iLLiCiTiT

another one:

Traceback (most recent call last):
  File "C:\Users\annat\Documents\pype\3.0\openpype\lib\events.py", line 161, in process_event
    callback()
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\widgets\create_widget.py", line 538, in _on_plugins_refresh
    self.refresh()
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\widgets\create_widget.py", line 406, in refresh
    asset_name = self._get_asset_name()
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\widgets\create_widget.py", line 380, in _get_asset_name
    asset_name = self.current_asset_name
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\widgets\create_widget.py", line 365, in current_asset_name
    return self._controller.current_asset_name
  File "C:\Users\annat\Documents\pype\3.0\openpype\tools\publisher\control.py", line 1579, in current_asset_name
    if not hasattr(self.host, "get_current_context"):
AttributeError: 'QtPublisherController' object has no attribute 'host'

antirotor avatar Oct 17 '22 15:10 antirotor

Good catch. Should be fixed.

iLLiCiTiT avatar Oct 17 '22 15:10 iLLiCiTiT

this is still looking like some bug.

Yep, fixed.

iLLiCiTiT avatar Oct 17 '22 22:10 iLLiCiTiT

pure awesomeness

jakubjezek001 avatar Oct 19 '22 10:10 jakubjezek001