Try this out. They are represented as connections:

for layer in cmds.ls(type="renderLayer"):
    print layer
    src = "%s.renderPass" % layer
    r_passes = cmds.listConnections(src, s=False, d=True, plugs=True, 
type="renderPass")
    if not r_passes:
        continue
    for r_pass in r_passes:
        name = r_pass.split('.', 1)[0]
        print "\t", name


On Dec 7, 2013, at 8:11 AM, [email protected] wrote:

> I know that it is possible to list all the Layers in a maya scene, and all 
> the (possible) RenderPasses with the following:
> 
> print
> print
> print "ALL Layers:"
> AllLayers = cmds.ls(type='renderLayer')
> for ThisLayer in AllLayers:
>    print "  " + ThisLayer
> print
> print "ALL Passes:"
> AllPasses = cmds.ls(type='renderPass')
> for ThisPass in AllPasses:
>    print "  " + ThisPass
> 
> 
> 
> However, I'm looking for a method for show the Layer to which a Pass is 
> associated (in maya, the Associated Passes for each layer). Something that I 
> can then display as of:
> 
> FirstLayer
>  FirstPass
>  SecondPass
>  ThirdPass
> SecondLayer
>  FirstPass
>  SecondPass
> 
> Is there a method of showing this association?
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/d69884bc-476a-4da8-8ba2-b3e022154e90%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/9D313CAD-186D-4CE4-92D4-E2CB69CF82BB%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to