Created
September 25, 2024 06:52
-
-
Save CGArtPython/3951a2aba0b14ef1b4090e5c8ad516dd to your computer and use it in GitHub Desktop.
Save only a material into a blend file
This file contains hidden or 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 | |
# Specify the material name | |
material_name = "ExportThisMaterial" | |
# Get the material from the current blend file | |
material = bpy.data.materials.get(material_name) | |
if material: | |
# add only the material to the blend new file | |
bpy.data.libraries.write(filepath="E:\\tmp\\material.blend", datablocks={material}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment