コード例 #1
0
    def initUI(self):
        """Initialize the UI."""
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        # =====================================================================

        help_layout = QtWidgets.QHBoxLayout()
        layout.addLayout(help_layout)

        help_layout.addStretch(1)

        help_layout.addWidget(widgets.HelpButton("group_dialog"))

        # =====================================================================

        grid_layout = QtWidgets.QGridLayout()
        layout.addLayout(grid_layout)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Group Name"), 1, 0)

        self.group_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.group_name, 1, 1)

        self.group_name.textChanged.connect(self.validateGroupName)

        self.group_name.setFocus()

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("File Path"), 2, 0)

        self.file_widget = widgets.FileChooser()
        grid_layout.addWidget(self.file_widget, 2, 1)

        self.file_widget.field.textChanged.connect(self.validateFilePath)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Comment"), 3, 0)

        self.comment = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.comment, 3, 1)

        self.comment.setToolTip("Optional comment, eg. 'This group is for X'.")

        # ====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Priority"), 4, 0)

        self.priority = widgets.CustomSpinBox()
        grid_layout.addWidget(self.priority, 4, 1)

        self.priority.setMinimum(-1)
        self.priority.setValue(-1)

        # ====================================================================

        self.aov_list = widgets.NewGroupAOVListWidget(self)
        layout.addWidget(self.aov_list)

        # Signal triggered when check boxes are toggled.
        self.aov_list.model().sourceModel().dataChanged.connect(
            self.validateAOVs)

        # =====================================================================

        self.filter = widgets.FilterWidget()
        layout.addWidget(self.filter)

        QtCore.QObject.connect(self.filter.field,
                               QtCore.SIGNAL("textChanged(QString)"),
                               self.aov_list.proxy_model.setFilterWildcard)

        # =====================================================================

        self.status_widget = widgets.StatusMessageWidget()
        layout.addWidget(self.status_widget)

        # =====================================================================

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)

        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)
コード例 #2
0
ファイル: dialogs.py プロジェクト: hickb/Houdini-Toolbox
    def __init__(self, parent=None):
        super(_BaseGroupDialog, self).__init__(parent)

        self._group_name_valid = False
        self._file_valid = False
        self._aovs_valid = False

        # Initialize UI

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

        # ---------------------------------------------------------------------

        help_layout = QtWidgets.QHBoxLayout()
        layout.addLayout(help_layout)

        help_layout.addStretch(1)

        help_layout.addWidget(widgets.HelpButton("group_dialog"))

        # ---------------------------------------------------------------------

        grid_layout = QtWidgets.QGridLayout()
        layout.addLayout(grid_layout)

        # ---------------------------------------------------------------------

        grid_layout.addWidget(QtWidgets.QLabel("Group Name"), 1, 0)

        self.group_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.group_name, 1, 1)

        self.group_name.textChanged.connect(self.validate_group_name)

        self.group_name.setFocus()

        # ---------------------------------------------------------------------

        grid_layout.addWidget(QtWidgets.QLabel("File Path"), 2, 0)

        self.file_widget = widgets.FileChooser()
        grid_layout.addWidget(self.file_widget, 2, 1)

        self.file_widget.field.textChanged.connect(self.validate_filepath)

        # ---------------------------------------------------------------------

        grid_layout.addWidget(QtWidgets.QLabel("Comment"), 3, 0)

        self.comment = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.comment, 3, 1)

        self.comment.setToolTip("Optional comment, eg. 'This group is for X'.")

        # ---------------------------------------------------------------------

        grid_layout.addWidget(QtWidgets.QLabel("Priority"), 4, 0)

        self.priority = QtWidgets.QSpinBox()
        grid_layout.addWidget(self.priority, 4, 1)

        self.priority.setMinimum(-1)
        self.priority.setValue(-1)

        # ---------------------------------------------------------------------

        self.aov_list = widgets.NewGroupAOVListWidget(self)
        layout.addWidget(self.aov_list)

        # Signal triggered when check boxes are toggled.
        self.aov_list.model().sourceModel().dataChanged.connect(self.validate_aovs)

        # ---------------------------------------------------------------------

        self.filter = widgets.FilterWidget()
        layout.addWidget(self.filter)

        self.filter.field.textChanged.connect(
            self.aov_list.proxy_model.setFilterWildcard
        )

        # ---------------------------------------------------------------------

        self.status_widget = widgets.StatusMessageWidget()
        layout.addWidget(self.status_widget)

        # ---------------------------------------------------------------------

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel
        )

        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        # --------------------------------------------------------------------

        self.resize(450, 475)
        self.setMinimumWidth(450)

        self.valid_input_signal.connect(self.enable_creation)
