216 #define STITCH_SELECTED 1
217 #define STITCH_STITCHABLE 2
218 #define STITCH_PROCESSED 4
219 #define STITCH_BOUNDARY 8
220 #define STITCH_STITCHABLE_CANDIDATE 16
222 #define STITCH_NO_PREVIEW -1
261 return stitch_preview;
267 if (stitch_preview) {
299 "(L)imit %.2f (Alt Wheel adjust) %s, "
301 "shift select vertices");
329 const float medianPoint[2],
333 float uv_rotation_result[2];
369 if (
fabsf(luv->
uv[0] - luv_iter->
uv[0]) < limit &&
370 fabsf(luv->
uv[1] - luv_iter->
uv[1]) < limit) {
386 if (edge_iter == edge) {
394 MLoopUV *luv_orig1, *luv_iter1;
395 MLoopUV *luv_orig2, *luv_iter2;
407 if (
fabsf(luv_orig1->
uv[0] - luv_iter1->
uv[0]) < limit &&
408 fabsf(luv_orig1->
uv[1] - luv_iter1->
uv[1]) < limit &&
409 fabsf(luv_orig2->
uv[0] - luv_iter2->
uv[0]) < limit &&
410 fabsf(luv_orig2->
uv[1] - luv_iter2->
uv[1]) < limit) {
455 for (i = 0; i <
state->element_map->totalIslands; i++) {
456 if (island_stitch_data[i].addedForPreview) {
457 int numOfIslandUVs = 0, j;
461 float rotation_mat[2][2];
464 if (island_stitch_data[i].num_rot_elements > 1) {
468 if (island_stitch_data[i].num_rot_elements_neg > 1) {
472 if (island_stitch_data[i].numOfElements > 1) {
481 if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < (
float)
M_PI_2) ||
482 island_stitch_data[i].num_rot_elements == 0 ||
483 island_stitch_data[i].num_rot_elements_neg == 0) {
491 (2.0f * (
float)
M_PI - island_stitch_data[i].rotation_neg) *
499 for (j = 0; j < numOfIslandUVs; j++,
element++) {
511 rotation_mat, island_stitch_data[i].medianPoint, luv->
uv,
state->aspect);
518 int face_preview_pos =
522 island_stitch_data[i].medianPoint,
524 2 *
element->loop_of_poly_index,
542 const uint *uvfinal_map,
547 float uv1[2], uv2[2];
548 float edgecos, edgesin;
560 index1 = uvfinal_map[element1 -
state->element_map->buf];
561 index2 = uvfinal_map[element2 -
state->element_map->buf];
570 uv1[0] = luv2->
uv[0] - luv1->
uv[0];
571 uv1[1] = luv2->
uv[1] - luv1->
uv[1];
573 uv1[1] /=
state->aspect;
575 uv2[0] = uv_average[index2].
uv[0] - uv_average[index1].
uv[0];
576 uv2[1] = uv_average[index2].
uv[1] - uv_average[index1].
uv[1];
578 uv2[1] /=
state->aspect;
587 if (edgesin > 0.0f) {
602 float edgecos = 1.0f, edgesin = 0.0f;
605 float rotation = 0, rotation_neg = 0;
606 int rot_elem = 0, rot_elem_neg = 0;
617 element_iter =
state->element_map->vert[index];
619 for (; element_iter; element_iter = element_iter->
next) {
622 int index_tmp1, index_tmp2;
630 index_tmp1 = element_iter -
state->element_map->buf;
631 index_tmp1 =
state->map[index_tmp1];
633 index_tmp2 =
state->map[index_tmp2];
638 if (edgesin > 0.0f) {
651 rotation_neg /= 2.0f;
662 if (
state->island_is_stitchable) {
665 if (
state->element_map) {
671 if (
state->selection_stack) {
674 if (
state->tris_per_island) {
680 if (
state->normals) {
686 if (
state->stitch_preview) {
689 if (
state->edge_hash) {
711 const int *map =
state->map;
716 for (i = 0; i <
state->total_separate_edges; i++) {
735 for (; iter1; iter1 = iter1->
next) {
747 int index1 = map[iter1 - first_element];
748 int index2 = map[iter2 - first_element];
754 if (index1 > index2) {
755 SWAP(
int, index1, index2);
758 edgetmp.
uv1 = index1;
759 edgetmp.
uv2 = index2;
765 for (eiter = edge; eiter; eiter = eiter->
next) {
766 if (edge2 == eiter) {
775 last_set->
next = edge2;
804 element_iter =
state->element_map->vert[vert_index];
806 for (; element_iter; element_iter = element_iter->
next) {
824 for (; edge_iter; edge_iter = edge_iter->
next) {
894 element_iter =
state->element_map->vert[vert_index];
896 for (; element_iter; element_iter = element_iter->
next) {
907 element, ssc,
state, island_stitch_data, preview_position);
936 for (; edge_iter; edge_iter = edge_iter->
next) {
937 if (edge_iter == edge) {
946 state->uvs[edge->
uv1], ssc,
state, island_stitch_data, preview_position);
948 state->uvs[edge->
uv2], ssc,
state, island_stitch_data, preview_position);
992 int face_preview_pos =
997 final_position[index].
uv);
1007 element_iter = element_iter->
next;
1008 }
while (element_iter && !element_iter->
separate);
1037 if (preview ==
NULL) {
1042 "stitch_face_preview_position");
1048 island_stitch_data =
MEM_callocN(
sizeof(*island_stitch_data) *
state->element_map->totalIslands,
1049 "stitch_island_data");
1050 if (!island_stitch_data) {
1061 for (i = 0; i <
state->selection_size; i++) {
1074 for (
int island_idx = 0; island_idx <
state->element_map->totalIslands; island_idx++) {
1080 if (is_active_state) {
1094 for (i = 0; i <
state->selection_size; i++) {
1100 element, ssc,
state, island_stitch_data, preview_position);
1126 int stitchBufferIndex = 0, unstitchBufferIndex = 0;
1130 preview->
num_stitchable *
sizeof(
float) * preview_size,
"stitch_preview_stitchable_data");
1132 sizeof(
float) * preview_size,
1133 "stitch_preview_unstitchable_data");
1142 for (i = 0; i <
state->total_separate_uvs; i++) {
1150 stitchBufferIndex++;
1157 unstitchBufferIndex++;
1162 for (i = 0; i <
state->total_separate_edges; i++) {
1176 stitchBufferIndex++;
1177 BLI_assert(stitchBufferIndex <= preview->num_stitchable);
1188 unstitchBufferIndex++;
1189 BLI_assert(unstitchBufferIndex <= preview->num_unstitchable);
1206 for (i = 0; i <
state->element_map->totalIslands; i++) {
1207 if (island_stitch_data[i].addedForPreview) {
1208 int numOfIslandUVs = 0, j;
1212 for (j = 0; j < numOfIslandUVs; j++,
element++) {
1227 uint buffer_index = 0;
1231 "tri_uv_stitch_prev");
1233 "tri_uv_stitch_prev");
1237 "static_island_preview_tris");
1252 int numoftris = efa->
len - 2;
1254 int face_preview_pos = preview_position[index].
data_position;
1269 if (i < numoftris) {
1276 memcpy(preview->
static_tris + buffer_index, fuv->
uv,
sizeof(
float[2]));
1277 memcpy(preview->
static_tris + buffer_index + 2, luv->
uv,
sizeof(
float[2]));
1278 memcpy(preview->
static_tris + buffer_index + 4, luvnext->
uv,
sizeof(
float[2]));
1295 final_position =
MEM_callocN(
state->selection_size *
sizeof(*final_position),
1296 "stitch_uv_average");
1297 uvfinal_map =
MEM_mallocN(
state->element_map->totalUVs *
sizeof(*uvfinal_map),
1298 "stitch_uv_final_map");
1301 final_position =
MEM_callocN(
state->total_separate_uvs *
sizeof(*final_position),
1302 "stitch_uv_average");
1306 for (i = 0; i <
state->selection_size; i++) {
1321 final_position[i].
count = 1;
1329 for (; element_iter; element_iter = element_iter->
next) {
1332 l = element_iter->
l;
1334 if (stitch_midpoints) {
1336 final_position[i].
count++;
1348 if (stitch_midpoints) {
1349 final_position[i].
uv[0] /= final_position[i].
count;
1350 final_position[i].
uv[1] /= final_position[i].
count;
1368 final_position[edge->
uv1].
count = 1;
1369 final_position[edge->
uv2].
count = 1;
1375 !stitch_midpoints) {
1379 for (edge_iter = edge->
first; edge_iter; edge_iter = edge_iter->
next) {
1386 if (stitch_midpoints) {
1405 for (i = 0; i <
state->total_separate_uvs; i++) {
1406 final_position[i].
uv[0] /= final_position[i].
count;
1407 final_position[i].
uv[1] /= final_position[i].
count;
1414 for (i = 0; i <
state->selection_size; i++) {
1438 for (i = 0; i <
state->total_separate_edges; i++) {
1443 edge, ssc,
state, final_position, uvfinal_map, island_stitch_data);
1450 for (i = 0; i <
state->total_separate_edges; i++) {
1459 for (i = 0; i <
state->selection_size; i++) {
1469 for (i = 0; i <
state->total_separate_uvs; i++) {
1492 for (i = 0; i <
state->selection_size; i++) {
1497 edge, ssc,
state, final_position,
NULL, island_stitch_data);
1504 for (i = 0; i <
state->selection_size; i++) {
1515 for (i = 0; i <
state->selection_size; i++) {
1575 const UvEdge *edge = key;
1584 if ((edge1->
uv1 == edge2->
uv1) && (edge1->
uv2 == edge2->
uv2)) {
1596 for (eiter = edge->
first; eiter; eiter = eiter->
next) {
1599 if (always_select) {
1604 for (i = 0; i <
state->selection_size; i++) {
1605 if (selection_stack[i] == eiter) {
1606 (
state->selection_size)--;
1607 selection_stack[i] = selection_stack[
state->selection_size];
1614 selection_stack[
state->selection_size++] = eiter;
1630 for (; element_iter; element_iter = element_iter->
next) {
1635 if (always_select) {
1640 for (i = 0; i <
state->selection_size; i++) {
1641 if (selection_stack[i] == element_iter) {
1642 (
state->selection_size)--;
1643 selection_stack[i] = selection_stack[
state->selection_size];
1650 selection_stack[
state->selection_size++] = element_iter;
1658 void **old_selection_stack =
state->selection_stack;
1659 int old_selection_size =
state->selection_size;
1660 state->selection_size = 0;
1665 sizeof(*
state->selection_stack),
1666 "stitch_new_edge_selection_stack");
1669 for (i = 0; i <
state->total_separate_edges; i++) {
1680 for (i = 0; i < old_selection_size; i++) {
1689 sizeof(*
state->selection_stack),
1690 "stitch_new_vert_selection_stack");
1692 for (i = 0; i < old_selection_size; i++) {
1693 UvEdge *edge = old_selection_stack[i];
1731 tangent[1] /= aspect;
1758 uint num_line = 0, num_tri, tri_idx = 0, line_idx = 0;
1766 if (
format.attr_len == 0) {
1785 for (
int i = 0; i < stitch_preview->
num_polys; i++) {
1789 num_tri = num_line - 2 * stitch_preview->
num_polys;
1798 for (
int i = 0; i < stitch_preview->
num_polys; i++) {
1804 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + 2]);
1809 vbo, pos_id, tri_idx++, &stitch_preview->
preview_polys[index + (j + 0) * 2]);
1811 vbo, pos_id, tri_idx++, &stitch_preview->
preview_polys[index + (j + 1) * 2]);
1814 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + (j + 0) * 2]);
1816 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + (j + 1) * 2]);
1823 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + j * 2]);
1883 int uv1 =
state->map[element1 -
state->element_map->buf];
1884 int uv2 =
state->map[element2 -
state->element_map->buf];
1928 state->obedit = obedit;
1946 if (!
state->element_map) {
1952 state->aspect = aspx / aspy;
1955 for (i = 0; i <
state->element_map->totalUVs; i++) {
1956 if (
state->element_map->buf[i].separate) {
1969 state->total_separate_uvs = counter;
1971 "uv_stitch_unique_map");
1974 all_edges =
MEM_mallocN(
sizeof(*all_edges) *
state->element_map->totalUVs,
"ssc_edges");
1976 if (!
state->uvs || !map || !edge_hash || !all_edges) {
2006 int offset1, itmp1 =
element -
state->element_map->buf;
2011 offset1 = map[itmp1];
2012 offset2 = map[itmp2];
2016 all_edges[counter].
flag = 0;
2020 if (offset1 < offset2) {
2021 all_edges[counter].
uv1 = offset1;
2022 all_edges[counter].
uv2 = offset2;
2025 all_edges[counter].
uv1 = offset2;
2026 all_edges[counter].
uv2 = offset1;
2042 state->edges = edges =
MEM_mallocN(
sizeof(*edges) * total_edges,
"stitch_edges");
2050 state->total_separate_edges = total_edges;
2065 for (i = 0; i < total_edges; i++) {
2077 for (i = 0; i < total_edges; i++) {
2078 UvEdge *edge = edges + i;
2093 state->selection_size = 0;
2096 if (state_init !=
NULL) {
2097 int faceIndex, elementIndex;
2107 state->total_separate_uvs,
2108 "uv_stitch_selection_stack");
2110 while (selected_count--) {
2121 state->total_separate_edges,
2122 "uv_stitch_selection_stack");
2124 while (selected_count--) {
2156 if (ssc->
mode != stored_mode) {
2163 state->total_separate_uvs,
2164 "uv_stitch_selection_stack");
2179 state->total_separate_edges,
2180 "uv_stitch_selection_stack");
2203 sizeof(*
state->tris_per_island) *
state->element_map->totalIslands,
"stitch island tris");
2204 for (i = 0; i <
state->element_map->totalIslands; i++) {
2205 state->tris_per_island[i] = 0;
2218 if (!
state->island_is_stitchable) {
2234 StitchState *original_active_state = active_state;
2253 }
while (!(active_state == original_active_state && ssc->
static_island == original_island));
2307 uint objects_len = 0;
2309 view_layer, v3d, &objects_len);
2311 if (objects_len == 0) {
2321 int *objs_selection_count =
NULL;
2330 objs_selection_count =
MEM_mallocN(
sizeof(
int *) * objects_len,
"objects_selection_count");
2333 int total_selected = 0;
2334 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2335 total_selected += objs_selection_count[ob_index];
2351 state_init->
to_select = selected_uvs_arr;
2354 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2355 Object *obedit = objects[ob_index];
2357 if (state_init !=
NULL) {
2363 if (state_init !=
NULL) {
2368 if (stitch_state_ob) {
2460 int *objs_selection_count =
NULL;
2462 "objects_selection_count");
2473 for (
int i = 0; i <
state->selection_size; i++) {
2489 objs_selection_count[ob_index] =
state->selection_size;
2606 switch (event->
type) {
2679 if (active_state != new_active_state) {
2707 if (!event->
shift) {
2771 ot->
description =
"Stitch selected UV vertices by proximity";
2784 ot->
srna,
"use_limit", 0,
"Use Limit",
"Stitch UVs within a specified limit distance");
2789 "Snap islands together (on edge stitch mode, rotates the islands too)");
2797 "Limit distance in normalized coordinates",
2806 "Island that stays in place when stitching islands",
2810 "active_object_index",
2815 "Index of the active object",
2822 "UVs are stitched at midpoint instead of at static island");
2829 "Use vertex or edge stitching");
2834 "Stored Operation Mode",
2835 "Use vertex or edge stitching");
2844 "objects_selection_count",
2849 "Objects Selection Count",
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_bmesh_get(const struct CustomData *data, void *block, int type)
int CustomData_get_offset(const struct CustomData *data, int type)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(view_layer, v3d, r_len)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghashutil_uinthash(unsigned int key)
#define GHASH_ITER(gh_iter_, ghash_)
GHash * BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
void mul_v2_m2v2(float r[2], const float M[2][2], const float v[2])
void angle_to_mat2(float R[2][2], const float angle)
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
MINLINE void negate_v2_v2(float r[2], const float a[2])
MINLINE float cross_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v2(float r[2])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void DEG_id_tag_update(struct ID *id, int flag)
Object is a sort of wrapper for general info.
#define UV_SYNC_SELECTION
#define SCE_SELECT_VERTEX
struct UvElement * BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l)
struct UvElementMap * BM_uv_element_map_create(struct BMesh *bm, const struct Scene *scene, const bool face_selected, const bool uv_selected, const bool use_winding, const bool do_islands)
void BM_uv_element_map_free(struct UvElementMap *element_map)
void ED_region_tag_redraw(struct ARegion *region)
bool ED_operator_uvedit(struct bContext *C)
void ED_workspace_status_text(struct bContext *C, const char *str)
#define REGION_DRAW_POST_VIEW
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
void ED_region_draw_cb_exit(struct ARegionType *, void *)
void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy)
bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
void uvedit_uv_select_enable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, const bool do_history, const int cd_loop_uv_offset)
bool uvedit_edge_select_test(const struct Scene *scene, struct BMLoop *l, const int cd_loop_uv_offset)
void GPU_batch_discard(GPUBatch *)
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
void GPU_batch_draw(GPUBatch *batch)
#define GPU_batch_uniform_4fv(batch, name, val)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_point_size(float size)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
void GPU_vertbuf_attr_set(GPUVertBuf *, uint a_idx, uint v_idx, const void *data)
Read Guarded memory(de)allocation.
#define RNA_BEGIN(sptr, itemptr, propname)
StructRNA RNA_SelectedUvElement
@ TH_STITCH_PREVIEW_UNSTITCHABLE
@ TH_STITCH_PREVIEW_ACTIVE
@ TH_STITCH_PREVIEW_STITCHABLE
void UI_GetThemeColor4fv(int colorid, float col[4])
float UI_GetThemeValuef(int colorid)
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_test(ele, hflag)
void * BM_iter_at_index(BMesh *bm, const char itype, void *data, int index)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
ATTR_WARN_UNUSED_RESULT const void * element
ATTR_WARN_UNUSED_RESULT const BMLoop * l
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct ARegionType * type
struct ToolSettings * toolsettings
float * preview_unstitchable
float * preview_stitchable
bool * island_is_stitchable
UvElementMap * element_map
StitchPreviewer * stitch_preview
unsigned short loop_of_poly_index
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
bool uv_find_nearest_vert_multi(struct Scene *scene, struct Object **objects, const uint objects_len, const float co[2], const float penalty_dist, struct UvNearestHit *hit)
#define UV_NEAREST_HIT_INIT_MAX(v2d)
void uvedit_live_unwrap_update(struct SpaceImage *sima, struct Scene *scene, struct Object *obedit)
bool uv_find_nearest_edge_multi(struct Scene *scene, struct Object **objects, const uint objects_len, const float co[2], struct UvNearestHit *hit)
static bool stitch_check_edges_state_stitchable(UvEdge *edge, UvEdge *edge_iter, StitchStateContainer *ssc, StitchState *state)
static int stitch_init_all(bContext *C, wmOperator *op)
static void stitch_propagate_uv_final_position(Scene *scene, UvElement *element, int index, PreviewPosition *preview_position, UVVertAverage *final_position, StitchStateContainer *ssc, StitchState *state, const bool final)
#define STITCH_STITCHABLE
static void stitch_switch_selection_mode_all(StitchStateContainer *ssc)
static void stitch_select_edge(UvEdge *edge, StitchState *state, int always_select)
struct UvElementID UvElementID
struct StitchPreviewer StitchPreviewer
static void stitch_exit(bContext *C, wmOperator *op, int finished)
static void determine_uv_edge_stitchability(UvEdge *edge, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data)
static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(region), void *arg)
static bool stitch_check_uvs_stitchable(UvElement *element, UvElement *element_iter, StitchStateContainer *ssc, StitchState *state)
static UvEdge * uv_edge_get(BMLoop *l, StitchState *state)
void UV_OT_stitch(wmOperatorType *ot)
static void stitch_island_calculate_edge_rotation(UvEdge *edge, StitchStateContainer *ssc, StitchState *state, UVVertAverage *uv_average, const uint *uvfinal_map, IslandStitchData *island_stitch_data)
static void stitch_update_header(StitchStateContainer *ssc, bContext *C)
static int stitch_process_data_all(StitchStateContainer *ssc, Scene *scene, int final)
static void stitch_draw_vbo(GPUVertBuf *vbo, GPUPrimType prim_type, const float col[4])
static void determine_uv_stitchability(UvElement *element, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data)
static void stitch_uv_edge_generate_linked_edges(GHash *edge_hash, StitchState *state)
struct StitchState StitchState
static bool uv_edge_compare(const void *a, const void *b)
static void state_delete_all(StitchStateContainer *ssc)
static int getNumOfIslandUvs(UvElementMap *elementMap, int island)
static void stitch_set_face_preview_buffer_position(BMFace *efa, StitchPreviewer *preview, PreviewPosition *preview_position)
struct UVVertAverage UVVertAverage
static bool stitch_check_uvs_state_stitchable(UvElement *element, UvElement *element_iter, StitchStateContainer *ssc, StitchState *state)
static int stitch_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
struct IslandStitchData IslandStitchData
static void stitch_uv_rotate(const float mat[2][2], const float medianPoint[2], float uv[2], float aspect)
static void stitch_cancel(bContext *C, wmOperator *op)
static bool goto_next_island(StitchStateContainer *ssc)
#define STITCH_STITCHABLE_CANDIDATE
struct StitchStateInit StitchStateInit
static uint uv_edge_hash(const void *key)
struct StitchStateContainer StitchStateContainer
static bool stitch_check_edges_stitchable(UvEdge *edge, UvEdge *edge_iter, StitchStateContainer *ssc, StitchState *state)
static void stitch_island_calculate_vert_rotation(UvElement *element, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data)
static void stitch_validate_uv_stitchability(UvElement *element, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data, PreviewPosition *preview_position)
#define STITCH_NO_PREVIEW
static void stitch_preview_delete(StitchPreviewer *stitch_preview)
struct PreviewPosition PreviewPosition
static void stitch_calculate_edge_normal(BMEditMesh *em, UvEdge *edge, float *normal, float aspect)
static StitchState * stitch_init(bContext *C, wmOperator *op, StitchStateContainer *ssc, Object *obedit, StitchStateInit *state_init)
static void stitch_validate_edge_stitchability(UvEdge *edge, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data, PreviewPosition *preview_position)
static StitchPreviewer * stitch_preview_init(void)
static void stitch_setup_face_preview_for_uv_group(UvElement *element, StitchStateContainer *ssc, StitchState *state, IslandStitchData *island_stitch_data, PreviewPosition *preview_position)
static void stitch_set_selection_mode(StitchState *state, const char from_stitch_mode)
static StitchState * stitch_select(bContext *C, Scene *scene, const wmEvent *event, StitchStateContainer *ssc)
static int stitch_exec(bContext *C, wmOperator *op)
static void state_delete(StitchState *state)
static void stitch_select_uv(UvElement *element, StitchState *state, int always_select)
static int stitch_process_data(StitchStateContainer *ssc, StitchState *state, Scene *scene, int final)
static void stitch_calculate_island_snapping(StitchState *state, PreviewPosition *preview_position, StitchPreviewer *preview, IslandStitchData *island_stitch_data, int final)
static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
const char * WM_bool_as_string(bool test)