diff --git a/scripts/python/edu_utils.py b/scripts/python/edu_utils.py index 5b73fc722..fe3089bff 100644 --- a/scripts/python/edu_utils.py +++ b/scripts/python/edu_utils.py @@ -7,6 +7,12 @@ import hou import importlib +from hutil.Qt.QtCore import * +from hutil.Qt.QtGui import * +from hutil.Qt.QtWidgets import * + +import labutils + from past.utils import old_div import nodegraphutils @@ -91,6 +97,53 @@ def createNotes(kwargs, stickytype="info"): sticky.setTextColor(hou.Color(normalize_color(COLOR_TXT[stickytype]))) +# add a background image to the current network editor with the option to embbed it +def addBackgroundImage(): + dialog = BackgroundImages(hou.qt.mainWindow()) + dialog.show() + +class BackgroundImages(QDialog): + def __init__(self, parent): + super(BackgroundImages, self).__init__(parent) + self.setWindowTitle("Add Background Image") + self.build_ui() + + def build_ui(self): + self.cbx_embbed = QCheckBox("Embbed image") + self.btn_choose = QPushButton("Choose Image") + self.btn_cancel = QPushButton("Cancel") + self.btn_choose.clicked.connect(self.on_choosebtn_press) + self.btn_cancel.clicked.connect(self.on_cancelbtn_press) + + button_layout = QHBoxLayout() + button_layout.addWidget(self.cbx_embbed) + button_layout.addWidget(self.btn_choose) + button_layout.addWidget(self.btn_cancel) + + layout = QVBoxLayout() + layout.addLayout(button_layout) + + self.setLayout(layout) + + def on_choosebtn_press(self): + home_folder = os.path.expanduser("~") + + for ptab in hou.ui.currentPaneTabs(): + if ptab.type() == hou.paneTabType.NetworkEditor: + network_editor = ptab + fileName, selectedFilter = QFileDialog.getOpenFileName(self, str("Open Image"), home_folder, str("Image Files (*.png *.jpg *.bmp)")) + scale = 1 + embedded = self.cbx_embbed.isChecked() + relativeto_path = None + bounds = None + + labutils.add_network_image(network_editor, fileName, scale, embedded, relativeto_path=None, bounds=None) + self.close() + + def on_cancelbtn_press(self): + self.close() + + class Quickmarks(object): def __init__(self): @@ -239,3 +292,5 @@ def jumpTo(self, value): nodegraphview.createUndoQuickMark(self._pane) if quickmark is not None: quickmark.jump(self._pane) + + diff --git a/scripts/python/sidefxedu.py b/scripts/python/sidefxedu.py index dcab3ae7c..b230966ab 100644 --- a/scripts/python/sidefxedu.py +++ b/scripts/python/sidefxedu.py @@ -161,14 +161,13 @@ def build_ui(self): version_layout = QHBoxLayout() update_version_label = QLabel("Release:") - self.version_combo = QComboBox(self) - for release in self.updater_object.production_releases[:10]: - self.version_combo.addItem(release) - self.production_builds_check = QCheckBox("Production Builds Only") - self.production_builds_check.setChecked(True) + self.production_builds_check.setChecked(False) self.production_builds_check.stateChanged.connect(self.on_production_check) + self.version_combo = QComboBox(self) + self.on_production_check() + version_layout.addWidget(update_version_label) version_layout.addWidget(self.version_combo) version_layout.addWidget(self.production_builds_check) @@ -177,11 +176,9 @@ def build_ui(self): changedgroup_layout.addLayout(version_layout) self.button = QPushButton("Update") self.uninstallButton = QPushButton("Uninstall") - self.launcherButton = QPushButton("Start Launcher") self.button.clicked.connect(self.on_updatebtn_press) self.uninstallButton.clicked.connect(self.on_uninstallbtn_press) - self.launcherButton.clicked.connect(self.on_launcherbtn_press) layout = QVBoxLayout() layout.addWidget(installed_group) @@ -201,8 +198,6 @@ def build_ui(self): self.uninstallButton.setEnabled(False) button_layout = QHBoxLayout() - button_layout.addWidget(self.launcherButton) - button_layout.addWidget(spacer) button_layout.addWidget(self.button) button_layout.addWidget(self.uninstallButton) @@ -311,7 +306,7 @@ def __init__(self, updater_dialog=False): if updater_dialog: self.show_updater_dialog() - self.clean_old_installs() + # self.clean_old_installs() def clean_old_installs(self): diff --git a/toolbar/edu_toolset.shelf b/toolbar/edu_toolset.shelf index cb8ba1c1a..cd440e27c 100644 --- a/toolbar/edu_toolset.shelf +++ b/toolbar/edu_toolset.shelf @@ -8,6 +8,7 @@ + @@ -120,4 +121,15 @@ archive_top.setPosition(scheduler.position() + hou.Vector2(0, -1))]]> + + + +