I like to keep my scenes clean. Much of my Blender life is spent naming an object, copying the name and pasting the same object name into the mesh data name. Is there a quick way of doing this (or an add-on out there) where I can name a single-user mesh and the mesh data will be replaced with the same name?

  • $\begingroup$ There's addon which probaly does something similar. $\endgroup$ – Mr Zak Feb 12 '16 at 19:13
  • $\begingroup$ I already have Name Panel by Proxe, which should do the same thing, but without documentation, I just haven't take the time to figure out how to do that yet. $\endgroup$ – Bryson Jack Feb 12 '16 at 19:16
  • $\begingroup$ As I tried it you select objects, Space > Mesh To Object name (unfortunately script doesn't have explanation where to find it in UI but I think Space menu was intended). The downside is that you should remember which command to type. $\endgroup$ – Mr Zak Feb 12 '16 at 19:18

My answer is a tip rather than a true solution, but it may save your time a bit. Instead of copying and pasting you may just click on the object's icon and drag it to the mesh datablock window.

enter image description here

  • $\begingroup$ That is slightly faster than hover Ctrl+V then hover Ctrl+P, thanks...I will use that as my new workflow if it is the best answer that comes up. I had no idea you could do that. $\endgroup$ – Bryson Jack Feb 12 '16 at 19:12
  • $\begingroup$ Wow that is fantastic, I've been using blender for a few years and never knew about that one, great tip! $\endgroup$ – Duarte Farrajota Ramos Feb 12 '16 at 23:33

Well I've had the same problem for quite a while, I like keeping my scenes clean and objects well named and always spend considerable amount of time doing so. There are quite a few addons around that make the task easier though.

  1. Name Panel addon is my favorite and combines a name panel on the properties shelf of the 3D view with a fantastic batch renaming tool for renaming and name copying en mass
  2. There is also Batch Rename Datablocks which also works quite well albeit a little simpler.
  3. And also Batch Naming which doesn't copy names but also does batch renaming

And if you want to change the name through Blender's Python API you can run the following:

bpy.ops.object.select_all(action='DESELECT') # Deselect everything in the scene
bpy.context.scene.objects['oldMeshName'] # Select the mesh whose name is going to change
bpy.context.scene.objects.active.name = 'newMeshName'
bpy.context.scene.objects.active.data.name = 'newMeshName'
  • 3
    $\begingroup$ One liner: bpy.context.active_object.data.name = bpy.context.active_object.name $\endgroup$ – brockmann Feb 21 '18 at 11:01
  • $\begingroup$ Note that you don't select the mesh with bpy.context.scene.objects['oldMeshName'], it needs to be stored in a variable at least and also can be written as: bpy.data.objects['Cube'].data.name = bpy.data.objects['Cube'].name. Next thing is that if you are referencing the active object you don't need to deselect all objects in the scene. $\endgroup$ – brockmann Feb 21 '18 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.