Due to the lack of a class diagramm I need to explore the data structures by dumping objects to see what is in there.

How can I dump the Objects internals to the console?

In this snippet I tried to print the objects but I only get error messages 'TypeError'

def assignPose( plIdx ):
    rig = bpy.data.objects.get("rig")

    if rig != None:
        print("rig=" + str(tuple( rig ))) # TypeError: 'Object' object is not iterable
        print( "" + rig.__str__ )         # TypeError: Can't convert 'method-wrapper' object to str implicitly
        pl = rig.pose_library
        pl.poselib_apply_pose( plIdx )
        print("couldn't find rig.")
  • $\begingroup$ What do you want to see as output exactly? If you want bones of the rig try tuple(rig.data.bones). If you want to get names of properties of rig itself, try dir(rig) $\endgroup$
    – mg007
    Jul 18, 2013 at 6:55
  • 1
    $\begingroup$ Pure Python questions like this are better placed over at Stack Overflow. As you've found, there are many pre-existing ones there too, here's another: How do I look inside a Python object? $\endgroup$
    – Aldrik
    Jul 18, 2013 at 9:37
  • $\begingroup$ @Aldrik I had to try several approaches since not all of them work with blenders data structures, so I posted the answer to document this for later reference. $\endgroup$
    – stacker
    Jul 18, 2013 at 10:42
  • $\begingroup$ @stacker Python has built-in functions to do what your after, see link in previous comment. $\endgroup$
    – Aldrik
    Jul 18, 2013 at 11:32

2 Answers 2


I found a solution to get started:

def dump(obj):
   for attr in dir(obj):
       if hasattr( obj, attr ):
           print( "obj.%s = %s" % (attr, getattr(obj, attr)))

This is based on one of the methods suggested on this Stackoverflow post and this

Instead of invoking print call dump( anyobject )

This would print something like:

obj.copy = <bpy_func Object.copy()>
obj.cycles_visibility = <bpy_struct, CyclesVisibilitySettings("")>
obj.data = <bpy_struct, Armature("rig")>
obj.delta_location = <Vector (0.0000, 0.0000, 0.0000)>
obj.delta_rotation_euler = <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'>
obj.delta_rotation_quaternion = <Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0
obj.delta_scale = <Vector (1.0000, 1.0000, 1.0000)>
obj.dimensions = <Vector (0.0000, 0.0000, 0.0000)>
obj.draw_bounds_type = BOX
obj.draw_type = WIRE
obj.dupli_faces_scale = 1.0
  • 2
    $\begingroup$ Please add a reference (stackoverflow.com/a/192184/155813 ?) from where you found the solution, so that others can explore related solutions/comments. $\endgroup$
    – mg007
    Jul 18, 2013 at 7:06
  • $\begingroup$ @mg007 Good idea, added a reference btw. this was the only one working with blenders objects. $\endgroup$
    – stacker
    Jul 18, 2013 at 8:19
  • 1
    $\begingroup$ I've built off this idea and extended it to do some recursion / memo-ization: blender_dumpy.py - example snippet from the Race Spaceship demo: gist snippet $\endgroup$ Oct 19, 2019 at 0:42

There is already an addon called API Navigator to explore the API. It has to be enabeld first in the User Preferences

enter image description here

enter image description here

  • $\begingroup$ Looked for this in 2.80, but guessing it may not be maintained :( See above comment for my hacky workaround based on object enumeration. $\endgroup$ Oct 19, 2019 at 0:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .