0
$\begingroup$

I can't believe I have to ask this, but where do I find an actual API reference for Blender scripting? I just can't seem to find one. I see tutorials but no proper reference documentation.

For instance, this page feels like it should be giving me a list of all the members of bpy.data but I don't see any way to get that information. The "next" button just takes me to the next section, and "modules" takes me somewhere else entirely.

What am I missing?

EDIT: The linked dupe DOES NOT answer the question. Clearly you did not read my question. I can't find the ACTUAL API REFERENCE. I don't understand why this is so complex to answer.

How do I know what each "class" (or whatever the python equivalent is) member variable and function is?

$\endgroup$
  • 1
    $\begingroup$ Have you looked at docs.blender.org/api/current/index.html ? $\endgroup$ – stphnl329 Jan 11 at 23:23
  • 1
    $\begingroup$ Or this one if you need "newest" docs.blender.org/api/blender2.8 $\endgroup$ – Hikariztw Jan 11 at 23:39
  • $\begingroup$ And also writing a documentation is a huge job and not that necessary. Blender as an opensource project including all those function, it is hard to keep documentation good as other software like Unity or Javascript, they both make effort on their documentation. $\endgroup$ – Hikariztw Jan 11 at 23:44
  • $\begingroup$ @stphnl329 That's the same page I linked, only for 2.8. How do you actually find an API reference from there? As in.... I don't even know how to describe. Those pages are not API reference. Like.... for instance, with Unity I can see the Transform class. docs.unity3d.com/ScriptReference/Transform.html From there I can see every member variable and function available. How do I find that same sort of thing for Blender? $\endgroup$ – Clonkex Jan 11 at 23:47
  • 1
    $\begingroup$ In the "for instance" 2.77 documentation link posted above you overlooked =====> Type: bpy.types.BlendData <===== $\endgroup$ – batFINGER Jan 12 at 1:28
1
$\begingroup$

Look for class members, (properties, methods et al), in the classes doc page.

bpy.data is a reference to an instance of the bpy.types.BlendData class. All the members of that class will be found in the documentation page for the class (or type),

Most python documentation, I am familiar with, is organized this way, and has often, as is the case here generated from the source.

There may be many references , in this example scrolling down to reference section see that context.blend_data is also an instance of bpy.types.BlendData. Note Even though context.blend_data and bpy.data are both of the same type and for this case mostly the same object, but it is not necessarily so. Might start using me = context.blend_data.meshes.new(...) for methods where context is passed.

A type with numerous references is the blender object. bpy.types.Object for instance the context object of any blender object type. The target of a driver, modifier, constraint on an object. A member of a collection: blend data objects; collection objects or scene objects etc etc etc etc.

Blender uses the convention: names of properties and methods are in lower case, classes in title case. eg bpy.types.WindowManager is a class (being in bpy.types is a bit of a give away too), bpy.context.window_manager an instance of it.

Turn on developer extras to get an API link by right clicking on a property.

$\endgroup$
  • 1
    $\begingroup$ Note; for some functions, right clicking and copying data path / looking up the API reference doesn't always give you the right path. $\endgroup$ – asoftbird Jan 12 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.