A
A
atereffigies2021-09-19 15:17:01
Blender
atereffigies, 2021-09-19 15:17:01

How to get information about an object through a python script in blender?

First of all, I'm interested in how to get information about objects.
For example, there is a very ordinary cube, and I want to get the coordinates of all its vertices.
What do I need to do for this?
It seems to me that this should be quite simple, but it is not entirely clear to me how to get at least some information about the object. Moreover, if you create a method bpy.ops.mesh.primitive_cube_add(), then it returns . Those. there is no special object identifier. {'FINISHED'}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
atatereffigies, 2021-09-19
@atereffigies

In general, I figured it out myself.

# Возвращает экземпляр объекта по имени (в данном случае "Cube")
mesh = bpy.data.meshes["Cube"]
# Список вершин. Вершина имеет тип MeshVertex
verts = mesh.vertices
for v in verts:
  print(v.index, v.co)

Something like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question