Skip to content

Instantly share code, notes, and snippets.

@Psyda
Created September 26, 2022 20:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Psyda/132366bba6c55e010852a2dd54a34c62 to your computer and use it in GitHub Desktop.
Save Psyda/132366bba6c55e010852a2dd54a34c62 to your computer and use it in GitHub Desktop.
This script changes every reference to an image in a Blend file from .png to .jpg. Useful for linking to compressed images
import bpy
for img in bpy.data.images:
img.filepath = img.filepath.replace('.png', '.jpg')
img.name = img.name.replace('.png', '.jpg')
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