71#include "RNA_prototypes.hh"
108 for (
int i = 0; i < verts_len; i++) {
112 for (
int i = 0; i < verts_len; i++) {
156#define MAX_SKIN_NODE_FRAMES 2
179 const float threshold = 0.0001f;
180 const float threshold_squared = threshold * threshold;
183 for (axis = 0; axis < 3; axis++) {
215 for (axis = 0; axis < 3; axis++) {
217 bool left =
false, right =
false;
220 for (i = 0; i < 4; i++) {
221 if (
quad[i]->co[axis] < 0.0f) {
224 else if (
quad[i]->co[axis] > 0.0f) {
242static bool skin_frame_find_contained_faces(
const Frame *frame,
BMFace *fill_faces[2])
276 for (i = 0; i < totframe; i++) {
277 for (j = 0; j < 4; j++) {
306 for (i = 0; i < totframe; i++) {
307 Frame *frame = frames[i];
310 for (j = 0; j < 4; j++) {
311 if (frame->
verts[j] ==
v) {
322 for (i = 0; i < totframe; i++) {
323 Frame *frame = frames[i];
337 for (i = 0; i < totframe; i++) {
338 Frame *frame = frames[i];
346 if (skin_frame_find_contained_faces(frame, fill_faces)) {
391 float dist, side_a, side_b, thresh, mid[3];
394 for (i = 0; i < totframe; i++) {
398 for (j = 0; j < 4; j++) {
401 if (frames[i]->
merge[j].frame) {
405 for (k = i + 1; k < totframe; k++) {
409 thresh =
min_ff(side_a, side_b) / 2.0f;
412 for (
l = 0;
l < 4;
l++) {
413 if (frames[k]->
merge[
l].frame || frames[k]->
merge[
l].is_target) {
432 dist =
len_v3v3(frames[i]->co[j], frames[k]->co[
l]);
439 frames[k]->merge[
l].frame = frames[i];
440 frames[k]->merge[
l].corner = j;
441 frames[i]->merge[j].is_target =
true;
461 int hull_frames_num, i;
463 (*tothullframe) = emap[
v].
size();
464 hull_frames = MEM_cnew_array<Frame *>(*tothullframe, __func__);
466 for (i = 0; i < emap[
v].
size(); i++) {
471 hull_frames[hull_frames_num++] = &f->
frames[0];
491 for (i = 0; i < 2; i++) {
497 Frame *frame,
const float co[3],
const float radius[2],
const float mat[3][3],
float offset)
499 float rx[3], ry[3], rz[3];
518 for (i = 0; i < 4; i++) {
525 return (
v[0] +
v[1]) * 0.5f;
535 const float *rad = nodes[
v].radius;
538 if (emap[
v].is_empty()) {
547 mat[0][2] = mat[1][0] = mat[2][1] = 1;
550 create_frame(&skin_nodes[
v].frames[0], vert_positions[
v], rad, mat, avg);
551 create_frame(&skin_nodes[
v].frames[1], vert_positions[
v], rad, mat, -avg);
560 if (emat[emap[
v][0]].origin !=
v) {
573 if (
dot_v3v3(mat[0], normal) < 0.0f) {
582 float axis[3],
angle, ine[3][3], oute[3][3];
585 e1 = &emat[emap[
v][0]];
586 e2 = &emat[emap[
v][1]];
620 const float *rad = nodes[
v].radius;
628 e1 = &emat[emap[
v][0]];
629 e2 = &emat[emap[
v][1]];
640 create_frame(&skin_nodes[
v].frames[0], vert_positions[
v], rad, mat, avg);
647 create_frame(&skin_nodes[
v].frames[1], vert_positions[
v], rad, mat, avg);
655 create_frame(&skin_nodes[
v].frames[0], vert_positions[
v], rad, mat, 0);
666 SkinNode *skin_nodes = MEM_cnew_array<SkinNode>(verts_num, __func__);
668 for (
v = 0;
v < verts_num;
v++) {
669 if (emap[
v].
size() <= 1) {
672 else if (emap[
v].
size() == 2) {
687 const float z_up[3] = {0, 0, 1};
695 if (
dot > -1 + FLT_EPSILON &&
dot < 1 - FLT_EPSILON) {
729 float axis[3],
angle;
730 int i,
e,
v, parent_v, parent_is_branch;
752 if (parent_is_branch) {
753 calc_edge_mat(emat[
e].mat, vert_positions[parent_v], vert_positions[
v]);
757 sub_v3_v3v3(emat[
e].mat[0], vert_positions[
v], vert_positions[parent_v]);
767 for (i = 0; i < emap[
v].
size(); i++) {
770 stack_elem.
e = emap[
v][i];
781 bool *has_valid_root)
789 stack =
BLI_stack_new(
sizeof(stack_elem),
"build_edge_mats.stack");
791 visited_e =
BLI_BITMAP_NEW(edges.size(),
"build_edge_mats.visited_e");
792 emat = MEM_cnew_array<EMat>(edges.size(), __func__);
796 for (
v = 0;
v < verts_num;
v++) {
798 if (emap[
v].
size() >= 1) {
806 for (i = 0; i < emap[
v].size(); i++) {
807 stack_elem.
e = emap[
v][i];
811 *has_valid_root =
true;
813 else if (edges.is_empty()) {
815 *has_valid_root =
true;
844#define NUM_SUBDIVISIONS_MAX 128
846 const MVertSkin *evs[2] = {&nodes[edge[0]], &nodes[edge[1]]};
848 const bool v1_branch = degree[edge[0]] > 2;
849 const bool v2_branch = degree[edge[1]] > 2;
850 int subdivisions_num;
857 if (v1_branch && v2_branch) {
866 if (avg_radius != 0.0f) {
868 float subdivisions_num_fl;
869 const float edge_len =
len_v3v3(vert_positions[edge[0]], vert_positions[edge[1]]);
870 subdivisions_num_fl = (edge_len / avg_radius);
872 subdivisions_num =
int(subdivisions_num_fl);
879 subdivisions_num = 0;
884 if (subdivisions_num < 2 && v1_branch && v2_branch) {
885 subdivisions_num = 2;
888 return subdivisions_num;
890#undef NUM_SUBDIVISIONS_MAX
905 const MDeformVert *origdvert = orig->deform_verts().data();
915 for (i = 0, subd_num = 0; i < orig_edge_num; i++) {
918 subd_num += edge_subd[i];
923 orig, orig_vert_num + subd_num, orig_edge_num + subd_num, 0, 0);
931 outdvert = result->deform_verts_for_write().data();
938 int result_edge_i = 0;
939 for (i = 0,
v = orig_vert_num; i < orig_edge_num; i++) {
945 VGroupData *vgroups =
nullptr, *vg;
953 vgroups = MEM_cnew_array<VGroupData>(dv1->
totweight, __func__);
960 vg = &vgroups[vgroups_num];
975 radrat = (
half_v2(outnode[edge[1]].radius) /
half_v2(outnode[edge[0]].radius));
976 if (isfinite(radrat)) {
977 radrat = (radrat + 1) / 2;
985 for (j = 0; j < edge_subd[i]; j++,
v++) {
986 float r = (j + 1) /
float(edge_subd[i] + 1);
987 float t =
powf(r, radrat);
991 out_vert_positions[
v], out_vert_positions[edge[0]], out_vert_positions[edge[1]], t);
994 interp_v3_v3v3(outnode[
v].radius, orignode[edge[0]].radius, orignode[edge[1]].radius, t);
997 for (k = 0; k < vgroups_num; k++) {
1001 weight =
interpf(vg->w2, vg->w1, t);
1008 result_edges[result_edge_i][0] = u;
1009 result_edges[result_edge_i][1] =
v;
1019 result_edges[result_edge_i][0] = u;
1020 result_edges[result_edge_i][1] = edge[1];
1051 {frame2[0], frame2[1], frame1[1], frame1[0]},
1052 {frame2[1], frame2[2], frame1[2], frame1[1]},
1053 {frame2[2], frame2[3], frame1[3], frame1[2]},
1054 {frame2[3], frame2[0], frame1[0], frame1[3]},
1065 normal_quad_v3(no, q[0][0]->co, q[0][1]->co, q[0][2]->co, q[0][3]->co);
1071 float cent_sides[4][3];
1075 for (i = 0; i < 4; i++) {
1080 for (i = 0; i < 4; i++) {
1091 for (i = 0; i < 4; i++) {
1093 add_poly(so, q[i][3], q[i][2], q[i][1], q[i][0]);
1096 add_poly(so, q[i][0], q[i][1], q[i][2], q[i][3]);
1107 for (i = 0; i < sn->
totframe; i++) {
1109 for (j = 0; j < 4; j++) {
1125#define PRINT_HOLE_INFO 0
1138 const float ray_dir[3],
1142 BMVert *
v, *v_first =
nullptr, *v_prev =
nullptr;
1151 else if (v_prev != v_first) {
1156 ray_start, ray_dir, v_first->
co, v_prev->co,
v->
co, &dist,
nullptr);
1157 if (curhit && dist < best_dist) {
1166 *r_lambda = best_dist;
1177 int orig_len = f->
len;
1186 while (f->
len > n) {
1189 BMVert *v_safe, *v_merge;
1203 v_safe = shortest_edge->
v1;
1204 v_merge = shortest_edge->
v2;
1213 bool wrong_face =
false;
1215 for (i = 0; i < orig_len; i++) {
1216 if (orig_verts[i] == v_merge) {
1217 orig_verts[i] =
nullptr;
1241 BMFace *f, *isect_target_face, *center_target_face;
1243 float frame_center[3];
1244 float frame_normal[3];
1245 float best_isect_dist =
FLT_MAX;
1246 float best_center_dist =
FLT_MAX;
1257 isect_target_face = center_target_face =
nullptr;
1259 float dist, poly_center[3];
1264 if (hit && dist < best_isect_dist) {
1265 isect_target_face = f;
1266 best_isect_dist = dist;
1271 dist =
len_v3v3(frame_center, poly_center);
1272 if (dist < best_center_dist) {
1273 center_target_face = f;
1274 best_center_dist = dist;
1278 f = isect_target_face;
1279 if (!f || best_center_dist < best_isect_dist / 2) {
1280 f = center_target_face;
1287 printf(
"no good face found\n");
1302 for (i = 0; i < 4; i++) {
1303 for (j = 0; j < 4; j++) {
1304 orders[i][j] = (j + i) % 4;
1305 orders[i + 4][j] = 3 - ((j + i) % 4);
1310 for (i = 0; i < 8; i++) {
1314 for (j = 0; j < 4; j++) {
1318 if (
len < shortest_len) {
1320 memcpy(best_order, orders[i],
sizeof(
int[4]));
1331 int i, best_order[4];
1342 "extrude_discrete_faces faces=%hf",
1348 split_face =
nullptr;
1358 if (split_face->
len == 3) {
1370 "subdivide_edges edges=%he cuts=%i quad_corner_type=%i",
1375 else if (split_face->
len > 4) {
1392 if (split_face->
len != 4) {
1410 for (i = 0; i < 4; i++) {
1424 int i, attached[4], totattached = 0;
1427 for (i = 0; i < 4; i++) {
1429 attached[totattached++] = i;
1434 for (i = 0; i < totattached; i++) {
1457 for (i = 0; i < 3; i++) {
1458 if (!
ELEM(tri[1][i], tri[0][0], tri[0][1], tri[0][2])) {
1465 for (i = 0, j = 0; i < 3; i++, j++) {
1469 if (
ELEM(tri[0][i],
e->v1,
e->v2) &&
1470 (tri[0][(i + 1) % 3] ==
e->v1 || tri[0][(i + 1) % 3] ==
e->v2))
1504 if (adj[0]->
len == 3 && adj[1]->
len == 3) {
1570 Frame **hull_frames;
1571 int v, tothullframe;
1573 for (
v = 0;
v < verts_num;
v++) {
1575 if (!skin_nodes[
v].totframe) {
1587 for (
v = 0;
v < verts_num;
v++) {
1591 for (i = 0; i < sn->
totframe; i++) {
1594 for (j = 0; j < 4; j++) {
1610 for (
v = 0;
v < verts_num;
v++) {
1614 for (j = 0; j < sn->
totframe; j++) {
1635 for (
v = 0;
v < verts_num;
v++) {
1643 for (i = 0; i < 4; i++) {
1682 for (
const int e : edges.index_range()) {
1684 a = &skin_nodes[edges[
e][0]];
1685 b = &skin_nodes[edges[
e][1]];
1687 if (a->totframe &&
b->totframe) {
1689 Frame *fr[2] = {&a->frames[0], &
b->frames[0]};
1693 if ((a->flag &
SEAM_FRAME) && (
e != a->seam_edges[0])) {
1701 for (i = 0; i < 4; i++) {
1702 v_order[i] = fr[1]->
verts[order[i]];
1728 for (i = 0; i < verts_num; i++) {
1729 for (j = 0; j < skin_nodes[i].
totframe; j++) {
1732 for (k = 0; k < 4; k++) {
1765 static_cast<float *
>(
1795 for (
v = 0;
v < verts_num;
v++) {
1800 Frame **hull_frames;
1804 if (!
build_hull(so, hull_frames, tothullframe)) {
1852 for (
v = 0;
v < verts_num;
v++) {
1853 if (skin_nodes[
v].totframe) {
1854 output_frames(so.bm, &skin_nodes[
v], input_dvert ? &input_dvert[
v] :
nullptr);
1895 int *orig =
static_cast<int *
>(
1912 bool has_valid_root =
false;
1919 const MDeformVert *dvert = origmesh->deform_verts().data();
1920 const int verts_num = origmesh->
verts_num;
1925 edges, verts_num, vert_to_edge_offsets, vert_to_edge_indices);
1927 emat =
build_edge_mats(nodes, vert_positions, verts_num, edges, vert_to_edge, &has_valid_root);
1928 skin_nodes =
build_frames(vert_positions, verts_num, nodes, vert_to_edge, emat);
1932 bm =
build_skin(skin_nodes, verts_num, vert_to_edge, edges, dvert, smd, r_error);
1936 if (!has_valid_root) {
1988 error &= ~SKIN_ERROR_NO_VALID_ROOT;
1992 "No valid root vertex found (you need one per mesh island you want to skin)");
1995 error &= ~SKIN_ERROR_HULL;
2000 if (result ==
nullptr) {
2027 uiItemR(row,
ptr,
"use_x_symmetry", toggles_flag,
nullptr, ICON_NONE);
2028 uiItemR(row,
ptr,
"use_y_symmetry", toggles_flag,
nullptr, ICON_NONE);
2029 uiItemR(row,
ptr,
"use_z_symmetry", toggles_flag,
nullptr, ICON_NONE);
2034 uiItemO(row,
IFACE_(
"Create Armature"), ICON_NONE,
"OBJECT_OT_skin_armature_create");
2035 uiItemO(row,
nullptr, ICON_NONE,
"MESH_OT_customdata_skin_add");
2039 "OBJECT_OT_skin_loose_mark_clear",
2048 "OBJECT_OT_skin_loose_mark_clear",
2057 uiItemO(layout,
IFACE_(
"Mark Root"), ICON_NONE,
"OBJECT_OT_skin_root_mark");
2058 uiItemO(layout,
IFACE_(
"Equalize Radii"), ICON_NONE,
"OBJECT_OT_skin_radii_equalize");
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
void * CustomData_bmesh_get_n(const CustomData *data, void *block, eCustomDataType type, int n)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
void * CustomData_get_layer_for_write(CustomData *data, eCustomDataType type, int totelem)
void CustomData_copy_data(const CustomData *source, CustomData *dest, int source_index, int dest_index, int count)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
int CustomData_number_of_layers(const CustomData *data, eCustomDataType type)
void BKE_id_free(Main *bmain, void *idv)
Mesh * BKE_mesh_new_nomain_from_template(const Mesh *me_src, int verts_num, int edges_num, int faces_num, int corners_num)
Mesh * BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
void BKE_modifier_copydata_generic(const ModifierData *md, ModifierData *md_dst, int flag)
@ eModifierTypeFlag_SupportsEditmode
@ eModifierTypeFlag_AcceptsMesh
void BKE_modifier_set_error(const Object *ob, ModifierData *md, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
A min-heap / priority queue ADT.
HeapSimple * BLI_heapsimple_new(void) ATTR_WARN_UNUSED_RESULT
void BLI_heapsimple_free(HeapSimple *heap, HeapSimpleFreeFP ptrfreefp) ATTR_NONNULL(1)
void * BLI_heapsimple_pop_min(HeapSimple *heap) ATTR_NONNULL(1)
bool BLI_heapsimple_is_empty(const HeapSimple *heap) ATTR_NONNULL(1)
void BLI_heapsimple_insert(HeapSimple *heap, float value, void *ptr) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE float interpf(float target, float origin, float t)
float normal_quad_v3(float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
bool isect_ray_tri_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
bool is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void zero_m3(float m[3][3])
void mid_v3_v3v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
void rotate_normalized_v3_v3v3fl(float out[3], const float p[3], const float axis[3], float angle)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
void copy_vn_i(int *array_tar, int size, int val)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
void BLI_stack_pop(BLI_Stack *stack, void *dst) ATTR_NONNULL()
void BLI_stack_push(BLI_Stack *stack, const void *src) ATTR_NONNULL()
bool BLI_stack_is_empty(const BLI_Stack *stack) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_stack_free(BLI_Stack *stack) ATTR_NONNULL()
#define BLI_stack_new(esize, descr)
#define ENUM_OPERATORS(_type, _max)
#define UNPACK4_EX(pre, a, post)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define CD_MASK_MDEFORMVERT
#define CD_MASK_MVERT_SKIN
#define DNA_struct_default_get(struct_name)
struct SkinModifierData SkinModifierData
@ MOD_SKIN_SMOOTH_SHADING
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
static void init_data(ModifierData *md)
static void skin_smooth_hulls(BMesh *bm, SkinNode *skin_nodes, int verts_num, const SkinModifierData *smd)
#define NUM_SUBDIVISIONS_MAX
static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd)
static SkinNode * build_frames(const blender::Span< blender::float3 > vert_positions, int verts_num, const MVertSkin *nodes, blender::GroupedSpan< int > emap, EMat *emat)
static Mesh * subdivide_base(const Mesh *orig)
static bool is_quad_symmetric(BMVert *quad[4], const SkinModifierData *smd)
@ SKIN_ERROR_NO_VALID_ROOT
static void create_frame(Frame *frame, const float co[3], const float radius[2], const float mat[3][3], float offset)
ModifierTypeInfo modifierType_Skin
static void merge_frame_corners(Frame **frames, int totframe)
static void panel_register(ARegionType *region_type)
static bool quad_crosses_symmetry_plane(BMVert *quad[4], const SkinModifierData *smd)
static void connect_frames(SkinOutput *so, BMVert *frame1[4], BMVert *frame2[4])
static void calc_edge_mat(float mat[3][3], const float a[3], const float b[3])
static void output_frames(BMesh *bm, SkinNode *sn, const MDeformVert *input_dvert)
static Frame ** collect_hull_frames(int v, SkinNode *frames, blender::GroupedSpan< int > emap, const blender::Span< blender::int2 > edges, int *tothullframe)
static bool build_hull(SkinOutput *so, Frame **frames, int totframe)
static void vert_face_normal_mark_update(BMVert *v)
static void node_frames_init(SkinNode *nf, int totframe)
static bool skin_output_branch_hulls(SkinOutput *so, SkinNode *skin_nodes, int verts_num, blender::GroupedSpan< int > emap, const blender::Span< blender::int2 > edges)
static void required_data_mask(ModifierData *, CustomData_MeshMasks *r_cddata_masks)
static BMesh * build_skin(SkinNode *skin_nodes, int verts_num, blender::GroupedSpan< int > emap, const blender::Span< blender::int2 > edges, const MDeformVert *input_dvert, SkinModifierData *smd, eSkinErrorFlag *r_error)
static void skin_output_connections(SkinOutput *so, SkinNode *skin_nodes, const blender::Span< blender::int2 > edges)
static void add_poly(SkinOutput *so, BMVert *v1, BMVert *v2, BMVert *v3, BMVert *v4)
static void skin_set_orig_indices(Mesh *mesh)
static void end_node_frames(int v, SkinNode *skin_nodes, const blender::Span< blender::float3 > vert_positions, const MVertSkin *nodes, blender::GroupedSpan< int > emap, EMat *emat)
static void connection_node_frames(int v, SkinNode *skin_nodes, const blender::Span< blender::float3 > vert_positions, const MVertSkin *nodes, blender::GroupedSpan< int > emap, EMat *emat)
static Mesh * modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
static void skin_update_merged_vertices(SkinNode *skin_nodes, int verts_num)
static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_face)
static void skin_output_end_nodes(SkinOutput *so, SkinNode *skin_nodes, int verts_num)
static Mesh * base_skin(Mesh *origmesh, SkinModifierData *smd, eSkinErrorFlag *r_error)
static int connection_node_mat(float mat[3][3], int v, blender::GroupedSpan< int > emap, EMat *emat)
static EMat * build_edge_mats(const MVertSkin *vs, const blender::Span< blender::float3 > vert_positions, const int verts_num, const blender::Span< blender::int2 > edges, blender::GroupedSpan< int > emap, bool *has_valid_root)
static void vert_array_face_normal_update(BMVert **verts, int verts_len)
static void add_quad_from_tris(SkinOutput *so, BMEdge *e, BMFace *adj[2])
static float half_v2(const float v[2])
#define MAX_SKIN_NODE_FRAMES
static int isect_ray_poly(const float ray_start[3], const float ray_dir[3], BMFace *f, float *r_lambda)
static Mesh * final_skin(SkinModifierData *smd, Mesh *mesh, eSkinErrorFlag *r_error)
static void skin_choose_quad_bridge_order(BMVert *a[4], BMVert *b[4], int best_order[4])
static int calc_edge_subdivisions(const blender::Span< blender::float3 > vert_positions, const MVertSkin *nodes, const blender::int2 &edge, const blender::Span< int > degree)
static void panel_draw(const bContext *, Panel *panel)
static void calc_frame_center(float center[3], const Frame *frame)
static void build_emats_stack(BLI_Stack *stack, BLI_bitmap *visited_e, EMat *emat, blender::GroupedSpan< int > emap, const blender::Span< blender::int2 > edges, const MVertSkin *vs, const blender::Span< blender::float3 > vert_positions)
static void skin_fix_hull_topology(BMesh *bm, SkinNode *skin_nodes, int verts_num)
static BMFace * skin_hole_target_face(BMesh *bm, Frame *frame)
static BMFace * collapse_face_corners(BMesh *bm, BMFace *f, int n, BMVert **orig_verts)
static void quad_from_tris(BMEdge *e, BMFace *adj[2], BMVert *ndx[4])
static void skin_merge_close_frame_verts(SkinNode *skin_nodes, int verts_num, blender::GroupedSpan< int > emap, const blender::Span< blender::int2 > edges)
static float frame_len(const Frame *frame)
static void vert_face_normal_mark_set(BMVert *v)
static void skin_hole_detach_partially_attached_frame(BMesh *bm, Frame *frame)
void modifier_panel_end(uiLayout *layout, PointerRNA *ptr)
PanelType * modifier_panel_register(ARegionType *region_type, ModifierType type, PanelDrawFn draw)
PointerRNA * modifier_panel_get_property_pointers(Panel *panel, PointerRNA *r_ob_ptr)
void uiItemFullO(uiLayout *layout, const char *opname, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutRowWithHeading(uiLayout *layout, bool align, const char *heading)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_FORCE_BLANK_DECORATE
void BM_face_kill(BMesh *bm, BMFace *f)
BMFace * BM_face_create_verts(BMesh *bm, BMVert **vert_arr, const int len, const BMFace *f_example, const eBMCreateFlag create_flag, const bool create_edges)
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
void BM_mesh_delete_hflag_tagged(BMesh *bm, const char hflag, const char htype)
bool BMO_error_occurred_at_level(BMesh *bm, eBMOpErrorLevel level)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
void BM_data_layer_free_n(BMesh *bm, CustomData *data, int type, int n)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
int BM_iter_as_array(BMesh *bm, const char itype, void *data, void **array, const int len)
Iterator as Array.
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
const BMAllocTemplate bm_mesh_allocsize_default
void bmesh_edit_begin(BMesh *, BMOpTypeFlag)
BMesh Begin Edit.
void BM_mesh_elem_toolflags_ensure(BMesh *bm)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
void bmesh_edit_end(BMesh *bm, BMOpTypeFlag type_flag)
BMesh End Edit.
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
BMOpSlot * BMO_slot_get(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *identifier)
BMESH OPSTACK GET SLOT.
void BMO_op_exec(BMesh *bm, BMOperator *op)
BMESH OPSTACK EXEC OP.
void BMO_pop(BMesh *bm)
BMESH OPSTACK POP.
void BMO_push(BMesh *bm, BMOperator *op)
BMESH OPSTACK PUSH.
void BMO_op_init(BMesh *bm, BMOperator *op, int flag, const char *opname)
BMESH OPSTACK INIT OP.
#define BMO_ITER(ele, iter, slot_args, slot_name, restrict_flag)
bool BMO_op_initf(BMesh *bm, BMOperator *op, int flag, const char *fmt,...)
void BMO_op_finish(BMesh *bm, BMOperator *op)
BMESH OPSTACK FINISH OP.
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
#define BMO_FLAG_DEFAULTS
BLI_INLINE void BMO_slot_map_elem_insert(BMOperator *op, BMOpSlot *slot, const void *element, void *val)
@ SUBD_CORNER_STRAIGHT_CUT
void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4])
void BM_face_normal_update(BMFace *f)
void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3])
float BM_face_calc_area(const BMFace *f)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
bool BM_face_share_face_check(BMFace *f_a, BMFace *f_b)
BMLoop * BM_face_find_shortest_loop(BMFace *f)
bool BM_edge_face_pair(BMEdge *e, BMFace **r_fa, BMFace **r_fb)
bool BM_face_is_normal_valid(const BMFace *f)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
BMLoop * BM_face_find_longest_loop(BMFace *f)
bool BM_vert_in_face(BMVert *v, BMFace *f)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Span< NewT > constexpr cast() const
void reinitialize(const int64_t new_size)
local_group_size(16, 16) .push_constant(Type b
additional_info("compositor_sum_squared_difference_float_shared") .push_constant(Type output_img float dot(value.rgb, luminance_coefficients)") .define("LOAD(value)"
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
blender::gpu::Batch * quad
OrientationBounds merge(const OrientationBounds &cone_a, const OrientationBounds &cone_b)
void MEM_freeN(void *vmemh)
static void error(const char *str)
void count_indices(Span< int > indices, MutableSpan< int > counts)
int edge_other_vert(const int2 edge, const int vert)
GroupedSpan< int > build_vert_to_edge_map(Span< int2 > edges, int verts_num, Array< int > &r_offsets, Array< int > &r_indices)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
struct BMOpSlot slots_out[BMO_OP_MAX_SLOTS]
struct BMOpSlot slots_in[BMO_OP_MAX_SLOTS]
struct Frame::@1331 merge[4]
Frame frames[MAX_SKIN_NODE_FRAMES]