Create a gist now

Instantly share code, notes, and snippets.

@fereria /getUseTexture.py Secret
Last active Aug 29, 2015

Embed
import pymel.core as pm
def getUseTextureThisGrp(grp):
if isinstance(grp,str) == True:
grp = pm.PyNode(grp)
shapes = grp.listRelatives(ad=True,type="mesh")
files = []
for i in shapes:
sEngines = i.connections(type="shadingEngine")
for s in sEngines:
shaderList = s.surfaceShader.connections()
for shader in shaderList:
fNode = shader.connections(type="file")
for tex in fNode:
files.append(tex.fileTextureName.get())
files = list(set(files))
return files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment