Create a New Mesh Object Using Python Code and Add It to the Mesh Menu, A Blender Scripting Tutorial

Опубликовано: 15 Март 2026
на канале: AI generated free movies
22,659
255

This tutorial shows how to make a new mesh object using a Python script. The script is developed from one of the Python templates.

In the script, the position of the vertices of the new object are specified. The vertices are numbered, a sequence of vertices defines a face (a face loop).

In the example script, eight vertices and six faces define a new object that is the shape of a house brick.

The script will also work as an Add-on.

The tutorial starting point is the Python template - Addon Add Object

The tutorial shows how -
to change the add-on information
to put the positions of the vertices in an array.
to put sequences of vertices in an array, to define faces.
the geometric data, the geometry, is added to a mesh data-block.
the mesh data-block is used to make a new object.
to put the code in a new operator class.
to add the operator to the Add - Mesh menu

The finished file can be downloaded from the following link -

http://blender.freemovies.co.uk/blend...

Both the finished file and the listing can be downloaded from my website -

http://blender.freemovies.co.uk