MochaPro2021 python set combo box value

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)')

Hey Ryan @ryan1 , are you running Mocha inside the host, or as a Standalone?

I am going to flag @martinb on this, due that python coding is not my strongest part.

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?

No nothing I seem to do in the interface (clicking around in tbe viewer or changing frames ) registers the change…


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.

I’ll report back.

Thanks Martin… I appreciate it

Hey Martin… figure anything out over there?

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.

The bad news is this does indeed look like a bug. You can set the value and it changes the interface but it’s not registering as an action.

I’ll flag a defect report for this.