-
Notifications
You must be signed in to change notification settings - Fork 25
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
Draft: Cherry picking changes since 0.0.1 #42
Conversation
what are the issues you have? |
In latest Master a number of things don't work at the moment :( The demo scripts are mixing Qt, PySide2 and PyQt5 imports, so it makes it hard to check what's working and what's not (plus the demo scripts needed some fixing to work in PySide2 at least). Secondly, I could not at all focus the window right now and only interact with the mouse. Also I'm still getting a number of crashes on Blender closing like so:
I think this last one requires us to switch from inheriting QApplication to creating one, but I wasn't able to test much until now. |
that sounds like the focus script is not running. is this on blender start, or when you go out of blender and back into it?
this is more worrying. could be qt, or ctypes which we use for wrapping blender window and releasing keys on refocus.
|
ok i managed to repro the EXCEPTION_ACCESS_VIOLATION, when starting blender from console. |
|
i also have the exception on the old commit from bob white 8437e06.
but likely cause i dont have win32gui still have the access violation on your branch where we dont inherit qapp |
|
shouted too early again ... |
my current theory: blender is wrapped in a qwindow. and pyside tries to delete the qwindow on closing blender in
there seems to be no way to unwrap a window once it's wrapped with qwindow.fromWInID() wonder if this could be the affected widget. from PySide2.QtWidgets import QApplication
app = QApplication.instance()
a = app._blender_window.parent()
# first time
# <PySide2.QtGui.QWindow(0x1e6a52d5120, name="QWindowContainerClassWindow") at 0x000001E6A66E7340>
# second
# Error: Python: Traceback (most recent call last):
# File "\Text", line 3, in <module>
# RuntimeError: Internal C++ object (PySide2.QtGui.QWindow) already deleted. same if you try access the children, or any other attr |
updated above code, had a small error in sample code resulting in the error not being thrown |
when running above code twice in the blender script editor, the ACCESS VIOLATION dissapears on exit 🤔 however running this code twice in any scripts, e.g. in on_exit doesn't fix the ACCESS VIOLATION. 😖 this does seem to prove it's related to garbage collection stuff from either pyside or python |
ok think i found the issue. QApplication is instanced, and a reference is saved in a variable in the QOperator. when closing blender, operators likely get deregistered, which means the reference to QApplication is gone, and QApplication gets garbage collected. since the operator owns qapp, qapp owns blender, and blender owns the operator. we have a loop. moving the qapp to a global variable instead of the operator seems to fix the access violation error :D |
Ah see! I didn't look into the PRs yet :D just the issues and found #47 How is this going forward? Would you want a fork for PySide6 or wrap it so it handles 2 and 6 simultaneously? There aren't so many calls so this should be slim and would not require some beast like qtpy. |
both of them live in main at same time would be ideal. aim to stay on the vfx platform version which is not yet pyside6. But personally i d prefer pyside6 i think. |
save dialogue is implemented in PR #56 |
I'm running into some issues with current Master, so I've started a new branch and manually made some changes back to how they were on 0.0.1.
This is currently just for myself to compare what changes have come in and what's working and what's not working.