コード例 #3
0
    def initUI(self):
        """Initialize the UI."""
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        # =====================================================================

        help_layout = QtWidgets.QHBoxLayout()
        layout.addLayout(help_layout)

        help_layout.addStretch(1)

        help_layout.addWidget(widgets.HelpButton("aov_dialog"))

        # =====================================================================

        grid_layout = QtWidgets.QGridLayout()
        layout.addLayout(grid_layout)

        row = 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("VEX Variable"), row, 0)

        self.variable_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.variable_name, row, 1)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("VEX Type"), row, 0)

        self.type_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.type_box, row, 1)

        for entry in uidata.VEXTYPE_MENU_ITEMS:
            icon = utils.getIconFromVexType(entry[0])

            self.type_box.addItem(icon, entry[1], entry[0])

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Channel Name"), row, 0)

        self.channel_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.channel_name, row, 1)

        self.channel_name.setToolTip(
            "Optional channel name Mantra will rename the AOV to.")

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Quantize"), row, 0)

        self.quantize_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.quantize_box, row, 1)

        for entry in uidata.QUANTIZE_MENU_ITEMS:
            self.quantize_box.addItem(entry[1], entry[0])

        self.quantize_box.setCurrentIndex(2)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Sample Filter"), row, 0)

        self.sfilter_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.sfilter_box, row, 1)

        for entry in uidata.SFILTER_MENU_ITEMS:
            self.sfilter_box.addItem(entry[1], entry[0])

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Pixel Filter"), row, 0)

        self.pfilter_widget = widgets.MenuField(uidata.PFILTER_MENU_ITEMS)
        grid_layout.addWidget(self.pfilter_widget, row, 1)

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Exclude from DCM"), row, 0)

        self.exclude_from_dcm = QtWidgets.QCheckBox()
        grid_layout.addWidget(self.exclude_from_dcm, row, 1)

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        self.export_label = QtWidgets.QLabel(
            "Export variable \nfor each component")

        grid_layout.addWidget(self.export_label, row, 0, 2, 1)

        self.componentexport = QtWidgets.QCheckBox()
        grid_layout.addWidget(self.componentexport, row, 1, 2, 1)

        row += 2

        # =====================================================================

        self.component_mode_label = QtWidgets.QLabel("Set Components")
        grid_layout.addWidget(self.component_mode_label, row, 0)

        self.component_mode = QtWidgets.QComboBox()
        grid_layout.addWidget(self.component_mode, row, 1)

        self.component_mode.addItem("From ROP", "rop")
        self.component_mode.addItem("In AOV", "aov")

        self.component_mode_label.setDisabled(True)
        self.component_mode.setDisabled(True)

        #        self.component_mode.currentIndexChanged.connect(self.enableExports)

        row += 1

        # =====================================================================

        self.components_label = QtWidgets.QLabel("Export Components")
        grid_layout.addWidget(self.components_label, row, 0)

        self.components_label.setDisabled(True)

        self.components = QtWidgets.QLineEdit()
        self.components.setText("diffuse reflect coat refract volume sss")
        grid_layout.addWidget(self.components, row, 1)

        self.components.setDisabled(True)
        self.components.setToolTip(
            "Shading component names.  Leaving this field empty will use the components"
            " selected on the Mantra ROP.")

        self.componentexport.stateChanged.connect(self.enableComponentMode)
        self.component_mode.currentIndexChanged.connect(self.enableComponents)

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Light Exports"), row, 0)

        self.lightexport = QtWidgets.QComboBox()
        grid_layout.addWidget(self.lightexport, row, 1)

        for entry in uidata.LIGHTEXPORT_MENU_ITEMS:
            self.lightexport.addItem(entry[1], entry[0])

        self.lightexport.currentIndexChanged.connect(self.enableExports)

        row += 1

        # =====================================================================

        self.light_mask_label = QtWidgets.QLabel("Light Mask")
        grid_layout.addWidget(self.light_mask_label, row, 0)

        self.light_mask_label.setDisabled(True)

        self.light_mask = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.light_mask, row, 1)

        self.light_mask.setText("*")
        self.light_mask.setDisabled(True)

        row += 1

        # =====================================================================

        self.light_select_label = QtWidgets.QLabel("Light Selection")
        grid_layout.addWidget(self.light_select_label, row, 0)

        self.light_select_label.setDisabled(True)

        self.light_select = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.light_select, row, 1)

        self.light_select.setText("*")
        self.light_select.setDisabled(True)

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Priority"), row, 0)

        self.priority = widgets.CustomSpinBox()
        grid_layout.addWidget(self.priority, row, 1)

        self.priority.setMinimum(-1)
        self.priority.setValue(-1)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Intrinsics"), row, 0)

        self.intrinsics = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.intrinsics, row, 1)

        self.intrinsics.setToolTip(
            "Optional intrinsic groups for automatic group addition, eg. Diagnostic"
        )

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Comment"), row, 0)

        self.comment = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.comment, row, 1)

        self.comment.setToolTip(
            "Optional comment, eg. 'This AOV represents X'.")

        row += 1

        # =====================================================================

        grid_layout.setRowMinimumHeight(row, 25)

        row += 1

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("File Path"), row, 0)

        self.file_widget = widgets.FileChooser()
        grid_layout.addWidget(self.file_widget, row, 1)

        row += 1

        # =====================================================================

        self.status_widget = widgets.StatusMessageWidget()
        layout.addWidget(self.status_widget)

        # =====================================================================

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel)
        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        self.validInputSignal.connect(self.enableCreation)
