Proper Hierarchical View of the Classes?

Hi,

I’m trying to familiarize myself with the classes and methods but its a bit confusing navigating to the documentation.

For instance, take bpy.data.meshes. As I navigate to the bpy.data, I would expect the list of available classes such as curves, scenes and not only for meshes.

But when I navigate to the bpy.data. I get a one page code snippet. See illustration below:
dl.dropbox.com/s/8oyzf5nbfxjgzw9/BLEN17_hierarchy_of_classes.jpg

Later on, you’d actually have to look at bpy.types which is a separate page (not a parent or a child page) to see the meshes, curves and scenes.

If that is the case, why not have the code as bpy.types.meshes instead of bpy.data.meshes

Anyhow, maybe I’m just looking a hierarchy like this in C4D.

Is there an existing reference?

bpy.data would in my view be better described as an global variable rather then a pure module with function definitions, and being a variable the page only links to the type of that variable, which then contains the actual description of the object and it’s attributes (rather then a short example…). From there it’s fairly easy to see that bpy.data consist of attributes such as collections of curves, meshes, scenes etc. And each of the attributes provide futher links to relevant class/type definitions.

I guess it doesn’t answer the question but i think it at least gives an idea of how to navigate the API, and to my knowledge there does not exist a short heirarchy list similar to what you describe. There are however links to subclasses of each type in the documentation, but the structure is not really object oriented with objects inheriting from each other. Instead the structure is rather flat. Look at scene objects for example, the class definition does not have any subclasses, instead data objects are created separately and bound to the object during construction.

1 Like

@Osares Thanks for the clarification specially on this one:

but the structure is not really object oriented with objects inheriting from each other. Instead the structure is rather flat.

Coming from Cinema4D API, I was always on the look for an OOP workflow. At least this time, I know I’ll hit a wall.

Thanks again. Have a great day ahead!