` This is the function that i wrote the operation, where om = optionMenu
def selection(*args):
selected = cmds.optionMenu(om,sl=True, q=True)
cmds.textScrollList(tsl, e=True, removeAll=True)
for item in temp[selected]:
cmds.textScrollList(label=item, parent=om)
`
So basically I have object types in the OM and all the objects in TSL, I wanna display items of only selected object types from OM, for example if I select "mesh" in the OM the TSL will display only mesh objects.
where OM = optionMenu and TSL - textScrollList
to get a qualified answer, you should provide a minimal executable script. And you did not write what exactly does not work. Please describe exactly what errors you get. What I can see is that you create a list of textScrollList ui elements instead of filling the existing text scroll list. A complete solution can look like this:
I use a class here because it is easier to maintain and to keep all data inside.