Skip to content

Instantly share code, notes, and snippets.

@Psyda
Created February 17, 2023 11:02
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 Psyda/1a7b211f9adfef8288540dd6c83c3966 to your computer and use it in GitHub Desktop.
Save Psyda/1a7b211f9adfef8288540dd6c83c3966 to your computer and use it in GitHub Desktop.
Renames file extension paths from PNG to JPG. Also Tells the file to search for a folder called "Renamemetopackname" instead of the normal 4k folder.
import bpy
for img in bpy.data.images:
img.filepath = img.filepath.replace('.png', '.jpg')
img.name = img.name.replace('.png', '.jpg')
img.filepath = img.filepath.replace('4k', 'Renamemetopackname') #Rename that to whatever you renamed the 4k folder to. ie. CyberDistrict
img.name = img.name.replace('4k', 'Renamemetopackname') #Rename that to whatever you renamed the 4k folder to. ie. CyberDistrict
img.reload()
print("Done! Save your blend file!")
#When it's finished make sure everything looks correct and save the blend file with a new name ie > Save-As "Packname_jpg.blend"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment