Skip to content

Instantly share code, notes, and snippets.

@Pullusb
Created April 12, 2016 10:04
Show Gist options
  • Save Pullusb/c0fdb29ddf0d338bcbd021b68f5bea51 to your computer and use it in GitHub Desktop.
Save Pullusb/c0fdb29ddf0d338bcbd021b68f5bea51 to your computer and use it in GitHub Desktop.
Blender - mirror names for any object
import bpy
#in armature you have mirror names
#this do the similar but for other objects (outside armatures)
def mirrorname(o):
if o.name[-5:-4] == "L":
o.name = o.name[:-5] + "R"
elif o.name[-5:-4] == "R":
o.name = o.name[:-5] + "L"
for o in bpy.context.selected_objects:
if o.name[-4:-3] == '.':
if o.name[-5:-4] == "L" or o.name[-5:-4] == "R":
mirrorname(o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment