Beispiel #1
0
 public static void RenameTextures(MSelectionList list)
 {
     if (list == null)
     {
         Debug.Log("list null");
         return;
     }
     for (int i = 0; i < list.length; i++)
     {
         MObject mo = new MObject();
         list.getDependNode((uint)i, mo);
         MFnDependencyNode imageNode = new MFnDependencyNode(mo);
         MPlug             plug      = imageNode.findPlug(ConstantValue.plugName_fileTexPath);
         string            filePath  = plug.asString();
         Debug.Log("filePath:" + filePath);
         string fileName = BasicFunc.GetFileName(filePath);
         Debug.Log("fileName:" + fileName);
         imageNode.setName(fileName);
     }
 }