OpenPype
OpenPype copied to clipboard
Publisher: Prepare publisher controller for remote publishing
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:
- Publisher functionality should not change at all in current implementations
PR is based on branch from this PR.
Task linked: OP-4194 Remote publisher controller
Task linked: OP-4158 Creation UI is part of main window
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.
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'
Houdini 19.5 with python 3.9:
Should work now. I swapped arguments.
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'
Good catch. Should be fixed.
this is still looking like some bug.
Yep, fixed.
pure awesomeness