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

General: Update MacOs to PySide6 #4255

Merged
merged 45 commits into from
Jan 17, 2023

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Dec 21, 2022

Brief description

Update PySide2 to PySide6 for MacOs and change all remaining imports of Qt.py module to qtpy. This change is needed for new MacOs distribution.

Description

PR is combining change of Qt.py import with qtpy so all changes in this PR are affecting all hosts and it doesn't make sense to have it separated into multiple small PRs as most of them are connected to each other. Imports were changed in tools, utils widgets, launch script of non-python hosts, some vendor modules (qargparse and scriptsmenu) and global loader plugins. Added QtPy module to Python 2 vendor in latest available version that support PySide and PyQt4.

PySide6 changed few things here and there. E.g. how it is accessed to class methods (objects don't have access to class attributes) or renamed few methods. Some constants were removed and few classes were removed completelly.

We must make sure that all Qt tools in igniter are 100% right. Other possible bugs can be fixed later. Report any issue you will hit (make sure the issue was not already reported).

Checkstate constants are not integers anymore so output of CheckStateRole or stateChanged of checkbox can't be compared to Checked, Unchecked and PartiallyChecked without convertion to enum values first (big issue for backwards compatibility).

Issue with qtpy is that it always set os.environ["QT_API"] to best matching value. That causes issue if the value is set to "pyside6" because in that case older versions are not set. Currently was fixed for applications launch but it can cause more issues in future.

TODOs

  • try if PySide6 can be used on linux and MacOs

Known issues

  • Loader does not show subsets -> Checkstate issue
  • Settings UI stuck process -> Fix would be to "rewrite" settings, since the PR is affecting MacOs and Ayon switch will happen soon we're ignoring this bug
  • Views have different background color of branch (probably stylesheets related) -> We'll have to revisit stylesheets in separated PR (there are reported other style issues)

Testing notes:

All tools running in OpenPype process are potentially broken now and in most of cases the broken part is not recognized until someone hit exactly specific usecase. Because of QtPy module update and using it instead of Qt.py functionality in hosts should be checked too. The main focus is on tools running in OpenPype processes on MacOS.

It is required to install proper python and on MacOS also run fetch_thirdpart_libraries to install PySide6.

Any possible UI tool executed from OpenPype tray

This consist of all tools from modules and in base of openpype.

  • LibraryLoader
  • Launcher
  • Local settings
  • Settings
  • ... others

Loader actions

  • Copy filepath works
  • Copy file works
  • Delivery action works
  • Delete old version

Hosts

In each host must be tested all of these (if the functionality is available there).

  • Workfiles tool

    • shows work files
    • shows published files
    • Save as dialog works
    • Browse dialog works
  • Loader tool

    • shows hierarchy, subsets, versions and representations
    • actions can be executed
    • actions with options will show dialog to confirm
    • links are shown
  • Creator

    • creators are available
    • creation works
  • Publisher

    • creators are available
    • attribute definitions are avialable
    • UI is updating as expected
  • Publish Pype (pyblish-lite based)

    • plugins are shown
    • instances are shown
    • pages can be changed
    • details and terminal is available
  • Subset manager

    • instances are visible
    • can be modified/removed
  • Scriptsmenu

    • Menu is visible

Hosts

  • Maya
    • 2020
    • 2022
    • 2023
  • Nuke
    • 12.*
    • 13.*
    • 14.*
  • Hiero
    • 12.*
    • 13.*
    • 14.*
  • Houdini
    • with py 2
    • with py 3
    • Shelves can be added (not sure if it was possible)
  • Photoshop
  • AfterEffects
  • Harmony
  • Resolve
  • Fusion
  • Unreal
  • Blender
  • TVPaint
  • Flame
  • Celaction
  • 3ds Max

Write a comment if I forgot about some cases.

@ynbot
Copy link
Contributor

ynbot commented Dec 21, 2022

Task linked: OP-4634 Use qtpy in tools

@iLLiCiTiT iLLiCiTiT changed the title General: Update to PySide6 General: Update MacOs to PySide6 Jan 9, 2023
@iLLiCiTiT iLLiCiTiT marked this pull request as ready for review January 9, 2023 12:42
@kalisp
Copy link
Member

kalisp commented Jan 10, 2023

In Nuke 13 Library doesn't fetch any subsets, even if Load... does. Same in Maya.

Error between chair and keyboard.

@kalisp
Copy link
Member

kalisp commented Jan 13, 2023

On Mac (M1) some tools are failing:
Creator with qtpy.QtGui has no attribute 'QRegExpValidator'
2023-01-13 18_12_17-516615434 - AnyDesk

SceneInventory with SceneInventoryView has no attribute ExtendedSelection
2023-01-13 18_12_59-516615434 - AnyDesk

Pyblish on PluginType = QtGui.QStandardItem.UserType + 1
2023-01-13 18_13_19-516615434 - AnyDesk

@64qam
Copy link
Member

64qam commented Jan 14, 2023

Nuke 12 fails at startup with error
image

    assert API in (PYQT5_API + PYQT4_API + PYSIDE_API + PYSIDE2_API)
AssertionError```

@64qam
Copy link
Member

64qam commented Jan 16, 2023

In Harmony Manager it doesn't show version when the version is changed.

  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/utils/delegates.py", line 57, in paint
    style.CE_ItemViewItem, option, painter, option.widget
AttributeError: 'PySide6.QtWidgets.QCommonStyle' object has no attribute 'CE_ItemViewItem'
Traceback (most recent call last):
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/utils/delegates.py", line 57, in paint
    style.CE_ItemViewItem, option, painter, option.widget
AttributeError: 'PySide6.QtWidgets.QCommonStyle' object has no attribute 'CE_ItemViewItem'
Traceback (most recent call last):
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/utils/delegates.py", line 57, in paint
    style.CE_ItemViewItem, option, painter, option.widget
AttributeError: 'PySide6.QtWidgets.QCommonStyle' object has no attribute 'CE_ItemViewItem'
Traceback (most recent call last):
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/utils/delegates.py", line 57, in paint
    style.CE_ItemViewItem, option, painter, option.widget
AttributeError: 'PySide6.QtWidgets.QCommonStyle' object has no attribute 'CE_ItemViewItem'
  - { WrappedCallbackItem }: [  Running callback: <function HostListener.websocket_handler.<locals>.<lambda> at 0x148399d30>  ] 

@64qam
Copy link
Member

64qam commented Jan 17, 2023

In Scene Inventory, Switch Asset still doesn't work:

  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/view.py", line 293, in <lambda>
    lambda: self._show_switch_dialog(items))
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/view.py", line 752, in _show_switch_dialog
    dialog = SwitchAssetDialog(self, items)
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/switch_dialog.py", line 63, in __init__
    assets_combox = SearchComboBox(self)
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/widgets.py", line 45, in __init__
    self.setInsertPolicy(self.NoInsert)
AttributeError: 'SearchComboBox' object has no attribute 'NoInsert'
  - { WrappedCallbackItem }: [  Running callback: <function HostListener.websocket_handler.<locals>.<lambda> at 0x12e9139d0>  ] ```

@64qam
Copy link
Member

64qam commented Jan 17, 2023

In Harmony Scene Inventory there is also an issue with Update to latest template which errors:

  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/view.py", line 246, in <lambda>
    lambda: _on_update_to_latest(items)
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/tools/sceneinventory/view.py", line 230, in _on_update_to_latest
    update_container(item, -1)
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/pipeline/load/utils.py", line 477, in update_container
    return loader.update(container, new_representation)
  File "/Applications/OpenPype 3.14.10.app/Contents/MacOS/openpype/pipeline/load/plugins.py", line 112, in update
    raise NotImplementedError("Loader.update() must be "
NotImplementedError: Loader.update() must be implemented by subclass
  - { WrappedCallbackItem }: [  Running callback: <function HostListener.websocket_handler.<locals>.<lambda> at 0x12e9139d0>  ] ```

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented Jan 17, 2023

In Scene Inventory, Switch Asset still doesn't work:

Fixed

In Harmony Scene Inventory there is also an issue with Update to latest template which errors:

This is issue of the harmony loader (I can't do much about it).

with manager.counter(
color='green',
total=content_len and math.ceil(content_len / 2 ** 20),
unit='MiB', leave=False) as counter:
Copy link

Choose a reason for hiding this comment

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

continuation line with same indent as next logical line

@iLLiCiTiT iLLiCiTiT merged commit 37a4ec6 into release/3.15.x Jan 17, 2023
@iLLiCiTiT iLLiCiTiT deleted the feature/OP-4634_Use-qtpy-in-tools branch January 17, 2023 14:53
@github-actions github-actions bot added this to the next-minor milestone Jan 17, 2023
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.

5 participants