So I’ve added some widgets in the Publisher (Houdini) to submit stuff to the farm.
I’m fetching data (pools, groups, etc) out of Deadline and populate some comboboxes in the Publisher to give the artists some more freedom in the Publishing/Submission process.
So all the widgets populate nicely and everything works as expected.
But only when the user clicked the publish item on the left do display it’s custom widgets.
If I have for instance 4 items on the left and I hit Publish without having displayed it’s widgets, the publish fails and after some digging it appears the values out of the comboboxes are not there when we haven’t displayed them in the UI.
As soon as I clicked all the items on the left to display their custom widgets, the publish works.
Is there are way to force the values to be present even if we having changed them?
So my code looks something like this (pretty simple):
def create_settings_widget(self, parent):
self.cbx_widget = DeadlineArgs(parent, self.parent.shotgun)
return self.cbx_widget
def get_ui_settings(self, widget):
return {"render_pool": widget.pool_selection}
def set_ui_settings(self, widget, settings):
pool = setting_block.get("render_pool")
if pool:
widget.pool_selection = pool
def __init__(self, parent, sg):
super(DeadlineArgs, self).__init__(parent)
self.__populate_pools(sg, self.pool_cmbx)
self.__setup_ui()
@property
def pool_selection(self):
index = self.pool_cmbx.currentIndex()
return self.pool_cmbx.itemData(index)
@pool_selection.setter
def pool_selection(self, value):
index = self.pool_cmbx.findData(value)
self.pool_cmbx.setCurrentIndex(index)
def __populate_pools(self, sg, combobox):
#First we manually add our prefered group, so it's selected by default
combobox.addItem("gpu-farm", "gpu-farm")
# Now add all the found pools to the pool combo box.
for pool in pools:
if not "gpu-farm" in pool:
combobox.addItem(pool, pool)
You are using it in the setter, but that only gets set conditionally
if pool:
...
Did you try to set the default in settings to gpu-farm? This would probably work.
In set_ui_settings, you probably haven’t set an item yet in the settings.
(the code formatting makes it a bit difficult to read. Use triple backticks to start and end the block)
Aah yeah, thanks for the heads up about the code blocks.
In the settings I set it to None and populate the first entry in the combobox in the populate function.
I tried setting it in settings, but couldn’t get it to work.
If I try something like {‘pool’: ‘gpu-farm’}, it doesn’t work.
Or just “gpu-farm” also doesn’t work.
"type": "dict",
"default": None,
"description": "Sets the Deadline Render pool.
Yeah, they are passed as strings. But I’m handling that later in the process.
I’m just wondering what the syntax for dicts in the settings should be.
I recon just something like {“pool”: “gpu-farm”}
So I’m just adding the items to the combobox like this:
def __populate_pools(self, sg, combobox):
#First we manually add our prefered group, so it's selected by default
combobox.addItem("gpu-farm")
# Now add all the found pools to the pool combo box.
for pool in pools:
if not "gpu-farm" in pool:
combobox.addItem(pool)