Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Under Blender 4.3, getting an error with orphan_widgets #125

Open
FranckyB opened this issue Dec 10, 2024 · 5 comments
Open

Under Blender 4.3, getting an error with orphan_widgets #125

FranckyB opened this issue Dec 10, 2024 · 5 comments

Comments

@FranckyB
Copy link

Under Blender 4.2, our Pipeline Widget seems to work without error, but under Blender 4.3, the same Widget causes error.

The error is:

Traceback (most recent call last):
File "\fs01\env\packages\blender\base_config\addons\bqt\blender_applications\blender_application.py", line 83, in on_update
bqt.manager.parent_orphan_widgets(exclude=[self.blender_widget, self._blender_window, self.window_container]) # auto parent any orphaned widgets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\fs01\env\packages\blender\base_config\addons\bqt\manager.py", line 181, in parent_orphan_widgets
for widget in _orphan_toplevel_widgets():
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\fs01\env\packages\blender\base_config\addons\bqt\manager.py", line 170, in _orphan_toplevel_widgets
return [widget for widget in QApplication.instance().topLevelWidgets() if
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\fs01\env\packages\blender\base_config\addons\bqt\manager.py", line 171, in
not widget.parent()
^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

@hannesdelbeke
Copy link
Collaborator

i can only assume QApplication.instance().topLevelWidgets returns None for some reason, instead of the widget.
that's odd.

can you share the version of pyside you are using?

a workaround could be to disable autoparenting for now , see https://github.com/techartorg/bqt/wiki/Environment-variables

@FranckyB
Copy link
Author

We are using pyside 2.
The environment Variable did the trick!
Would this prevent some functionality with this off?

Thanks

@hannesdelbeke
Copy link
Collaborator

yes since widgets are not parented, they will stay visible when you minimise blender.
and you now can alt tab to them as if they are another app.

to prevent that, you could manually parent them to the blender window.
i d have to dig in the code since it's not in the wiki.
you can check out the parent function. i think the top level widget is saved in our QApplication as a variable if i remember correctly

@hannesdelbeke
Copy link
Collaborator

hannesdelbeke commented Dec 10, 2024

i v been using pyside 6 for development recently, might be worth seeing if that would resolve it.
since max and maya are also finally moving away from pyside 2
( a recent version of pyside6 had it's own issues but that's patched now)

@FranckyB
Copy link
Author

We had planned to use Maya 2024, as we had issues with 2025.
Trying just now to use Pyside6, I realize switching versions would also mean fixing a bunch of things in the code, as there are a bunch of small differences in PySide6.

For now, I'll turn off Auto Parenting and fix our pipeline to be pyside6 compatible eventually 😅
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants