Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BKE_customdata.h"
#include "DNA_meshdata_types.h"
#include "bmesh.h"
#include "intern/bmesh_operators_private.h"
Go to the source code of this file.
Macros | |
#define | VERT_MARK 1 |
#define | EDGE_ORIG 1 |
#define | EDGE_MARK 2 |
#define | FACE_MARK 1 |
#define | FACE_NEW 2 |
#define | XY(_x, _y) ((_x) + ((_y) * (xtot + 1))) |
Variables | |
static const float | icovert [12][3] |
static const short | icoface [20][3] |
static const float | icouvs [60][2] |
static const int | monkeyo = 4 |
static const int | monkeynv = 271 |
static const int | monkeynf = 250 |
static const signed char | monkeyv [271][3] |
static signed char | monkeyf [250][4] |
static const float | monkeyuvs [] |
Primitive shapes.
Definition in file bmo_primitive.c.
#define EDGE_MARK 2 |
Definition at line 707 of file bmo_primitive.c.
#define EDGE_ORIG 1 |
Definition at line 706 of file bmo_primitive.c.
#define FACE_MARK 1 |
Definition at line 709 of file bmo_primitive.c.
#define FACE_NEW 2 |
Definition at line 710 of file bmo_primitive.c.
#define VERT_MARK 1 |
Definition at line 704 of file bmo_primitive.c.
#define XY | ( | _x, | |
_y | |||
) | ((_x) + ((_y) * (xtot + 1))) |
void BM_mesh_calc_uvs_circle | ( | BMesh * | bm, |
float | mat[4][4], | ||
float | radius, | ||
short | oflag, | ||
int | cd_loop_uv_offset | ||
) |
Fills first available UV-map with 2D projected UVs for all faces with oflag
set.
bm | The BMesh to operate on. |
mat | The transform matrix applied to the created circle. |
radius | The size of the circle. |
oflag | The flag to check faces with. |
Definition at line 1316 of file bmo_primitive.c.
References BLI_assert, bm, BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BMO_face_flag_test, BMVert::co, copy_v3_v3(), invert_m4_m4(), l, mul_m4_v3(), oflag, MLoopUV::uv, and BMLoop::v.
Referenced by bmo_create_circle_exec().
void BM_mesh_calc_uvs_cone | ( | BMesh * | bm, |
float | mat[4][4], | ||
float | radius_top, | ||
float | radius_bottom, | ||
int | segments, | ||
bool | cap_ends, | ||
short | oflag, | ||
int | cd_loop_uv_offset | ||
) |
Fills first available UV-map with cylinder/cone-like UVs for all faces with oflag
set.
bm | The BMesh to operate on. |
mat | The transform matrix applied to the created cone/cylinder. |
radius_top | The size of the top end of the cone/cylinder. |
radius_bottom | The size of the bottom end of the cone/cylinder. |
segments | The number of subdivisions in the sides of the cone/cylinder. |
cap_ends | Whether the ends of the cone/cylinder are filled or not. |
oflag | The flag to check faces with. |
Definition at line 1501 of file bmo_primitive.c.
References BLI_assert, bm, BM_ELEM_CD_GET_VOID_P, BM_face_normal_update(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, BMO_face_flag_test, BMVert::co, dot_v3v3(), float(), invert_m4_m4(), l, BMFace::len, mul_mat3_m4_v3(), mul_v3_m4v3(), BMFace::no, normalize_v3(), oflag, MLoopUV::uv, BMLoop::v, x, and y.
Referenced by bmo_create_cone_exec().
Fills first available UV-map with cube-like UVs for all faces with oflag
set.
bm | The BMesh to operate on. |
oflag | The flag to check faces with. |
Definition at line 1666 of file bmo_primitive.c.
References BLI_assert, bm, BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, BMO_face_flag_test, CD_MLOOPUV, CustomData_get_offset(), l, BMesh::ldata, oflag, MLoopUV::uv, width, x, and y.
Referenced by bmo_create_cube_exec().
void BM_mesh_calc_uvs_grid | ( | BMesh * | bm, |
uint | x_segments, | ||
uint | y_segments, | ||
short | oflag, | ||
int | cd_loop_uv_offset | ||
) |
Fills first available UV-map with grid-like UV's for all faces with oflag
set.
bm | The BMesh to operate on |
x_segments | The x-resolution of the grid |
y_segments | The y-resolution of the grid |
oflag | The flag to check faces with. |
Definition at line 776 of file bmo_primitive.c.
References BLI_assert, bm, BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, BMO_face_flag_test, float(), l, oflag, MLoopUV::uv, x, and y.
Referenced by bmo_create_grid_exec().
Fills first available UV-map with spherical projected UVs for all faces with oflag
set.
bm | The BMesh to operate on |
oflag | The flag to check faces with. |
Definition at line 1111 of file bmo_primitive.c.
References BLI_assert, bm, BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, bm_mesh_calc_uvs_sphere_face(), BMO_face_flag_test, l, oflag, and MLoopUV::uv.
Referenced by bmo_create_uvsphere_exec().
Definition at line 1043 of file bmo_primitive.c.
References atan2f, BLI_assert, BM_ELEM_CD_GET_VOID_P, BM_ITER_ELEM_INDEX, BM_LOOPS_OF_FACE, BMVert::co, fabsf, float(), l, BMFace::len, len, len_v3(), M_PI, saacos(), MLoopUV::uv, BMLoop::v, x, y, and z.
Referenced by BM_mesh_calc_uvs_sphere().
void bmo_create_circle_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 1235 of file bmo_primitive.c.
References Freestyle::a, bm, BM_CREATE_NOP, BM_edge_create(), BM_face_create_quad_tri(), BM_mesh_calc_uvs_circle(), BM_VERT, BM_vert_create(), BMO_face_flag_enable, BMO_op_callf(), BMO_slot_bool_get(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_int_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, CD_MLOOPUV, CustomData_get_offset(), FACE_NEW, BMOperator::flag, BMesh::ldata, mul_m4_v3(), NULL, sin_cos_from_fraction(), BMOperator::slots_in, BMOperator::slots_out, v1, VERT_MARK, and zero_v3().
void bmo_create_cone_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 1352 of file bmo_primitive.c.
References bm, BM_CREATE_NOP, BM_edge_collapse(), BM_face_create_quad_tri(), BM_FACE_FIRST_LOOP, BM_mesh_calc_uvs_cone(), BM_VERT, BM_vert_create(), BM_vert_kill(), BMO_face_flag_enable, BMO_op_callf(), BMO_slot_bool_get(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_int_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, CD_MLOOPUV, CustomData_get_offset(), BMLoop::e, FACE_MARK, FACE_NEW, BMOperator::flag, l, BMesh::ldata, MEM_freeN, MEM_mallocN, mul_m4_v3(), BMLoop::next, NULL, BMLoop::prev, sin_cos_from_fraction(), BMOperator::slots_in, BMOperator::slots_out, BMLoop::v, v1, v2, and VERT_MARK.
void bmo_create_cube_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 1606 of file bmo_primitive.c.
References ARRAY_SIZE, bm, BM_CREATE_NOP, BM_face_create_verts(), BM_mesh_calc_uvs_cube(), BM_VERT, BM_vert_create(), BMO_face_flag_enable, BMO_slot_bool_get(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, CD_MLOOPUV, CustomData_get_offset(), FACE_MARK, faces, float(), BMesh::ldata, mul_m4_v3(), NULL, quad, BMOperator::slots_in, BMOperator::slots_out, VERT_MARK, verts, x, y, and z.
void bmo_create_grid_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 712 of file bmo_primitive.c.
References bm, BM_CREATE_NOP, BM_face_create_verts(), BM_mesh_calc_uvs_grid(), BM_vert_create(), BMO_face_flag_enable, BMO_slot_bool_get(), BMO_slot_buffer_alloc(), BMO_slot_float_get(), BMO_slot_get(), BMO_slot_int_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, BMOpSlot::buf, CD_MLOOPUV, CustomData_get_offset(), BMOpSlot::data, FACE_MARK, BMesh::ldata, max_ii(), mul_v3_m4v3(), NULL, BMOperator::slots_in, BMOperator::slots_out, VERT_MARK, x, XY, and y.
void bmo_create_icosphere_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 952 of file bmo_primitive.c.
References Freestyle::a, bm, BM_CREATE_NOP, BM_EDGE, BM_ELEM_CD_GET_VOID_P, BM_face_create_quad_tri(), BM_ITER_ELEM, BM_ITER_ELEM_INDEX, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_VERT, BM_vert_create(), BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_int_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, BMO_vert_flag_test, CD_MLOOPUV, BMVert::co, CustomData_get_offset(), BMLoop::e, EDGE_MARK, BMOperator::flag, icoface, icouvs, icovert, l, BMesh::ldata, mul_m4_v3(), NULL, BMOperator::slots_in, BMOperator::slots_out, MLoopUV::uv, v, v1, v2, and VERT_MARK.
void bmo_create_monkey_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 1154 of file bmo_primitive.c.
References bm, BM_CREATE_NOP, BM_ELEM_CD_GET_VOID_P, BM_face_create_quad_tri(), BM_ITER_ELEM, BM_LOOPS_OF_FACE, BM_VERT, BM_vert_create(), BMO_slot_bool_get(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_mat4_get(), BMO_vert_flag_enable, CD_MLOOPUV, BMVert::co, CustomData_get_offset(), fabsf, l, BMesh::ldata, MEM_freeN, MEM_mallocN, monkeyf, monkeynf, monkeynv, monkeyo, monkeyuvs, monkeyv, mul_m4_v3(), NULL, BMOperator::slots_in, BMOperator::slots_out, MLoopUV::uv, v, and VERT_MARK.
void bmo_create_uvsphere_exec | ( | BMesh * | bm, |
BMOperator * | op | ||
) |
Definition at line 833 of file bmo_primitive.c.
References Freestyle::a, axis_angle_to_mat3(), bm, BM_CREATE_NOP, BM_edge_create(), BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_mesh_calc_uvs_sphere(), BM_VERT, BM_vert_create(), BM_VERTS_OF_MESH, BMO_edge_flag_enable, BMO_face_flag_enable, BMO_op_callf(), BMO_op_exec(), BMO_op_finish(), BMO_op_initf(), BMO_slot_bool_get(), BMO_slot_buffer_flag_enable(), BMO_slot_buffer_from_enabled_flag(), BMO_slot_float_get(), BMO_slot_int_get(), BMO_slot_mat4_get(), BMO_vert_flag_enable, BMO_vert_flag_test, CD_MLOOPUV, BMVert::co, cosf, CustomData_get_offset(), e, EDGE_ORIG, FACE_MARK, BMOperator::flag, float(), l, BMesh::ldata, len, len_v3v3(), M_PI, min_ff(), mul_m4_v3(), mul_v3_m3v3(), NULL, sin_cos_from_fraction(), sinf, BMOperator::slots_in, BMOperator::slots_out, BMLoop::v, and VERT_MARK.
|
static |
Definition at line 37 of file bmo_primitive.c.
Referenced by bmo_create_icosphere_exec().
|
static |
Definition at line 43 of file bmo_primitive.c.
Referenced by bmo_create_icosphere_exec().
|
static |
Definition at line 22 of file bmo_primitive.c.
Referenced by bmo_create_icosphere_exec().
|
static |
Definition at line 122 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().
|
static |
Definition at line 63 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().
|
static |
Definition at line 62 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().
|
static |
Definition at line 61 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().
|
static |
Definition at line 209 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().
|
static |
Definition at line 64 of file bmo_primitive.c.
Referenced by bmo_create_monkey_exec().