Skip to content

Commit

Permalink
fix: Update write nodes and views when refeshing the job settings ui (#…
Browse files Browse the repository at this point in the history
…151)

Signed-off-by: Evan Spearman <[email protected]>
  • Loading branch information
evanspearman-a authored Jul 29, 2024
1 parent 08b2b27 commit 1175cc9
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/deadline/nuke_submitter/ui/components/scene_settings_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,12 @@ def _build_ui(self):
lyt = QGridLayout(self)

self.write_node_box = QComboBox(self)
self.write_node_box.addItem("All Write Nodes", None)
for write_node in sorted(
find_all_write_nodes(), key=lambda write_node: write_node.fullName()
):
# Set data value as fullName since this is the value we want to store in the settings
self.write_node_box.addItem(write_node.fullName(), write_node.fullName())

self._rebuild_write_node_drop_down()
lyt.addWidget(QLabel("Write Nodes"), 0, 0)
lyt.addWidget(self.write_node_box, 0, 1, 1, -1)

self.views_box = QComboBox(self)
self.views_box.addItem("All Views", "")
for view in sorted(nuke.views()):
self.views_box.addItem(view, view)
self._rebuild_views_drop_down()
lyt.addWidget(QLabel("Views"), 1, 0)
lyt.addWidget(self.views_box, 1, 1, 1, -1)

Expand Down Expand Up @@ -181,6 +173,21 @@ def _calculate_timeout_seconds(
+ timeout_boxes[3].value() * 60
)

def _rebuild_write_node_drop_down(self) -> None:
self.write_node_box.clear()
self.write_node_box.addItem("All Write Nodes", None)
for write_node in sorted(
find_all_write_nodes(), key=lambda write_node: write_node.fullName()
):
# Set data value as fullName since this is the value we want to store in the settings
self.write_node_box.addItem(write_node.fullName(), write_node.fullName())

def _rebuild_views_drop_down(self) -> None:
self.views_box.clear()
self.views_box.addItem("All Views", "")
for view in sorted(nuke.views()):
self.views_box.addItem(view, view)

@property
def on_run_timeout_seconds(self):
return self._calculate_timeout_seconds(self.on_run_timeouts)
Expand All @@ -198,13 +205,19 @@ def refresh_ui(self, settings: RenderSubmitterUISettings):
self.frame_override_txt.setEnabled(settings.override_frame_range)
self.frame_override_txt.setText(settings.frame_list)

self._rebuild_write_node_drop_down()
index = self.write_node_box.findData(settings.write_node_selection)
if index >= 0:
self.write_node_box.setCurrentIndex(index)
else:
self.write_node_box.setCurrentIndex(0)

self._rebuild_views_drop_down()
index = self.views_box.findData(settings.view_selection)
if index >= 0:
self.views_box.setCurrentIndex(index)
else:
self.views_box.setCurrentIndex(0)

self.proxy_mode_check.setChecked(settings.is_proxy_mode)

Expand Down

0 comments on commit 1175cc9

Please sign in to comment.