Hello,
I am a student in college and i have been studying scripting, mostly python. I was working on a tool set just for practice and i added a text scroll list to it and i wanted it to query all the keyable attributes on a selected item and put them on the list. I got that working but then when i wanted to use the list to lock and hide selected attributes i reaized that translateX means nothing. So i was trying to set it so when it builds the list it would take the name of the selected object and put objName.attr for each entry. That is where i ran into a problem. I am running a str variable to pull the selected object and then running a for loop to go through and add the attributes. But when i do that here is the error i recieve
# TypeError: can only concatenate list (not "str") to list #
And here is my code i am running.
def add():
#Add to Attr List
cmds.textScrollList("Attr", e=1, ra=1)
selected = cmds.ls(sl=1)
for sel in selected:
attr = cmds.listAttr(sel, k=1)
final = str(selected + "." + attr)
cmds.textScrollList("Attr", e=1, append= final)
EDIT: Also it is ment to run one item at a time, so maybe the loop is not needed, but from tests that isnt the cause of the problem.