Created
August 6, 2023 12:46
-
-
Save Taremin/5f74227153413b6c5e2883725eee81f5 to your computer and use it in GitHub Desktop.
UVMapの名前を正規表現でリネームするBlenderスクリプト
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 | |
import re | |
pattern = re.compile(r'^Bake(?:\.\d{3})?$') | |
new_name = "BakeUV" | |
for obj in bpy.data.objects: | |
if obj.type != "MESH": | |
continue | |
for uv_layer in obj.data.uv_layers: | |
if pattern.search(uv_layer.name): | |
uv_layer.name = pattern.sub(new_name, uv_layer.name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment