shotgunsoftware / tk-multi-breakdown2

A Flow Production Tracking Pipeline Toolkit app that helps you see what is out of date in your scene across multiple projects.
https://developer.shotgridsoftware.com/tk-multi-breakdown2/
Other
4 stars 10 forks source link

showEvent bug? #61

Closed ImranR99 closed 10 months ago

ImranR99 commented 10 months ago

Hello

Raising as a possible issue but it seems the breakdown tool undergoes the showEvent/_refresh action under certain conditions, in which I think this may be called unknowingly outside of "scene changes". I'll list out scenarios below that cause the tool to reinitialise/refresh itself:

1) With a Maya scene and the breakdown tool open, minimize Maya and go back to it. You'll see the tool setting itself up again. 2) On Linux, have the scene and tool open, switch to another Workspace then switch back to the original Workspace. You'll see the same as above.

I've tried to dig around the code by preventing the refresh action in the Qt override showEvent function, but this hits an issue with the tool displaying "No items found" which can be found in _on_file_model_reset_end in dialog.py.

I've also yet to try and replicate this on other DCCs but thought it may be worth logging here for further information.

Thanks

ImranR99 commented 10 months ago

Hello

Just coming back to this to provide a further update as I've done additional testing. It seems this is happening in the Qt overrride function hideEvent which clears the UI and upon showEvent the UI is refreshed. Wondering what the reason is for this?

There should be more control over this and we should avoid having to refresh constantly if people are working between multiple DCCs (or DCC sessions). It's very time reliant as its preferable to avoid having to rebuild the UI if one is constantly invoking the "Show/Hide" events.

Do let me know your thoughts on this.

Thanks

staceyoue commented 10 months ago

@ImranR99 the refresh on showEvent was introduced mainly for the app when running in Panel mode. Panels are not destroyed on close, so the app will continue to run in the background. We prevent the "closed" app from refreshing the model, so then we need to refresh once we show the app again.

I see what you mean though, there are cases where the Qt showEvent fires and causes some unnecessary refreshes, which can slow down the app. I created a branch with a fix for this, to only refresh the app if a change has occurred while the app was "closed".

ImranR99 commented 10 months ago

@staceyoue Thanks for the response. I was going to create a Pull Request but wanted to ensure things were working fine on our end before doing so as the changes I made reflect what you've done on the branch, apart from the event.spontaneous method. Glad to know something like that exists