home *** CD-ROM | disk | FTP | other *** search
/ Learning Maya 3 / Learning_Maya_3.iso / docs / mel_scripts / includes / listFileTextures.mel < prev    next >
Encoding:
Text File  |  2000-05-17  |  1.6 KB  |  45 lines

  1. //
  2. // Copyright (C) 1997-2000 Alias|Wavefront,
  3. // a division of Silicon Graphics Limited.
  4. //
  5. // The information in this file is provided for the exclusive use of the
  6. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  7. // and incorporate this code into other products for purposes authorized
  8. // by the Alias|Wavefront license agreement, without fee.
  9. //
  10. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  11. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  12. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  13. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  14. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. // PERFORMANCE OF THIS SOFTWARE.
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Original Author:  Michiel Duvekot
  22. // Modified:  Greg Brentin, 1/13/99
  23. //
  24. // Description: lists all file textures in a scene, and
  25. //     ouputs them to a user specified text file.
  26. //
  27. // Usage: listFileTextures "path/outputFileName";
  28. //         *the quotations are required*
  29. //
  30. // Example: listFileTextures "/h/smith/mylist.txt";
  31.  
  32. global proc listFileTextures (string $fileName) {
  33.     int $fileId = fopen ($fileName, "w");
  34.     string $textures[] = `listConnections defaultTextureList1`;
  35.  
  36.     for ($tex in $textures) {
  37.         string $fileTex = ($tex +".fileTextureName");
  38.         if (`objExists $fileTex`) {
  39.             print (`getAttr $fileTex` + "\n");
  40.             fprint ($fileId, `getAttr $fileTex` + "\n") ;
  41.         }
  42.     }
  43.     fclose $fileId;
  44. }
  45.