Skip to content

Instantly share code, notes, and snippets.

@spdskatr
Last active July 20, 2018 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spdskatr/d0cb17db9dfe23f58d8bbbeda1795845 to your computer and use it in GitHub Desktop.
Save spdskatr/d0cb17db9dfe23f58d8bbbeda1795845 to your computer and use it in GitHub Desktop.
Renames all texture files requiring graphic_multi to the correct extension. Place this file in your mod folder for it to work.
# -*- coding: utf-8 -*-
"""
Renames all texture files requiring graphic_multi to the correct extension.
_back -> _north
_front -> _south
_side -> _east
Place this file in your mod folder for it to work.
@author: Spdskatr
"""
from __future__ import print_function
import os
for root, dirs, files in os.walk("Textures"):
for file in files:
if file.endswith(".png") and "_back" in file or "_front" in file or "_side" in file:
newName = file.replace("_back", "_north").replace("_front", "_south").replace("_side", "_east")
os.rename(os.path.join(root, file),
os.path.join(root, file.replace("_back", "_north").replace("_front", "_south").replace("_side", "_east")))
print(file, "->", newName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment