def __init__(self, parent=None): super(ViewportPlugin, self).__init__(parent=parent) self.show_types_list = list() self.plugin_shapes = lib.get_plugin_shapes() self.setObjectName(self.label) self._layout = QtWidgets.QVBoxLayout() self._layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self._layout) self.override_viewport = QtWidgets.QCheckBox("Override viewport " "settings") self.override_viewport.setChecked(True) # region Show self.show_types_button = QtWidgets.QPushButton("Show") self.show_types_button.setFixedWidth(150) self.show_types_menu = self._build_show_menu() self.show_types_button.setMenu(self.show_types_menu) # endregion Show # region Checkboxes self.high_quality = QtWidgets.QCheckBox() self.high_quality.setText("Force Viewport 2.0 + AA") # endregion Checkboxes self._layout.addWidget(self.override_viewport) self._layout.addWidget(self.show_types_button) self._layout.addWidget(self.high_quality) # signals self.high_quality.stateChanged.connect(self.options_changed) self.override_viewport.stateChanged.connect(self.options_changed) self.override_viewport.stateChanged.connect(self.on_toggle_override)
def __init__(self, parent=None): super(DisplayPlugin, self).__init__(parent=parent) self._colors = dict() self._layout = QtWidgets.QVBoxLayout() self._layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self._layout) self.override = QtWidgets.QCheckBox("Override Display Options") self.display_type = QtWidgets.QComboBox() self.display_type.addItems(["Solid", "Gradient"]) # create color columns self._color_layout = QtWidgets.QHBoxLayout() for label, default in COLORS.items(): self.add_color_picker(self._color_layout, label, default) # populate layout self._layout.addWidget(self.override) self._layout.addWidget(self.display_type) self._layout.addLayout(self._color_layout) # ensure widgets are in the correct enable state self.on_toggle_override() self.connections()
def __init__(self, parent=None): super(GenericPlugin, self).__init__(parent=parent) layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) self.setLayout(layout) isolate_view = QtWidgets.QCheckBox( "Use isolate view from active panel") off_screen = QtWidgets.QCheckBox("Render offscreen") layout.addWidget(isolate_view) layout.addWidget(off_screen) isolate_view.stateChanged.connect(self.options_changed) off_screen.stateChanged.connect(self.options_changed) self.widgets = {"off_screen": off_screen, "isolate_view": isolate_view} self.apply_inputs(self.get_defaults())
def __init__(self, parent=None): super(PanZoomPlugin, self).__init__(parent=parent) self._layout = QtWidgets.QHBoxLayout() self._layout.setContentsMargins(5, 0, 5, 0) self.setLayout(self._layout) self.pan_zoom = QtWidgets.QCheckBox("Use pan/zoom from camera") self.pan_zoom.setChecked(True) self._layout.addWidget(self.pan_zoom) self.pan_zoom.stateChanged.connect(self.options_changed)
def __init__(self, parent=None): super(ViewportPlugin, self).__init__(parent=parent) # set inherited attributes self.setObjectName(self.label) # custom atttributes self.show_type_actions = list() # get information self.show_types = lib.get_show_object_types() # set main layout for widget self._layout = QtWidgets.QVBoxLayout() self._layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self._layout) # build # region Menus menus_vlayout = QtWidgets.QHBoxLayout() # Display Lights self.display_light_menu = self._build_light_menu() self.display_light_menu.setFixedHeight(20) # Show self.show_types_button = QtWidgets.QPushButton("Show") self.show_types_button.setFixedHeight(20) self.show_types_menu = self._build_show_menu() self.show_types_button.setMenu(self.show_types_menu) # fill layout menus_vlayout.addWidget(self.display_light_menu) menus_vlayout.addWidget(self.show_types_button) # endregion Menus # region Checkboxes checkbox_layout = QtWidgets.QGridLayout() self.high_quality = QtWidgets.QCheckBox() self.high_quality.setText("Force Viewport 2.0 + AA") self.override_viewport = QtWidgets.QCheckBox("Override viewport " "settings") self.override_viewport.setChecked(True) # two sided lighting self.two_sided_ligthing = QtWidgets.QCheckBox("Two Sided Ligthing") self.two_sided_ligthing.setChecked(False) # show self.shadows = QtWidgets.QCheckBox("Shadows") self.shadows.setChecked(False) checkbox_layout.addWidget(self.override_viewport, 0, 0) checkbox_layout.addWidget(self.high_quality, 0, 1) checkbox_layout.addWidget(self.two_sided_ligthing, 1, 0) checkbox_layout.addWidget(self.shadows, 1, 1) # endregion Checkboxes self._layout.addLayout(checkbox_layout) self._layout.addLayout(menus_vlayout) self.connections()
def __init__(self, parent=None): super(IoPlugin, self).__init__(parent=parent) self.recent_playblasts = list() self._layout = QtWidgets.QVBoxLayout() self._layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self._layout) # region Checkboxes checkbox_hlayout = QtWidgets.QHBoxLayout() checkbox_hlayout.setContentsMargins(5, 0, 5, 0) self.save_file = QtWidgets.QCheckBox(text="Save") self.use_default = QtWidgets.QCheckBox(text="Use Default") self.open_viewer = QtWidgets.QCheckBox(text="View when finished") checkbox_hlayout.addWidget(self.save_file) checkbox_hlayout.addWidget(self.use_default) checkbox_hlayout.addWidget(self.open_viewer) checkbox_hlayout.addStretch(True) # endregion Checkboxes # region Directory self.dir_widget = QtWidgets.QWidget() dir_hlayout = QtWidgets.QHBoxLayout() dir_hlayout.setContentsMargins(0, 0, 0, 0) dir_label = QtWidgets.QLabel("Directory :") dir_label.setFixedWidth(60) self.browse = QtWidgets.QPushButton("Browse") self.directory_path = QtWidgets.QLineEdit() self.directory_path.setPlaceholderText("Select a directory") dir_hlayout.addWidget(dir_label) dir_hlayout.addWidget(self.directory_path) dir_hlayout.addWidget(self.browse) self.dir_widget.setLayout(dir_hlayout) # endregion Directory # region Filename self.filename_widget = QtWidgets.QWidget() filename_hlayout = QtWidgets.QHBoxLayout() filename_hlayout.setContentsMargins(0, 0, 0, 0) filename_label = QtWidgets.QLabel("File Name :") filename_label.setFixedWidth(60) self.filename = QtWidgets.QLineEdit() filename_hlayout.addWidget(filename_label) filename_hlayout.addWidget(self.filename) self.filename_widget.setLayout(filename_hlayout) # endregion Filename # region Recent Playblast self.play_recent = QtWidgets.QPushButton("Play recent playblast") self.recent_menu = QtWidgets.QMenu() self.play_recent.setMenu(self.recent_menu) # endregion Recent Playblast self._layout.addLayout(checkbox_hlayout) self._layout.addWidget(self.filename_widget) self._layout.addWidget(self.dir_widget) self._layout.addWidget(self.play_recent) self.browse.clicked.connect(self.get_save_directory) self.use_default.stateChanged.connect(self.toggle_use_default) self.save_file.stateChanged.connect(self.toggle_save) # set state of save widgets self.toggle_save() self.toggle_use_default()
def __init__(self, parent=None): super(IoPlugin, self).__init__(parent=parent) self.recent_playblasts = list() self._layout = QtWidgets.QVBoxLayout() self._layout.setContentsMargins(0, 0, 0, 0) self.setLayout(self._layout) # region Checkboxes self.save_file = QtWidgets.QCheckBox(text="Save") self.open_viewer = QtWidgets.QCheckBox(text="View when finished") self.raw_frame_numbers = QtWidgets.QCheckBox(text="Raw frame numbers") checkbox_hlayout = QtWidgets.QHBoxLayout() checkbox_hlayout.setContentsMargins(5, 0, 5, 0) checkbox_hlayout.addWidget(self.save_file) checkbox_hlayout.addWidget(self.open_viewer) checkbox_hlayout.addWidget(self.raw_frame_numbers) checkbox_hlayout.addStretch(True) # endregion Checkboxes # region Path self.path_widget = QtWidgets.QWidget() self.browse = QtWidgets.QPushButton("Browse") self.file_path = QtWidgets.QLineEdit() self.file_path.setPlaceholderText("(not set; using scene name)") tip = "Right click in the text field to insert tokens" self.file_path.setToolTip(tip) self.file_path.setStatusTip(tip) self.file_path.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.file_path.customContextMenuRequested.connect(self.show_token_menu) path_hlayout = QtWidgets.QHBoxLayout() path_hlayout.setContentsMargins(0, 0, 0, 0) path_label = QtWidgets.QLabel("Path:") path_label.setFixedWidth(30) path_hlayout.addWidget(path_label) path_hlayout.addWidget(self.file_path) path_hlayout.addWidget(self.browse) self.path_widget.setLayout(path_hlayout) # endregion Path # region Recent Playblast self.play_recent = QtWidgets.QPushButton("Play recent playblast") self.recent_menu = QtWidgets.QMenu() self.play_recent.setMenu(self.recent_menu) # endregion Recent Playblast self._layout.addLayout(checkbox_hlayout) self._layout.addWidget(self.path_widget) self._layout.addWidget(self.play_recent) # Signals / connections self.browse.clicked.connect(self.show_browse_dialog) self.file_path.textChanged.connect(self.options_changed) self.save_file.stateChanged.connect(self.options_changed) self.raw_frame_numbers.stateChanged.connect(self.options_changed) self.save_file.stateChanged.connect(self.on_save_changed) # Ensure state is up-to-date with current settings self.on_save_changed()