Skip to content

Instantly share code, notes, and snippets.

@robomojo
Created April 16, 2013 21:56
Show Gist options
  • Save robomojo/5399987 to your computer and use it in GitHub Desktop.
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
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