Created
April 12, 2016 10:04
-
-
Save Pullusb/c0fdb29ddf0d338bcbd021b68f5bea51 to your computer and use it in GitHub Desktop.
Blender - mirror names for any object
This file contains 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 | |
#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