3 Demonstrates how to create a QWidget with PySide2 and attach it to the 3dsmax main window.
6 from PySide2
import QtCore
7 from PySide2
import QtWidgets
12 cyl = pymxs.runtime.Cylinder(radius=10, height=30)
13 pymxs.runtime.redrawViews()
16 class PyMaxDialog(QtWidgets.QDialog):
17 def __init__(self, parent=MaxPlus.GetQMaxMainWindow()):
18 super(PyMaxDialog, self).__init__(parent)
19 self.setWindowTitle(
'Pyside Qt Window')
23 main_layout = QtWidgets.QVBoxLayout()
24 label = QtWidgets.QLabel(
"Click button to create a cylinder in the scene")
25 main_layout.addWidget(label)
27 cylinder_btn = QtWidgets.QPushButton(
"Cylinder")
28 cylinder_btn.clicked.connect(make_cylinder)
29 main_layout.addWidget(cylinder_btn)
31 self.setLayout(main_layout)
41 if __name__ ==
'__main__':