cwisbg

change texture info

Aug 29th, 2018
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #change texture info
  2. from pymel.core import *
  3. sl = selected()
  4. matTypeList = ["lambert","blinn","phong"]
  5. fileType = "jpg"
  6. for s in sl:
  7.     sg = s.getShape().listConnections()[0]
  8.     sM = sg.listConnections(type = "lambert")[0]
  9.     sT = listConnections(str(sM)+".color")
  10.     sTfile = getAttr(sT[0]+".fileTextureName")
  11.     sTfile = sTfile[:-3]+fileType
  12.     setAttr(sT[0]+".fileTextureName", sTfile)
  13.     print sTfile
Advertisement
Add Comment
Please, Sign In to add comment