Created
March 7, 2021 16:53
-
-
Save Miouyouyou/6fbd1fcee8577059d2464bbc5f624421 to your computer and use it in GitHub Desktop.
Blender : Save all shaders texture images nodes to the disk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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