# Object data block question

Well, this isn’t really about Python, but I need to know about how the data is structured, so I can explain the basics of object and mesh data.

From what I can gather…

The object data block has a link to the mesh data block.

The mesh data block has locations of the vertices in ordered triples

It also has information about the faces, which vertices are used for which face, the UV information, and which material is associated with that face.

Is this a correct understanding?

Then there are some things I couldn’t find out.

Is the face data block separate from the mesh data block?

How/where are the edges stored?

Thanks.

Yes, try the API link …
the mesh contains, vertices, edges and faces.
cube = bpy.data.objects[‘Cube’] (the default one)
mesh = cube.data
dir mesh in the pythonconsole
and dir mesh.vertices
dir mesh.edges
dir mesh.faces

for el in mesh.vertices: print(el.select) or what a vertex ‘holds’ (eg. el.co for the Vector of it)
same for edges and or faces …

You can dig around in the blogspot link in my signature, plenty of handy information for learning this stuff. An object, for instance the default ‘cube’, can store a lot of information. If you are purely focussing on geometry then :

1 ) bpy.context.active_object has a data attribute

2 ) bpy.context.active_object.data has a link to the mesh object that it uses.
the mesh object contains information about vertices, faces. (geometry)

1. geometry.
• Vertices is a list from 0,1,…N with the coordinates of the vertices. Each vertex is indexed by the position inside that list.
• Edges in blender don’t necessarily have to be defined when you are creating geometry. (they can be derived from the result of faces)
• Faces, are made up by stringing 3 or 4 vertices (using their indices) in a certain order. their order will define what way the face normal will point.

If you are teaching this stuff, it might be worth your time to read the openGL redbook, especially the first 4 chapters

Thanks.

My teaching will be strictly aimed at the newbie blender user. We are not even getting into Python. But I wanted to be sure that I had the basic data structure correct.

Both of your answers helped me inspect the data in the Python window.

I also found something that really helped. I opened up the outliner and set the display for datablocks. That gave me the information I was seeking.