Created
April 16, 2013 21:56
-
-
Save robomojo/5399987 to your computer and use it in GitHub Desktop.
For blender. Renames object using the objects' datablock name, seeking the original if detected. #blender #python
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 | |
for each in bpy.context.selected_objects: | |
newName = each.data.name | |
hasOriginal = each.data.name.find('.')>0 | |
if hasOriginal: | |
newName = each.data.name.split('.')[0] | |
each.name = newName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment