Skip to content

Instantly share code, notes, and snippets.

@Miouyouyou
Created March 7, 2021 16:53
Show Gist options
  • Save Miouyouyou/6fbd1fcee8577059d2464bbc5f624421 to your computer and use it in GitHub Desktop.
Save Miouyouyou/6fbd1fcee8577059d2464bbc5f624421 to your computer and use it in GitHub Desktop.
Blender : Save all shaders texture images nodes to the disk
import bpy
from pathlib import Path
out_folder_path = "C:\\temp\\"
for mat in bpy.data.materials:
tree = mat.node_tree
if tree:
for node in tree.nodes:
if type(node) == bpy.types.ShaderNodeTexImage:
image = node.image
if image:
fname = Path(image.filepath).parts[-1]
out_path = out_folder_path + fname
image.save_render(out_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment