I have lot of geometry in my scene. So as you might imagine I found the task of manually renaming everything ‘a bit of a do’.
So this is what I did.
- Made a list of all the meshes object to replace the meshes on.
- Made a script to print out the selected model name.
Made a script to iterate though all objects in the scene and if the name matches change the mesh data.
Here is the script to print out the object names:
import bpy
#show the name of the selected object
for o in bpy.data.objects:
if o.select:
#o.data = mesh
print(o.name)
Here is the script to link in a new mesh:
import bpy
# the name of the mesh to copy to all selected objects
mesh = bpy.data.meshes["LodA_Wall3x4x.2"]
for o in bpy.data.objects:
if o.name.startswith("Wall3x4x.2"):
o.data = mesh
print(o.name)
After each mesh change I made a commit and in the end a final push to github.