I know that a list of math functions can be found on this site

But how about functions such as

  • obj.data.materials.clear()
  • obj.data.materials.append()
  • len(obj.data.polygons)
  • .normal or
  • .length ?

I have always wondered whether there was an overview or list or whatnot for these functions.


These functions (or rather methods, properties and attributes) you are asking for are blender-specific, thus part of the Blender Python API (a.k.a. bpy) - just to clear it up. For standard python module features, please refer to the official python docs.

.polygons, .length etc. are properties of certain Blender type instances (objects). To find out what they do and which features are available, you need to check out the bpy API docs for a particular type (class).

There is a page in the docs about how to use the docs:
Blender/Python API Reference Usage: examples of how to use the API reference docs


.polygons is a property of the type bpy.types.Mesh.

It is a type on its own, MeshPolygons, > which has an .active property and an add() method.

If you use the slice notation on .polygons, you will get elements returned of a bpy_prop_collection. The element type is MeshPolygon. A MeshPolygon has i.e. a .normal property in turn.

As you can see, the methods and properties are not found in a single place. The most valuable information is hidden in the bpy.types section of the docs. You can use the online search, or use Blender's built-in Python Console with auto-complete to figure out what is where. You can also find out the type and search for it in the API docs by adding bl_rna.identifier to an object:

>>> bpy.context.object.data.bl_rna.identifier

>>> bpy.context.object.data.polygons.bl_rna.identifier

>>> bpy.context.object.data.polygons[0].bl_rna.identifier

Prepend bpy.types. and you have your type to lookup in the docs!

| improve this answer | |

An API navigator can be enabled under File > User Preferences > Addons, Supported Level: Development, search for API navigator.

Change a window to the text editor and in the properties panel (CtrlT) there will now be a foldable menu called API Navigator.

Hope it helps =)

enter image description here

Also... if you right click any UI element and click Edit Source, the code will be displayed in this editor (unless it's from C code, you'll see a message in this case)

| improve this answer | |
  • $\begingroup$ and of coarse if you dont understand the code you see there, codeman has pointed to the official docs, which can be cross-referenced with the actual source to obtain a more complete understanding of whats going on... i honestly never use the API nav, mostly because i get distracted from actually doing what i mean to do and end up just browsing the api.... for hours on end... which would be fine if i was trying to learn python... but i want to model, not code... lol $\endgroup$ – Konner Rasmussen Mar 27 '14 at 0:56

While you can easily get a list of operators I don't think anyone has done the same for all of blender. It would probably be too large anyway.

There is help available directly from python, you can use blender's Python console to access it. Starting with the autocomplete feature, typing in obj.data.materials. and pressing the Autocomplete button ( or CtrlSpace) will list all items available, even having entered D.objects[' autocomplete will list available object names.

The next option is listing all class attributes, which is methods and variables, so entering dir(C.active_object.data.materials) into the console gives you -

['__bool__', '__contains__', '__delattr__', '__delitem__', '__doc__', '__doc__',
'__getattribute__', '__getitem__', '__iter__', '__len__', '__module__', '__setattr__',
'__setitem__', '__slots__', 'append', 'bl_rna', 'clear', 'find', 'foreach_get',
'foreach_set', 'get', 'items', 'keys', 'pop', 'rna_type', 'values']

Names surrounded by double underline are 'builtin' implementations as defined by python - eg __len__ is the function called when you use len(C.active_object.data.materials)

Currently of limited use (the scrollback length in the console is too small) is the help function. eg help(C.active_object.data.materials) will output -

Help on bpy_prop_collection object:

class bpy_prop_collection(bpy_prop)
 |  Method resolution order:
 |      bpy_prop_collection
 |      bpy_prop
 |      object
 |  Methods defined here:
 |  __bool__(...)
 |      x.__bool__() <==> x != 0
 |  __contains__(...)
 |      x.__contains__(y) <==> y in x
 |  __delattr__(...)
 |      x.__delattr__('name') <==> del x.name
 |  Methods inherited from bpy_prop:
 |  __dir__(...)
 |  __eq__(...)
 |  __ge__(...)
 |  Data descriptors inherited from bpy_prop:
 |  data
 |      The data this property is using, *type* :class:`bpy.types.bpy_struct`
 |  id_data
 |      The :class:`bpy.types.ID` object this datablock is from or None, (not available for all data types)
 |  rna_type
 |      The property type for introspection
 |  Data and other attributes inherited from bpy_prop:
| improve this answer | |

You can also use the Operator Sheat Sheet under Help in Blender.

When you open the Text Editor there is a list with all install operator

| improve this answer | |
  • 1
    $\begingroup$ Thanks for your answer mkb, but that's what @sambler already said. $\endgroup$ – p2or Mar 22 '15 at 18:09

For every python object there are two functions that everybody should know about - dir and help they do what they say on the box so for anything you can type in the console dir(theobject) to get a list of methods and help(theobject.somemethod) to get the help information. These are python builtin functions that should work everywhere.

Note that any members that start with one or more underscores (_) are private and should not be relied on to be available or the same in future or later versions.

| improve this answer | |
  • $\begingroup$ I was going to write this answer before I saw it here. I guess people wanted a more user-friendly interlace $\endgroup$ – Nathan Aug 11 '18 at 15:59

Your Answer

