[Blender Index] [Blender Hierarchy]
Blender meshes can be seen in the OOPS window as brown rectangles More...
#include <mesh.h>
Inherits: Blender
Blender meshes can be seen in the OOPS window as brown rectangles. They are constructed without a connection to an object but should be connected to one. This gives users the chance to "share" a mesh by connecting one mesh to different objects.
A Blender mesh has always a unique name. The name you give as an argument is only a proposal for the real name. Blender will check if this name is already used and rename the mesh if necessary.
Adds a list with 6 entries to the faces list. This might change in the future. The first 4 entries are indices to describe the vertices for a triangle or a quad. The decision if a quad is used or not is made by the 4th entry. If this is 0 then only the first 3 entries are used for an triangle. The 5th entry tells if the triangle (or quad) should be rendered as "smooth" (using vertex normals) or not. The last entry is the index of the material used for this face.
Adds the texture coordinates for one face to texcoords. The texture coordinates are stored for each face as a list of 4 sublists (for triangles just ignore the 4th sublist). Each of this sublists has 2 entries (u- and v- direction).
Replaces the filename (including path) for the texture. In the future more than only one texture might be used.
Adds values for the list vertices, normals, and colors. The first 3 values are used for the vertex coordinates, the next 3 values for the vertex normal, and the last 3 (if used) for the vertex color. The color information has not to be specified. The default value for r (-1.0) means: Don't store any color information.
Instead of creating triangles and quads you can also create edges with addFace(...) now. This edges can be used by calling createTrianglesFromEdges() to triangulate a general polygon (even with holes).
This is like pressing the TAB key in Blender. You enter edit mode and you can add vertices and faces within Python. Then you leave edit mode again and the data is transfered from Python to Blender.
When you leave edit mode all collected data (vertices, faces) are transfered from Python to Blender.
After importing data (e.g. a DXF file) you might have doubled vertices because the file format does not allow to reuse the same vertices by using indices. This function removes doubled vertices within a precision value (at the moment you can't use the precision value from the interface; a value of 0.0003 is used) and is also called internally by createTrianglesFromEdges().
All rectangles you can see in the OOPS window are instances of classes with an unique name for all instances of this class. Nevertheless the name of two instances of different classes can be the same.
This holds a list of vertices for usage within Python. A face uses the indices of this vertices. This allows to store the vertices efficient and to share the same vertex between different triangles or quads.
This holds a list of vertex normals which can be used for "smooth" rendering. The number of elements in this list should be exactly the same as in the list for the vertices.
This holds a list of vertex colors. The list might be empty if no colors are used. But if they are used the list should be exactly of the same size as the list of vertices.
This holds a list of faces. At the moment a face is a list with 6 entries (integers). This might change in the future. The first 4 entries are indices to describe the vertices for a triangle or a quad. The decision if a quad is used or not is made by the 4th entry. If this is 0 then only the first 3 entries are used for an triangle. The 5th entry tells if the triangle (or quad) should be rendered as "smooth" (using vertex normals) or not. The last entry is the index of the material used for this face.
This holds a list of texture coordinates. The list might be empty but if used the list should have exactly the same size as the list of faces. The texture coordinates are stored for each face as a list of 4 sublists (for triangles just ignore the 4th sublist). Each of this sublists has 2 entries (u- and v- direction).
This holds the name (with path) of the used texture (if any).
| Kdoc |