Hi guys, I’m a student doing a coding class, and we need to create a UI. Right now, I can’t for the life of me find out what is the line of code needed to tell PyMEL to identify what item is being selected in the textScrollList.
I want to make a function, such that when the item in the textscrolllist is being selected, it will also select the item with the same name in the scene/viewport.
Note: the items in the textscrolllist are being generated by the items in the scene.
Here’s what I’ve got so far:
def selectfromlist(*args):
…objectselected = ##I want to get the item being selected in the textScrollList, ‘lightnamelist’,##
…if objectselected is True: ##not sure if this is the right way to say it either##
…cmds.select(##the item in the scene with the same name as the item in the textScrollList##)
Does anybody know how to fix this?