Skip to content

Instantly share code, notes, and snippets.

@Taremin
Created August 6, 2023 12:46
Show Gist options
  • Save Taremin/5f74227153413b6c5e2883725eee81f5 to your computer and use it in GitHub Desktop.
Save Taremin/5f74227153413b6c5e2883725eee81f5 to your computer and use it in GitHub Desktop.
UVMapの名前を正規表現でリネームするBlenderスクリプト
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