Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fereria
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/f1f04e9b347f3d7622fc to your computer and use it in GitHub Desktop.
Save fereria/f1f04e9b347f3d7622fc to your computer and use it in GitHub Desktop.
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