Skip to content

Instantly share code, notes, and snippets.

@patwooky
Created January 23, 2017 05:39
Show Gist options
  • Save patwooky/6a117a6cae8c66ca09d078e216b0ae0a to your computer and use it in GitHub Desktop.
Save patwooky/6a117a6cae8c66ca09d078e216b0ae0a to your computer and use it in GitHub Desktop.
Search all file texture nodes in the scene and return nodes whole filenames contain a search texture file
from pymel.core import *
findTextureStr = 'concreteBrightMask.png' # the name of an image to search file names from
candidateNodesList = [x for x in ls(type='file') if findTextureStr in x.fileTextureName.get()]
print 'texture file found in these file textures:\n{}'.format(candidateNodesList)
select(candidateNodesList, replace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment