Created
February 24, 2015 19:16
-
-
Save lapaev/036178ef60f44b0ae6d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import maya.cmds as cmds import maya.OpenMaya as om import os #Changes the name of file nodes to their Image Name fileNodes = cmds.ls(textures=True) for f in fileNodes: cmds.select(f, replace=True) imageNameFull = cmds.getAttr(".fileTextureName") imageNameBase = os.path.basename(imageNameFull) imageName, imageExt = os.path.splitext(imageNameBase) cmds.rename(f, imageName) om.MGlobal.displayInfo("Changed name on all file Nodes") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment