Windows wont stay on top in Motionbuilder

Hey There

I’ve got a custom multi app that currently works in Motionbuilder and Maya. When the app is opened in Maya the window focus works as I’d expect. I can click something else in the UI and my window will remain on top.

However in Motionbuilder when I click something else in the UI my window goes to the back. This is really annoying for my users too as they keep loosing the UI’s.

Similar behavior seems to happen on the default file open and file save apps from SG.

I’ve tried setting self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) in the Dialog portion of my custom tool but doesn’t seem to have any affect.

Since SG wraps around QT I dont think setting the flags self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) works as expected.

Have a look into SG’s window modality options:
https://developer.shotgridsoftware.com/tk-core/platform.html#engines

Otherwise there was another topic where someone added minimize/maximize buttons to the tk-core dialog wrapper.

Your flags may work there:

1 Like

Heya, really sorry for such a late response here. Got pulled off onto other things and only touching this again now.

Your recommendation on Modality options did the trick.

I am now using this:

app_instance.engine.show_modal("App Name", app_instance, MyDialog)

works as expected for both Motionbuilder and Maya. This would not be a perfect solve if the tool needed to be used while the user interacts with the main window but works a treat for my current purposes.

Cheers!

1 Like