Exemplo n.º 1
0
    def __init__(self, group, parent=None):
        super(AOVGroupInfoDialog, self).__init__(parent)

        self._group = group
        self._edit_dialog = None

        self.setWindowTitle("View AOV Group Info")

        # Initialize UI

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

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

        self.group_chooser = widgets.ComboBox()
        layout.addWidget(self.group_chooser)

        # Start menu index.
        start_idx = -1

        # Populate the group chooser with all the existing groups.
        for idx, available_group in enumerate(sorted(manager.MANAGER.groups.values())):
            label = available_group.name

            self.group_chooser.addItem(
                utils.get_icon_for_group(available_group), label, available_group
            )

            # The group matches our start group so set the start index.
            if available_group == self.group:
                start_idx = idx

        if start_idx != -1:
            self.group_chooser.setCurrentIndex(start_idx)

        self.group_chooser.currentIndexChanged.connect(self.group_selection_changed)

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

        self.table = widgets.AOVGroupInfoTableWidget(self.group)
        layout.addWidget(self.table)

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

        self.members = widgets.GroupMemberListWidget(self.group)
        layout.addWidget(self.members)

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

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

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

        # Button to launch the Edit dialog on the current group.
        self.edit_button = QtWidgets.QPushButton(
            hou.qt.createIcon("BUTTONS_edit"), "Edit"
        )

        self.edit_button.setToolTip("Edit this group.")

        # Use HelpRole to force the button to the left size of the dialog.
        self.button_box.addButton(self.edit_button, QtWidgets.QDialogButtonBox.HelpRole)
        self.edit_button.clicked.connect(self.edit)

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

        self.delete_button = QtWidgets.QPushButton(
            hou.qt.createIcon("COMMON_delete"), "Delete"
        )

        self.button_box.addButton(
            self.delete_button, QtWidgets.QDialogButtonBox.HelpRole
        )

        self.delete_button.setToolTip("Delete this group.")
        self.delete_button.clicked.connect(self.delete)

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

        self.table.resizeColumnToContents(0)
        self.setMinimumSize(self.table.size())

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

        self.enable_edit(group)
Exemplo n.º 2
0
    def __init__(self, parent=None):  # pylint: disable=too-many-statements
        super(_BaseAOVDialog, self).__init__(parent)

        # UI elements are valid.
        self._variable_valid = False
        self._file_valid = False

        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.setSpacing(5)

        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 = widgets.ComboBox()
        grid_layout.addWidget(self.type_box, row, 1)

        for entry in uidata.VEXTYPE_MENU_ITEMS:
            icon = utils.get_icon_for_vex_type(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 = widgets.ComboBox()
        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 = widgets.ComboBox()
        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, 15)

        row += 1

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

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

        self.exclude_from_dcm = hou.qt.createCheckBox()
        grid_layout.addWidget(self.exclude_from_dcm, row, 1)

        row += 1

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

        grid_layout.setRowMinimumHeight(row, 15)

        row += 1

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

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

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

        self.componentexport = hou.qt.createCheckBox()
        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 = widgets.ComboBox()
        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.enable_exports)

        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.enable_component_mode)
        self.component_mode.currentIndexChanged.connect(self.enable_components)

        row += 1

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

        grid_layout.setRowMinimumHeight(row, 15)

        row += 1

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

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

        self.lightexport = widgets.ComboBox()
        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.enable_exports)

        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, 15)

        row += 1

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

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

        self.priority = QtWidgets.QSpinBox()
        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, 15)

        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, 15)

        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.valid_input_signal.connect(self.enable_creation)

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

        self.setMinimumWidth(450)
Exemplo n.º 3
0
    def __init__(self, aov, parent=None):
        super(AOVInfoDialog, self).__init__(parent)

        self._edit_dialog = None

        self._aov = aov

        self.setWindowTitle("View AOV Info")

        # Initialize UI

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

        self.aov_chooser = widgets.ComboBox()
        layout.addWidget(self.aov_chooser)

        # Start menu index.
        start_idx = -1

        # Populate the AOV chooser with all the existing AOVs.
        for idx, available_aov in enumerate(sorted(manager.MANAGER.aovs.values())):
            # If a channel is specified, put it into the display name.
            if available_aov.channel is not None:
                label = "{} ({})".format(available_aov.variable, available_aov.channel)

            else:
                label = available_aov.variable

            self.aov_chooser.addItem(
                utils.get_icon_for_vex_type(available_aov.vextype), label, available_aov
            )

            # The AOV matches our start AOV so set the start index.
            if available_aov == self.aov:
                start_idx = idx

        if start_idx != -1:
            self.aov_chooser.setCurrentIndex(start_idx)

        self.aov_chooser.currentIndexChanged.connect(self.aov_selection_changed)

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

        self.table = widgets.AOVInfoTableView(self.aov)
        layout.addWidget(self.table)

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

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

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

        edit_button = QtWidgets.QPushButton(hou.qt.createIcon("BUTTONS_edit"), "Edit")

        edit_button.setToolTip("Edit this AOV.")

        self.button_box.addButton(edit_button, QtWidgets.QDialogButtonBox.ResetRole)
        edit_button.clicked.connect(self.edit)

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

        delete_button = QtWidgets.QPushButton(
            hou.qt.createIcon("COMMON_delete"), "Delete"
        )

        self.button_box.addButton(delete_button, QtWidgets.QDialogButtonBox.ResetRole)

        delete_button.setToolTip("Delete this AOV.")
        delete_button.clicked.connect(self.delete)

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

        self.table.resizeColumnToContents(0)
        self.setMinimumSize(self.table.size())