2016 Extension address PySide window non-parenting issue?

2016 Extension address PySide window non-parenting issue?

robotProdigy
Advocate Advocate
1,504 Views
3 Replies
Message 1 of 4

2016 Extension address PySide window non-parenting issue?

robotProdigy
Advocate
Advocate

According to Autodesk's 3ds Max 2016 Extension 1 notes, it lists a Python API fix "Parenting widget to 3dsmax window" (MAXX-15268), and does not provide further details. 

 

Is this a fix to the problem of not being able to parent a PySide window to the main Max window?

 

Because that would be huge.

 

-Paul

0 Likes
Accepted solutions (1)
1,505 Views
3 Replies
Replies (3)
Message 2 of 4

denis_grigor
Autodesk Support
Autodesk Support


Hi Paul,

The Python API fix "Parenting widget to 3dsmax window" (MAXX-15268) is addressing the issue of creating a PySide window and keeping it always on top of the 3dsMax window, as the MAXScipt Listener window does.
The problem is that this fix is indeed not yet reflected in the documentation, however the related sample files (located at 3DSMAX_INSTALLATION_FOLDER\scripts\Python\) were updated.
The issue in question is shown to be fixed within demoPySideQWidget.py file located in that folder, where the most import method is

 

34  # Attaches the QWidget to the 3dsmax mainwindow
35  MaxPlus.AttachQWidgetToMax( w )

and as I mentioned, the documentation is not yet reflecting the changes, yet within MaxPlus.py we can see it prepared:

# Attaches a given parentless QWidget by its Qt winId to the win32 3ds max main window. 
def AttachQWidgetToMax( qwidget, isModelessDlg=True ):
    ''' Attaches a given parentless QWidget by its Qt winId to the win32 3ds max main window. 
    This is internally done by creating an in-between QWinWidget, which will be child 
    of the 3d max window, and a parenting of the QWidget to the QWinWidget. 
    For the given QWidget the 3ds max keyboards accelerators will be disabled when 
    the widget gets the focus.
    By setting isModelessDlg to true, 3ds max will properly disable/enable the QWidget 
    when another modal 3ds max dialog pops up. '''

I hope this is the behavior you've been expecting.

Cheers,


Denis GRIGOR
Developer Technical Services
Autodesk Developer Network



Message 3 of 4

robotProdigy
Advocate
Advocate
Accepted solution

YES!!! That's it!

 

Just tried it with one of my PySide Windows, and it stays on top of the Max UI even when losing focus.

 

Thank you.

0 Likes
Message 4 of 4

Anonymous
Not applicable

While this may parent the window, it does not minimize when the main window does. Its a small issue I suppose, but is annoying. We have not moved onto 2017 yet as we found it to be buggy. Hoping that Max 2018 is an improvement over the last release.

 

I cant believe that Autodesk went with PySide and not PyQt4 when most apps use PyQt, including Maya.

0 Likes