Last active
September 4, 2017 09:13
-
-
Save caiwan/c7b21bce94106b400b6cb0250222afe8 to your computer and use it in GitHub Desktop.
Handy blender scripts
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
# quick add pbr texture names to properties | |
# used in grafkit2 | |
for material in bpy.data.materials: | |
for key in ["metalness", "normal", "roughness"]: | |
material["mat_{0}".format(key)] = "pbr_{0}_{1}.jpg".format(material.name, key) | |
# a bit refined version, which add emissive map if emission was set | |
for material in bpy.data.materials: | |
for key in ["metalness", "normal", "roughness", "emission"]: | |
if key == "emission" and material.emit < 0.0001: | |
continue | |
material["mat_{0}".format(key)] = "pbr_{0}_{1}.jpg".format(material.name, key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment