Is there a way to get the mesh used by an object?

Is there a way to get the mesh used by an object? i.e. something like “bpy.data.objects[‘Cube’].mesh”?

(Also in the blender interface, is there a way to list all meshes, even if they aren’t used by any object?
edit: Just found it: Outliner->Datablocks->Meshes)

dig here… http://www.blender.org/documentation/blender_python_api_2_63_12/bpy.types.html

The mesh is the data part of a mesh object


import bpy

cube = bpy.data.objects.get("Cube")
if cube is not None:
    print(cube.type)
    cube_mesh = cube.data
    print(cube_mesh)

similarly for other objects like armatures, curves and speakers.

Thanks. :slight_smile: