Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. Renames all texture files requiring graphic_multi to the correct extension.
  4.  
  5. _back -> _north
  6. _front -> _south
  7. _side -> _east
  8.  
  9. Place this file in your mod folder for it to work.
  10. @author: Spdskatr
  11. """
  12. import os
  13.  
  14. for root, dirs, files in os.walk("Textures"):
  15. for file in files:
  16. if file.endswith(".png") and "_back" in file or "_front" in file or "_side" in file:
  17. newName = file.replace("_back", "_north").replace("_front", "_south").replace("_side", "_east")
  18. os.rename(os.path.join(root, file),
  19. os.path.join(root, file.replace("_back", "_north").replace("_front", "_south").replace("_side", "_east")))
  20. print(file, "->", newName)
Add Comment
Please, Sign In to add comment