Closed jasperges closed 4 years ago
Nice one @jasperges !
because it's part of my Blender integration
What is your Blender integration? Is Avalon missing something, or are you talking about your Avalon config?
What is your Blender integration? Is Avalon missing something, or are you talking about your Avalon config?
I'm adding Blender 2.80 as a supported host to Avalon.
Ahh, I see. This PR is part of a future bigger PR.
Yes, this is in preperation of that one. But I felt a seperate PR is in place here, because apart from giving problems with Blender it also is not consistent with the other tools. But I also wouldn't mind to incorporate it into the the 'blender PR'.
Nice and consistent, thanks!
@jasperges Could this have been fixed by explicitly setting the parent on those widgets to self
so it automatically keeps a reference to it? I'm working on the Work Files tool and merging it with Context Manager. I'll try and do the 'parent' widget correctly and see if that helps. Then you can see if it crashes on you, if so we can always revert.
@BigRoy I have no idea... Let's find out! :nerd_face:
For this I didn't make an issue, because it seems easier to discuss the changes when looking at the code itself. Questions, concerns or suggestions are more then welcome!
There are basically 2 things needed to make it work:
module.window
is now used. This also has the advantage of making it consistent with the other tools which do this already.exec_()
for the main window, because this blocks Blender and creates conflicts between the Qt event loop and Blender event loop (if I'm not mistaken). Instead justshow()
the window and keep it responsive by triggeringprocessEvents()
all the time from within Blender. This last part is not shown here, because it's part of my Blender integration. This also makes it consistent with the other tools which also just runshow()
. For themessagebox
andname_window
it seems fine to runexec_()
, they are not working if you runshow()
. To be honest I'm not completely sure why.I hope this doesn't cause any problems with other DCC's, but I suspect it's fine because the other tools also do this.