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

preview_player
Показать описание
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 -

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

Рекомендации по теме
Комментарии
Автор

I vote for more! Some ideas for your future videos:
- how to make our own pie-menus?
- how to create an addon like as an example, that let you make rocks, via the tools panel, with some parameters, and a random button. Or trees, or random abstract geometries etc...
- how to make so when you unwrap, Blender automatically opens/splits the view with an UV/Image editor
- let say i have some repetitive always the same actions on some objects, how do i record the actions, and make it an addon? ex: i select x objects, the addon apply transforms, put the pivots on world center (or individual origins -> menu?), unwraps UV0 in Smart Uv mode, UV1 in ligthmap pack, it could also rename objects with a suffix, etc...
- cats playing with a string

DavidBoura
Автор

I love this video. So specific, just have to pause a bit. (I'm running single screen, and definitely gonna get extra screen for Blender tutorials :-) Thanks you!

fytubevw
Автор

Can we do it vice versa? For example create a 3d mesh in blender then get it’s vertex and faces in python?

sepantagh
Автор

Does this only work for cubes? Could I use this code to create a complex mesh too or just cubes?

RC
Автор

Me gustó este tutorial. Pude comprender mejor la utilidad del leguaje python usado con Bender. Gracias.
I liked this tutorial. I could better understand the usefulness of leguaje python used with Bender. Thank you.

mateosantiago
Автор

Can I use Another Script for Texturing the new mesh

jeffkirchoff
Автор

Is there anyway you can update this file to work on Blender is not working ...

ashhaf
Автор

Speed up to 1.25x speed to make it a little faster

JacobKinsley
Автор

nice ty how about the uvmap, how do i implement dat in to that file
?

thierrymoreels
welcome to shbcf.ru