PDA

View Full Version : problems with selecting obj in scene through textscrollList


boulba
10-10-2010, 10:17 PM
I have looked at a couple of similar topics here, but cant find a spec answer to my problem.

I use a python script that loads obj, in my case lights, into a textscrolllist and they get listed by name. Loading them in the beginning is no problem. The big problem is that i would like to select ind. obj in the scene dep. on what obj(name) i have selected in the textscrolllist and them then delete that obj from the first textscrollList and add them to another textscrollList. I do not want to decide in the script which light that should be selected.

I think it has something to do with this line:
str selLight[]=textScrollList q=si='aLightList';

I think I know what the line is intended for, but I dont get the structure.

Its the only part of the script i dont get, so some help would be greatly appreciated!

boulba
10-11-2010, 01:53 AM
problem solved!

NaughtyNathan
10-11-2010, 10:07 AM
please post your solution boulba, as it may be of help to future visitors and also ensures this entire post isn't a pointless waste of forum space.

boulba
10-11-2010, 07:32 PM
oh, sorry. of course.

I had to structure the for loop differently ans the calling line.
Here is the code for the whole function. Its was the first two lines that was the problem.

selLight=cmds.textScrollList('aLightsList',q=1,si=True)
for sItem in selLight:
cmds.textScrollList('aLightsList',e=1,ri=sItem)
print sItem+'has been moved'
cmds.select(sItem)
cmds.setAttr(sItem+'.intensity',0)
cmds.textScrollList('nonaLightsList',e=1,a=sItem)

CGTalk Moderation
10-11-2010, 07:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.