I have a VRML version of a PDB file imported into Blender.
Every geometric segment has its own material assigned even though the materials are identical. Can I select the objects by color instead of by material?
This simple script loops through the visible objects, and checks if the active object's diffuse color (blender internal) matches. If they do match, then that object gets selected.
Make sure the active object has a material with the color you want to merge. Then load the script below in blender's text editor and hit "Run Script".
After you run the script all you need to do is press CrtlL then M. Or from the 3D view header Object > Make Links... > Materials.
import bpy active = bpy.context.scene.objects.active bpy.ops.object.select_all(action='DESELECT') for obj in bpy.context.visible_objects: if obj.type == "MESH": if obj.data.materials.diffuse_color == active.data.materials.diffuse_color: obj.select = True active = bpy.context.selected_objects