コード例 #4
0
    def initUI(self):
        """Initialize the UI."""
        layout = QtWidgets.QVBoxLayout()
        self.setLayout(layout)

        # =====================================================================

        help_layout = QtWidgets.QHBoxLayout()
        layout.addLayout(help_layout)

        help_layout.addStretch(1)

        help_layout.addWidget(widgets.HelpButton("aov_dialog"))

        # =====================================================================

        grid_layout = QtWidgets.QGridLayout()
        layout.addLayout(grid_layout)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("VEX Variable"), 1, 0)

        self.variable_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.variable_name, 1, 1)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("VEX Type"), 2, 0)

        self.type_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.type_box, 2, 1)

        for entry in uidata.VEXTYPE_MENU_ITEMS:
            icon = utils.getIconFromVexType(entry[0])

            self.type_box.addItem(
                icon,
                entry[1],
                entry[0]
            )

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Channel Name"), 3, 0)

        self.channel_name = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.channel_name, 3, 1)

        self.channel_name.setToolTip(
            "Optional channel name Mantra will rename the AOV to."
        )

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Quantize"), 4, 0)

        self.quantize_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.quantize_box, 4, 1)

        for entry in uidata.QUANTIZE_MENU_ITEMS:
            self.quantize_box.addItem(entry[1], entry[0])

        self.quantize_box.setCurrentIndex(2)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Sample Filter"), 5, 0)

        self.sfilter_box = QtWidgets.QComboBox()
        grid_layout.addWidget(self.sfilter_box, 5, 1)

        for entry in uidata.SFILTER_MENU_ITEMS:
            self.sfilter_box.addItem(entry[1], entry[0])

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Pixel Filter"), 6, 0)

        self.pfilter_widget = widgets.MenuField(
            uidata.PFILTER_MENU_ITEMS
        )
        grid_layout.addWidget(self.pfilter_widget, 6, 1)

        # =====================================================================

        grid_layout.setRowMinimumHeight(7, 25)

        # =====================================================================

        self.componentexport = QtWidgets.QCheckBox()
        grid_layout.addWidget(self.componentexport, 8, 0)

        grid_layout.addWidget(
            QtWidgets.QLabel("Export variable for each component"),
            8,
            1
        )

        # =====================================================================

        self.components_label = QtWidgets.QLabel("Export Components")
        grid_layout.addWidget(self.components_label, 9, 0)

        self.components_label.setDisabled(True)

        self.components = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.components, 9, 1)

        self.components.setDisabled(True)
        self.components.setToolTip(
            "Shading component names.  Leaving this field empty will use the components" \
            " selected on the Mantra ROP."
        )

        self.componentexport.stateChanged.connect(self.enableComponents)

        # =====================================================================

        grid_layout.setRowMinimumHeight(10, 25)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Light Exports"), 11, 0)

        self.lightexport = QtWidgets.QComboBox()
        grid_layout.addWidget(self.lightexport, 11, 1)

        for entry in uidata.LIGHTEXPORT_MENU_ITEMS:
            self.lightexport.addItem(entry[1], entry[0])

        self.lightexport.currentIndexChanged.connect(self.enableExports)

        # =====================================================================

        self.light_mask_label = QtWidgets.QLabel("Light Mask")
        grid_layout.addWidget(self.light_mask_label, 12, 0)

        self.light_mask_label.setDisabled(True)

        self.light_mask = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.light_mask, 12, 1)

        self.light_mask.setText("*")
        self.light_mask.setDisabled(True)

        # =====================================================================

        self.light_select_label = QtWidgets.QLabel("Light Selection")
        grid_layout.addWidget(self.light_select_label, 13, 0)

        self.light_select_label.setDisabled(True)

        self.light_select = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.light_select, 13, 1)

        self.light_select.setText("*")
        self.light_select.setDisabled(True)

        # =====================================================================

        grid_layout.setRowMinimumHeight(14, 25)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Priority"), 15, 0)

        self.priority = widgets.CustomSpinBox()
        grid_layout.addWidget(self.priority, 15, 1)

        self.priority.setMinimum(-1)
        self.priority.setValue(-1)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Intrinsic"), 16, 0)

        self.intrinsic = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.intrinsic, 16, 1)

        self.intrinsic.setToolTip(
            "Optional intrinsic group for automatic group addition, eg. Diagnostic"
        )


        # =====================================================================

        grid_layout.setRowMinimumHeight(17, 25)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("Comment"), 18, 0)

        self.comment = QtWidgets.QLineEdit()
        grid_layout.addWidget(self.comment, 18, 1)

        self.comment.setToolTip(
            "Optional comment, eg. 'This AOV represents X'."
        )

        # =====================================================================

        grid_layout.setRowMinimumHeight(19, 25)

        # =====================================================================

        grid_layout.addWidget(QtWidgets.QLabel("File Path"), 20, 0)

        self.file_widget = widgets.FileChooser()
        grid_layout.addWidget(self.file_widget, 20, 1)

        # =====================================================================

        self.status_widget = widgets.StatusMessageWidget()
        layout.addWidget(self.status_widget)

        # =====================================================================

        self.button_box = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel
        )
        layout.addWidget(self.button_box)

        self.button_box.accepted.connect(self.accept)
        self.button_box.rejected.connect(self.reject)

        self.validInputSignal.connect(self.enableCreation)