-
Notifications
You must be signed in to change notification settings - Fork 49
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
Parenting tools #472
Parenting tools #472
Conversation
Or the app window will be frameless after parented to host's main window
Some tools' style sheet gets override after parenting under Houdini, set style after window shown fixed this.
@@ -42,6 +42,7 @@ def __init__(self, parent=None): | |||
task_view.setIndentation(0) | |||
task_model = TasksModel() | |||
task_view.setModel(task_model) | |||
task_view_selection = task_view.selectionModel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By keeping the QItemSelectionModel
object before connecting signal, avoids the Segmentation fault
crash in Houdini which described above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff!
Code looks good, but cant test.
Thanks @tokejepsen ❤️ Also, I don’t have fusion here, so the tools still unparented in fusion. |
There's no Qt in Fusion so I think that will have to remain as is unfortunately.
Very nice! I wonder how I missed doing this at the time. Anyway, nice work! Houdini avalon tools font differenceI did notice the styling felt a bit off as it seems to be using the Houdini font as opposed or something? For example: I wonder if there's a way to patch that up too. Houdini Work files errorThe Work files tool however pops up this error on opening:
Additionally it seems that the Work Files tool does not have the Avalon styling whatsoever. Or does it look so different solely due to the font being so different? Also I did recall this comment in Shotgun's toolkit regarding styling Qt widgets inside houdini which calls the method here. Maybe we should try and just apply the stylesheet globally in Houdini? Sounds a bit hacky though. |
Or `RuntimeError: Internal C++ object (PySide2.QtWidgets.QListWidgetItem) already deleted.` will raised and hangs Houdini.
Haha, and it says here.. So hacky indeed ! Anyway, I finally resolved the font size and Here's the before and after:beforeNotice that the splitter in Loader is a thick gray line even mouse is not hover on top of them. after🎉 Furthermore, I also moved the line |
This reverts commit 1b2e9ad.
Keeping main window instance in Avalon session to avoid child widgets being garbage collected before entering the deferred scope.
Remove duplicated main window getting code
Originally, this issue was fixed in 1b2e9ad, but after a few more search, I find that keeping the Houdini's main window instance in a place which can have a longer lifespan is a better solution, which fixes in a higher scope (based on this post). So I revert the previous commit and add 5907a80. Note that the And for removing duplicated main window getting logic plus having same function for each host, I also add |
Just noticed as well that the Loader is not parent to the Maya window. |
@tokejepsen, really !? Loader did get parented in Maya here in my end. 😲 |
Ok, I'm not on the latest core, so it could just be something with my fork. Nvm :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it again, and now the tools open fine on Houdini without errors and they are nicely parented. The Avalon stylesheet still doesn't apply perfectly, it still seems to inherit quite a bit from the Houdini styling.
However it seems the styling of Houdini itself might change in the near future that might automatically resolve it. Maybe it's best to leave it as is since it isn't a big issue and then maybe with an upcoming Houdini version less of the Houdini styling pushes through in the Avalon tools.
Nice work @davidlatwe ! 🚀
Will merge this tomorrow if no other objections :) |
I've scanned through the code and couldn't find anything I didn't like. Nice work. :) |
Problem
Avalon tools like Loader, Creator, Scene Manager, Context Manager, Workfile were not parented in Houdini and Nuke's main window.
And the Workfile app's
show()
wasn't acceptparent
arg at all.Changes
parent
flag toavalon.tools.workfiles.show()
While I was working on Houdini, I encountered two problems:
Segmentation fault
fatal error.On problem 1, the Loader has become:
See Image
And the Context Manager:
See Image
Which looks cool but I love Avalon flavor more.
Interestingly, Creator and Scene Manager did not have this issue, not sure why :(
See Image
On problem 2, it was because of directly connecting
QtWidgets.QTreeView.selectionModel()
to the handler, and leads to aSegmentation fault
error and crash Houdini.The only useful info I could find was this tweet.