I’m running into an issue where I want to set the values of a few parameters with python… for instance, I’m able to set the value of the Display View combo box in the viewer preferences… but the viewer does not reflect the color space change… same with trying to set the PAR SpinBox under the clip parameters… if I change the value in the ui, the viewer updates… but when I change via python it does not…
I’ve tried this with the parameter api and just accessing the Qt widget directly… any insight?
it doesn’t look like any signals are connected to the widgets either… am I missing something about the proper way to handle changing ui values in Mocha?
as an example… this successfully changes the value in the combobox… but the viewer does not update the color…
import mocha
from PySide2.QtWidgets import *
app = QApplication.instance()
widgets = app.allWidgets()
combos = filter(lambda wgt: isinstance(wgt, QComboBox), widgets)
for widget in combos:
if widget.objectName() == 'displayViewCombo':
widget.setCurrentText('sRGB (ACES)')
It’s possible the setting of the interface is not actually updating the change immediately. If you click inside the viewer after the change, does the view update?
Thanks. I’m going to check in with the dev team as there should be a way to force this. Normally just changing the value via parameter() values is enough (probably the preferred way to do it), but it doesn’t appear to be updating the view.
Sorry Ryan, not yet. I’ve tested your situation and I can reproduce it so this may be a bug.
I’ll poke the dev team again and see if I can find a workaround.