Ben Traje
← Back to blender

How to List Image Texture Paths in Blender Using Python

25 Aug 26 (2mo ago)

Managing Blender Texture Paths

When working on complex 3D projects, you often accumulate a long list of image textures. Ensuring these textures use relative paths (which start with // in Blender) is critical before transferring project files or rendering on a different machine. Manually digging through the Image Editor to check if a texture is relative or absolute can be tedious, but you can automate the process using a short Python script.

The Python Script

The following script iterates through all the image data blocks currently loaded in your .blend file and outputs their exact names and source paths.

import bpy

def list_image_paths():
    print("-" * 60)
    for img in bpy.data.images:
        # Prints the Image Name and the absolute or relative path
        print(f"Image: {img.name}\nPath:  {img.filepath}\n")
    print("-" * 60)

if __name__ == "__main__":
    list_image_paths()

How to Run the Script

To execute the code and view your texture list, follow these quick steps:

  • Open the Text Editor: Switch any workspace panel in Blender to the Text Editor.

  • Paste the Code: Click New at the top of the editor and paste the Python script provided above.

  • Open the Console: Python print() commands output directly to Blender's system console.

  • Windows: Go to the top menu and select Window > Toggle System Console.

  • macOS / Linux: You must launch Blender directly from your Terminal to view the standard output logs.

  • Run It: Click the Run Script button (the play icon) located in the Text Editor header.

Check your console window, and you will see a neatly formatted list of every image and its file path, allowing you to easily spot any stubborn absolute directories!

Do you have any specific requirements for filtering the output, such as only printing paths that are absolute?