Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

MEL to change multiple shaders Subsurface Settings from V1 to V2

Dunndor
Enthusiast
Enthusiast

MEL to change multiple shaders Subsurface Settings from V1 to V2

Dunndor
Enthusiast
Enthusiast

I am doing some work involving importing Speed Tree Trees into maya. When imported they are all Arnold  two sided shaders with Standard Surface plugged into each input and they are all set to Randomwalk 1 (subsurfaceType 1) when i need all of them to be RandomwalkV2 (subsurfaceType" 2) . I am trying to find an easy way to convert them without having to select each two sided shader then selecting each input and changing each and every one. I figured mel would be the best and quickest bet....but the downside is, don't know mel at all...... there's over 30 trees and 40 shaders per tree....if anyone can help id be really grateful. 

0 Likes
Reply
194 Views
1 Reply
Reply (1)

AssassinKKD
Participant
Participant

 

import maya.cmds as mc

shaders = mc.ls(type='standardSurface')
if shaders:
    for each_shader in shaders:
        mc.setAttr(each_shader+'.aiSubsurfaceType', 2)

 try this code , this is python code and no need to select anything, just run from script editor under python tab

0 Likes