예제 #1
0
    def __init__(self, parent=QWidget.find(rt.windows.getMAXHWND())):
        super(PyMaxDialog, self).__init__(parent)
        self.setWindowTitle('Progress')

        main_layout = QVBoxLayout()
        label = QLabel("Progress so far")
        main_layout.addWidget(label)

        # progress bar
        progb = QProgressBar()
        progb.minimum = MINRANGE
        progb.maximum = MAXRANGE
        main_layout.addWidget(progb)

        # abort button
        btn = QPushButton("abort")
        main_layout.addWidget(btn)

        self.setLayout(main_layout)
        self.resize(250, 100)

        # start the worker
        self.worker = Worker()
        self.worker.progress.connect(progb.setValue)
        self.worker.start()

        # connect abort button
        btn.clicked.connect(self.worker.abort)
예제 #2
0
def main():
    if MaxPlus:
        main_window = MaxPlus.GetQMaxMainWindow()
    else:
        main_window_widget = QWidget.find(int(runtime.windows.getMAXHWND()))
        main_window = shiboken2.wrapInstance(
            shiboken2.getCppPointer(main_window_widget)[0], QMainWindow)

    msg_box = QMessageBox(main_window)
    msg_box.setText('Hello World!')
    msg_box.show()
예제 #3
0
    def __init__(self, parent=QWidget.find(mxs.windows.getMAXHWND())):
        QDialog.__init__(self, parent)

        self.init()

        self.setWindowFlags(QtCore.Qt.WindowType.Window)
        self.resize(720, 460)
        self.setWindowTitle("AnimRef v1.3.1")

        self.defineVariables()
        self.defineSignals()
        self.defineIcons()
        self.start()

        self.setWindowIcon(self.icon)

        self.timer = QtCore.QTimer(self)
예제 #4
0
    def __init__(self, click, parent=QWidget.find(rt.windows.getMAXHWND())):
        super(PyMaxDialog, self).__init__(parent)
        self.setWindowTitle('Rename')

        main_layout = QVBoxLayout()
        label = QLabel("Enter new base name")
        main_layout.addWidget(label)

        edit = QLineEdit()
        main_layout.addWidget(edit)

        btn = QPushButton("Rename selected objects")
        btn.clicked.connect(lambda: click(edit.text()))
        main_layout.addWidget(btn)

        self.setLayout(main_layout)
        self.resize(250, 100)
예제 #5
0
    def __init__(self, parent=QWidget.find(rt.windows.getMAXHWND())):
        QMainWindow.__init__(self, parent)

        # Load UI from .ui file
        loader = QUiLoader()
        ui_file_path = os.path.join(ROOT_DIR, 'ui\\mainwindow.ui')
        ui_file = QFile(ui_file_path)
        ui_file.open(QFile.ReadOnly)
        self.ui = loader.load(ui_file, self)
        ui_file.close()
        self.setCentralWidget(self.ui)

        # Set events
        self.ui.treeView.setContextMenuPolicy(Qt.CustomContextMenu)
        self.ui.treeView.customContextMenuRequested.connect(self.openMenu)

        # Load settings
        self.settings = QSettings("MaxExtended", "BetterAssetTracker")
        self.readSettings()
예제 #6
0
    def __init__(self, parent=QWidget.find(mxs.windows.getMAXHWND())):
        QDialog.__init__(self, parent)
        self.setWindowFlags(QtCore.Qt.Tool)
        self.setWindowFlags(QtCore.Qt.Window)

        self.resize(240, 360)
        self.setWindowTitle("CAT.RootNode")
        self.mesh = None
        self.rootNode = None
        self.initUI()

        self.selectedNodes = []
        self.skinMeshes = []

        self.addNodes.clicked.connect(self.addNode)
        self.removeNodes.clicked.connect(self.clearNodesInNodeList)

        self.addbtn.clicked.connect(self.addMod)
        self.removebtn.clicked.connect(self.removeMod)

        self.recreationbtn.clicked.connect(self.recreate)
        self.skinTransfer.clicked.connect(self.startTransfer)

        self.lw_skiin.itemClicked.connect(self.changeSelection)
예제 #7
0
 def __init__(self, parent=QWidget.find(mxs.windows.getMAXHWND())):
     QDialog.__init__(self, parent)
     self.init()
     self.start()
     self.addElements()
예제 #8
0
"""
    PySide2 modeless dialog that will not be started more than once
    at the same time
"""
#pylint: disable=no-name-in-module
#pylint: disable=too-few-public-methods
from PySide2.QtWidgets import QWidget, QDialog, QVBoxLayout, QPushButton
from pymxs import runtime as rt

MAIN_WINDOW = QWidget.find(rt.windows.getMAXHWND())


class PyMaxDialog(QDialog):
    """
    Custom dialog attached to the 3ds Max main window
    """
    unique_name = __file__

    def __init__(self, parent):
        super(PyMaxDialog, self).__init__(parent)
        self.setWindowTitle('Single Instance Dialog')

        # keep track of being unique
        self.setObjectName(PyMaxDialog.unique_name)

        main_layout = QVBoxLayout()

        btn = QPushButton("Dummy Button")
        main_layout.addWidget(btn)

        self.setLayout(main_layout)
예제 #9
0
 def __init__(self, parent=QWidget.find(rt.windows.getMAXHWND())):
     super(PyMaxDialog, self).__init__(parent)
     self.setWindowTitle('Pyside2 Qt Window')
     self.init_ui()