Custom PySide2 widgets docked on Startup

Custom PySide2 widgets docked on Startup

Anonymous
Not applicable
661 Views
1 Reply
Message 1 of 2

Custom PySide2 widgets docked on Startup

Anonymous
Not applicable

I am trying to have a docked widget on Maya at startup and currently I have been unable to do it. I have been able to get a docked widget on Maya through a shelf-button and it also seemingly runs error-free on startup through kAfterOpen and kAfterNew callback. My guess is that "onSetCurrentWorkspace" on startup trashes that all custom widgets.

I used cmds.workspaceControl command, dockControl command and even inheriting the widget with MayaQWidgetDockableMixin.

Thanks!

0 Likes
662 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

Found a work-around/solution. Not sure if its the right way to do it
The solution which worked was to add a scriptJob on "SceneOpened" to launch the docked widget, although I am really surprised API callbacks like kAfterNew and kAfterOpen executed the launch code but didn't actually show the widget on startup

0 Likes