I’ve created a tool in python for 3dsMax and created the UI in Qt Designer. The tool class is defined as you would in Maya, by loading the UI file and extracting the form, and base classes.
When I open the tool in 3dsMax, it works, however the 3dsMax viewport selections do not refresh. The white highlight doesn’t appear or disappear regardless of whether I select or deselect. Furthermore transformations are doubling values. For instance translating an object will send it shooting beyond the location of the cursor…
Someone from the forums was kind enough to put together a decorator function to protect from GC a python script. Unfortunately this didn’t resolve the issue, so I went ahead and made a few tests.
First I ran this code:
class TestTool(QtGui.Widget):
pass
testTool = TestTool()
testTool.show()
The issue persisted. So then I added the decorator function…
@MaxWindow
class TestTool(QtGui.Widget):
pass
testTool = TestTool()
testTool.show()
Lo’ and behold everything works as intended. I then decided to take it a step further and initialize the superclass.
@MaxWindow
class TestTool(QtGui.Widget):
def __init__(self):
super(TestTool, self).__init__()
testTool = TestTool()
testTool.show()
Back to square one, the viewports don’t refresh, etc…
Does anyone know how I can bring in a QMainWindow I designed in Qt Designer into 3dsMax without causing these kind of issues?