Find out render layer material


#1

How to find out material from render layer what has assigned to it (ex :- Occlusion & Z_depth)


#2

i don’t really well understand what you want to get, but if you are looking for all materials that have connection to a specified layer:

layer = "layer1" # layername
mats = set()
for se in cmds.listConnections(layer,type = "shadingEngine"):
    mats = mats.union(cmds.ls(cmds.listConnections(se), mat=1)) 

which means find connected engines and their materials after that


#3

i want to find out the which materials connected to render layer (eg :- Occlusion render layer),i want the code in mel plzzzzz…


#4
string $layer = "layer1"
string $engines[] = listConnections("-type","shadingEngine", $layer)
string $matetials[] = ls("-mat", listConnections($engines))
$matetials = stringArrayRemoveDuplicates($matetials)

#5

Thnxs Dude its was helpful for me…