Re-iterates all the selection

I was wondering if it is possible to re-select each and every item in the rsList?
I am citing a simple example below but I am looking at hundreds of items in the scene and hence below are the simplest form of coding I am able to come up with base on my limited knowledge of Python

    rsList = cmds.ls(type='rexShaderSrf')
    # Output: [u'pCube1_GenShdr', u'pPlane1_GenShdr', u'pSphere1_GenShdr']

I tried using the following cmds.select but it is taking my last selection (in memory) - pSphere1_GenShdr into account while forgetting the other 2 even though all three items are seen selected in the UI.

Tried using a list and append, but it also does not seems to be working and the selection remains the same…

    list = []
    for item in rsList:
        list.append(item)
        cmds.select(items)
        #cmds.select(list)

As such, will it be possible for me to perform a cmds.select on each of the item individually?

really dont under stand your problem since you can provide cmds.select() a list and it will select them all.

But if you really want to do it individually you can use cmds.select(reList, add=True)

all the parameters for select() are right here.

http://download.autodesk.com/us/maya/2010help/CommandsPython/select.html

[QUOTE=passerby;24912]really dont under stand your problem since you can provide cmds.select() a list and it will select them all.

But if you really want to do it individually you can use cmds.select(reList, add=True)

all the parameters for select() are right here.

Hi passerby, the situation is like this : rexShaderSrf - they are custom shaders but for some reasons, unless I manual select each and every shaders, I am getting black renders. If I am using my above code, though it prints and highlights all 3 in hypershade, when re-rendering again, it only renders out the last selection in the list. So unless I have to re-select the other 2 manually, will I then be able to get the right render. And hence, I thought that there may be some ways to do a force selection again for all the items in the list

I also did try out cmds.select(rsList, add=True), or cmds.select(rsList, r=True) both did not help at all

sounds like you have some serious problems with your custom shader.

[QUOTE=rgkovach123;24914]sounds like you have some serious problems with your custom shader.[/QUOTE]

Yes I’m afraid so, if it can be resolved within Maya I will be more glad to troubleshoot it. :frowning:

And yet, it seems to be working if I am importing the shader via from another maya file but it does not works if it is created within the maya scene, despite both shaders in these 2 files are the same