Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Publisher: Prepare publisher controller for remote publishing #3972

Merged
merged 90 commits into from
Oct 19, 2022

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Oct 12, 2022

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.

…o feature/OP-4194_Remote-publisher-controller
@antirotor
Copy link
Member

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'

@iLLiCiTiT
Copy link
Member Author

Houdini 19.5 with python 3.9:

Should work now. I swapped arguments.

@antirotor
Copy link
Member

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'

@iLLiCiTiT
Copy link
Member Author

Good catch. Should be fixed.

Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still looking like some bug. The editorial publishing had finished at 100% and the bottom bar is green like it was successful publish but as the image is showing It says the publishe was paused and I have to hit Publish button to continue

image

Notice the log is showing that all plugins were completed.

When I hit Publish as it was suggested to me, then this happen:

Traceback (most recent call last):
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\publisher\widgets\publish_frame.py", line 513, in _on_publish_clicked
    self._controller.publish()
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\publisher\control.py", line 1928, in publish
    self._start_publish()
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\publisher\control.py", line 1949, in _start_publish
    self._publish_next_process()
  File "C:\CODE\__PYPE\OpenPype\openpype\tools\publisher\control.py", line 1993, in _publish_next_process
    item = next(self._main_thread_iter)
StopIteration

@iLLiCiTiT
Copy link
Member Author

this is still looking like some bug.

Yep, fixed.

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no additional problems in Houdini

@jakubjezek001
Copy link
Member

pure awesomeness

@iLLiCiTiT iLLiCiTiT merged commit 1faa672 into develop Oct 19, 2022
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-4194_Remote-publisher-controller branch October 19, 2022 10:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants