Exemplo n.º 1
0
 def _expandClicked(self):
     self._expanded = not self._expanded
     self.parameterTabWidget.setVisible(self._expanded)
     if self._expanded:
         self.expandButton.setIcon(resource.get_qicon('btn', 'arrow1_down.png'))
     else:
         self.expandButton.setIcon(resource.get_qicon('btn', 'arrow1_right.png'))
Exemplo n.º 2
0
 def _liveUpdateModeChanged(self, value):
     if value:
         self.setIcon(resource.get_qicon('btn', 'live_update.png'))
         self.setToolTip('Live Update')
         self.liveUpdateAction.setText('Disable Live Update')
     else:
         self.setIcon(resource.get_qicon('btn', 'arrow_up2_white.png'))
         self.setToolTip('Update Stage')
         self.liveUpdateAction.setText('Enable Live Update')
Exemplo n.º 3
0
    def _initUI(self):

        self.masterLayout = QtWidgets.QVBoxLayout()
        self.setLayout(self.masterLayout)

        self.widgetNumEdit = QtWidgets.QLineEdit('10')
        self.widgetNumEdit.setFixedSize(50, 20)
        self.clearButton = QtWidgets.QPushButton()
        self.clearButton.setFixedSize(20, 20)
        self.clearButton.setIcon(resource.get_qicon('btn', 'close.png'))
        self.widgetsAreaWidget = QtWidgets.QWidget()
        self.widgetsAreaLayout = QtWidgets.QVBoxLayout()
        self.widgetsAreaLayout.setAlignment(QtCore.Qt.AlignTop)
        self.widgetsAreaLayout.setContentsMargins(0, 0, 0, 0)
        self.widgetsAreaLayout.addStretch()
        self.widgetsAreaWidget.setLayout(self.widgetsAreaLayout)
        self.widgetsArea = QtWidgets.QScrollArea()
        self.widgetsArea.setWidget(self.widgetsAreaWidget)
        self.widgetsArea.setWidgetResizable(True)

        self.topLayout = QtWidgets.QHBoxLayout()
        # self.topLayout.setAlignment(QtCore.Qt.AlignLeft)
        self.topLayout.addWidget(self.widgetNumEdit)
        self.topLayout.addWidget(self.clearButton)
        self.topLayout.addStretch()

        self.masterLayout.addLayout(self.topLayout)
        self.masterLayout.addWidget(self.widgetsArea)
Exemplo n.º 4
0
    def _initUI(self):
        self.setWindowTitle('Usd Node Graph')
        self.setDockNestingEnabled(True)
        self.setTabPosition(QtCore.Qt.AllDockWidgetAreas, QtWidgets.QTabWidget.North)

        self._geometry = None
        self._state = None

        self._setMenus()

        self.nodeGraphTab = NodeGraphTab(parent=self)
        self.buttonsWidget = QtWidgets.QWidget(parent=self)
        buttonLayout = QtWidgets.QHBoxLayout()
        buttonLayout.setAlignment(QtCore.Qt.AlignRight)
        buttonLayout.setContentsMargins(0, 0, 10, 0)
        self.buttonsWidget.setLayout(buttonLayout)
        self.nodeGraphTab.setCornerWidget(self.buttonsWidget, QtCore.Qt.TopRightCorner)

        self.applyButton = ApplyButton()
        self.reloadButton = QtWidgets.QPushButton()
        self.reloadButton.setIcon(resource.get_qicon('btn', 'refresh_blue.png'))
        buttonLayout.addWidget(self.applyButton)
        buttonLayout.addWidget(self.reloadButton)

        self.parameterPanel = ParameterPanel(parent=self)
        self.timeSlider = TimeSliderWidget()
        self.editTextEdit = QtWidgets.QTextEdit()

        self._addNewScene()

        self.nodeGraphDock = DockWidget(title='Node Graph', objName='nodeGraphDock')
        self.nodeGraphDock.setWidget(self.nodeGraphTab)
        self.parameterPanelDock = DockWidget(title='Parameters', objName='parameterPanelDock')
        self.parameterPanelDock.setWidget(self.parameterPanel)
        self.timeSliderDock = DockWidget(title='Time Slider', objName='timeSliderDock')
        self.timeSliderDock.setWidget(self.timeSlider)
        self.textEditDock = DockWidget(title='Edit Text', objName='textEditDock')
        self.textEditDock.setWidget(self.editTextEdit)

        self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.nodeGraphDock)
        self.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.parameterPanelDock)
        self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.timeSliderDock)

        self._docks.append(self.nodeGraphDock)
        self._docks.append(self.parameterPanelDock)
        self._docks.append(self.timeSliderDock)
        self._docks.append(self.textEditDock)

        for widgetClass, name, label in self._addedWidgetClasses:
            dock = DockWidget(title=label, objName=name)
            widget = widgetClass()
            dock.setWidget(widget)

            self.addDockWidget(QtCore.Qt.RightDockWidgetArea, dock)
            self._docks.append(dock)
Exemplo n.º 5
0
    def __init__(self, page):
        super(PageWidget, self).__init__()

        self._expand = 1
        self._page = page
        self._subPages = {}

        self.expandIcon = resource.get_qicon('btn', 'arrow1_down.png')
        self.unexpandIcon = resource.get_qicon('btn', 'arrow1_right.png')

        self.masterLayout = QtWidgets.QVBoxLayout()
        self.masterLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.masterLayout)

        self.upLayout = QtWidgets.QHBoxLayout()
        self.downLauout = QtWidgets.QVBoxLayout()
        self.downLauout.setContentsMargins(20, 0, 0, 0)
        self.downWidget = QtWidgets.QWidget()
        self.downWidget.setLayout(self.downLauout)
        self.formLayout = FormLayout()
        self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight)
        self.pagesLayout = QtWidgets.QVBoxLayout()
        self.masterLayout.addLayout(self.upLayout)
        self.masterLayout.addWidget(self.downWidget)
        self.downLauout.addLayout(self.formLayout)
        self.downLauout.addLayout(self.pagesLayout)
        setattr(self.masterLayout, 'formLayout', self.formLayout)
        setattr(self.masterLayout, 'pagesLayout', self.pagesLayout)

        self.expandButton = QtWidgets.QPushButton()
        self.expandButton.setIcon(self.expandIcon)
        self.expandButton.setFixedSize(15, 15)
        self.expandButton.setStyleSheet('border:none')
        self.nameLabel = QtWidgets.QLabel(page.split('.')[-1])
        self.upLayout.addWidget(self.expandButton)
        self.upLayout.addWidget(self.nameLabel)

        self.expandButton.clicked.connect(self._expandClicked)

        self._expandClicked()
Exemplo n.º 6
0
    def _initUI(self):

        self._backLabel = QLabel(parent=self)
        self._backLabel.move(0, 0)
        self._backLabel.setStyleSheet('''
        background: rgb(250, 250, 250, 10);
        border-radius: 3px;
        ''')

        self.masterLayout = QVBoxLayout()
        self.masterLayout.setContentsMargins(5, 5, 5, 5)
        self.setLayout(self.masterLayout)

        self.expandButton = QPushButton()
        self.expandButton.setIcon(resource.get_qicon('btn', 'arrow1_down.png'))
        self.nodeNameEdit = StringParameterWidget()
        self.nodeTypeLabel = QLabel()
        self.closeButton = QPushButton()
        self.closeButton.setIcon(resource.get_qicon('btn', 'close.png'))

        self.expandButton.setFixedSize(20, 20)
        self.closeButton.setFixedSize(20, 20)
        self.nodeNameEdit.setFixedHeight(20)
        self.nodeTypeLabel.setFixedHeight(20)

        self.topLayout = QHBoxLayout()
        self.topLayout.addWidget(self.expandButton)
        self.topLayout.addWidget(self.nodeNameEdit)
        self.topLayout.addWidget(self.nodeTypeLabel)
        self.topLayout.addStretch()
        self.topLayout.addWidget(self.closeButton)

        self.parameterTabWidget = QTabWidget()

        self.masterLayout.addLayout(self.topLayout)
        self.masterLayout.addWidget(self.parameterTabWidget)

        self.setSizePolicy(
            QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum))
Exemplo n.º 7
0
    def _initArea(self):
        self.addButton = QtWidgets.QPushButton()
        self.addButton.setIcon(resource.get_qicon('btn', 'add_white.png'))
        self.addButton.setFixedSize(20, 20)

        self.areaWidget = QtWidgets.QWidget()
        self.areaLayout = QtWidgets.QVBoxLayout()
        self.buttonLayout = QtWidgets.QHBoxLayout()
        self.buttonLayout.addWidget(self.addButton)
        self.buttonLayout.setAlignment(QtCore.Qt.AlignRight)

        self.formLayout = QtWidgets.QFormLayout()
        self.areaLayout.addLayout(self.formLayout)
        self.areaLayout.addLayout(self.buttonLayout)
        self.areaWidget.setLayout(self.areaLayout)
        self.scrollArea.setWidget(self.areaWidget)

        self.addButton.clicked.connect(self._addClicked)
Exemplo n.º 8
0
    def _initUI(self):
        self.setObjectName('NodeParameterWidget')

        self._backLabel = QtWidgets.QLabel(parent=self)
        self._backLabel.move(0, 0)
        self._backLabel.setStyleSheet('''
        QLabel{
            background: rgb(250, 250, 250, 10);
            border-radius: 3px;
        }
        ''')
        self.setStyleSheet('''
        QFrame#NodeParameterWidget{
            border: 1px solid gray;
            border-radius: 3px;
        }
        ''')

        self.masterLayout = QtWidgets.QVBoxLayout()
        self.masterLayout.setContentsMargins(5, 5, 5, 5)
        self.setLayout(self.masterLayout)

        self.expandButton = QtWidgets.QPushButton()
        self.expandButton.setIcon(resource.get_qicon('btn', 'arrow1_down.png'))
        self.nodeNameEdit = StringParameterWidget()
        self.nodeTypeLabel = QtWidgets.QLabel()
        self.nodePrimPathLabel = QtWidgets.QLineEdit()
        self.nodePrimPathLabel.setReadOnly(True)
        self.closeButton = QtWidgets.QPushButton()
        self.closeButton.setIcon(resource.get_qicon('btn', 'close.png'))

        self.syncButton = QtWidgets.QPushButton()
        self.syncButton.setIcon(resource.get_qicon('btn', 'refresh_blue.png'))
        self.syncButton.setToolTip('Sync To Parameter')
        self.pushButton = QtWidgets.QPushButton()
        self.pushButton.setIcon(resource.get_qicon('btn', 'arrow_up2_white.png'))
        self.pushButton.setToolTip('Force Apply Changes')

        for btn in [
            self.expandButton,
            self.closeButton,
            self.syncButton,
            self.pushButton,
        ]:
            btn.setFixedSize(20, 20)

        self.nodeNameEdit.setMaximumWidth(100)
        self.nodeNameEdit.setFixedHeight(20)
        self.nodeTypeLabel.setFixedHeight(20)
        self.nodePrimPathLabel.setFixedHeight(20)

        self.fillColorEdit = Color4fParameterWidget()
        self.borderColorEdit = Color4fParameterWidget()

        self.topLayout = QtWidgets.QHBoxLayout()
        self.topLayout.addWidget(self.expandButton)
        self.topLayout.addWidget(self.nodeNameEdit)
        self.topLayout.addWidget(self.nodeTypeLabel)
        self.topLayout.addWidget(self.nodePrimPathLabel)
        # self.topLayout.addStretch()
        # self.topLayout.addWidget(self.syncButton)
        self.topLayout.addWidget(self.fillColorEdit)
        self.topLayout.addWidget(self.borderColorEdit)
        self.topLayout.addWidget(self.pushButton)
        self.topLayout.addWidget(self.closeButton)

        self.parameterTabWidget = QtWidgets.QTabWidget()
        self.metadataWidget = MetadataPanel()
        self.metadataWidget.setVisible(False)

        self.downSplit = QtWidgets.QSplitter()
        # self.downSplit.setOrientation(QtCore.Qt.Vertical)
        self.downSplit.addWidget(self.parameterTabWidget)
        self.downSplit.addWidget(self.metadataWidget)

        self.masterLayout.addLayout(self.topLayout)
        self.masterLayout.addWidget(self.downSplit)

        self.setSizePolicy(QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Preferred,
            QtWidgets.QSizePolicy.Maximum
        ))
Exemplo n.º 9
0
 def updateIcon(self):
     if self._format == 'usd':
         icon = resource.get_qicon('icon', 'UsdLogo.png')
     elif self._format == 'ung':
         icon = resource.get_qicon('icon', 'UngLogo.png')
     self.setIcon(icon)