48 #include "RNA_prototypes.h"
203 #define STITCH_SELECTED 1
204 #define STITCH_STITCHABLE 2
205 #define STITCH_PROCESSED 4
206 #define STITCH_BOUNDARY 8
207 #define STITCH_STITCHABLE_CANDIDATE 16
209 #define STITCH_NO_PREVIEW -1
248 return stitch_preview;
254 if (stitch_preview) {
271 "(L)imit %.2f (Alt Wheel adjust) %s, "
273 "shift select vertices");
301 const float medianPoint[2],
305 float uv_rotation_result[2];
341 if (
fabsf(luv->
uv[0] - luv_iter->
uv[0]) < limit &&
342 fabsf(luv->
uv[1] - luv_iter->
uv[1]) < limit) {
358 if (edge_iter == edge) {
366 MLoopUV *luv_orig1, *luv_iter1;
367 MLoopUV *luv_orig2, *luv_iter2;
369 l =
state->uvs[edge->uv1]->l;
374 l =
state->uvs[edge->uv2]->l;
379 if (
fabsf(luv_orig1->
uv[0] - luv_iter1->
uv[0]) < limit &&
380 fabsf(luv_orig1->
uv[1] - luv_iter1->
uv[1]) < limit &&
381 fabsf(luv_orig2->
uv[0] - luv_iter2->
uv[0]) < limit &&
382 fabsf(luv_orig2->
uv[1] - luv_iter2->
uv[1]) < limit) {
427 for (i = 0; i <
state->element_map->totalIslands; i++) {
428 if (island_stitch_data[i].addedForPreview) {
429 int numOfIslandUVs = 0, j;
433 float rotation_mat[2][2];
436 if (island_stitch_data[i].num_rot_elements > 1) {
440 if (island_stitch_data[i].num_rot_elements_neg > 1) {
444 if (island_stitch_data[i].numOfElements > 1) {
453 if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < (
float)
M_PI_2) ||
454 island_stitch_data[i].num_rot_elements == 0 ||
455 island_stitch_data[i].num_rot_elements_neg == 0) {
463 (2.0f * (
float)
M_PI - island_stitch_data[i].rotation_neg) *
471 for (j = 0; j < numOfIslandUVs; j++,
element++) {
483 rotation_mat, island_stitch_data[i].medianPoint, luv->
uv,
state->aspect);
490 int face_preview_pos =
494 island_stitch_data[i].medianPoint,
495 preview->preview_polys + face_preview_pos +
496 2 *
element->loop_of_poly_index,
514 const uint *uvfinal_map,
519 float uv1[2], uv2[2];
520 float edgecos, edgesin;
525 element1 =
state->uvs[edge->uv1];
526 element2 =
state->uvs[edge->uv2];
532 index1 = uvfinal_map[element1 -
state->element_map->buf];
533 index2 = uvfinal_map[element2 -
state->element_map->buf];
542 uv1[0] = luv2->
uv[0] - luv1->
uv[0];
543 uv1[1] = luv2->
uv[1] - luv1->
uv[1];
545 uv1[1] /=
state->aspect;
547 uv2[0] = uv_average[index2].
uv[0] - uv_average[index1].
uv[0];
548 uv2[1] = uv_average[index2].
uv[1] - uv_average[index1].
uv[1];
550 uv2[1] /=
state->aspect;
559 if (edgesin > 0.0f) {
574 float edgecos = 1.0f, edgesin = 0.0f;
577 float rotation = 0, rotation_neg = 0;
578 int rot_elem = 0, rot_elem_neg = 0;
589 element_iter =
state->element_map->vert[index];
591 for (; element_iter; element_iter = element_iter->
next) {
594 int index_tmp1, index_tmp2;
602 index_tmp1 = element_iter -
state->element_map->buf;
603 index_tmp1 =
state->map[index_tmp1];
605 index_tmp2 =
state->map[index_tmp2];
610 if (edgesin > 0.0f) {
623 rotation_neg /= 2.0f;
634 if (
state->island_is_stitchable) {
637 if (
state->element_map) {
643 if (
state->selection_stack) {
646 if (
state->tris_per_island) {
652 if (
state->normals) {
658 if (
state->stitch_preview) {
661 if (
state->edge_hash) {
688 for (i = 0; i <
state->total_separate_edges; i++) {
707 for (; iter1; iter1 = iter1->
next) {
719 int index1 =
map[iter1 - first_element];
720 int index2 =
map[iter2 - first_element];
726 if (index1 > index2) {
727 SWAP(
int, index1, index2);
730 edgetmp.
uv1 = index1;
731 edgetmp.
uv2 = index2;
737 for (eiter = edge; eiter; eiter = eiter->
next) {
738 if (edge2 == eiter) {
747 last_set->
next = edge2;
776 element_iter =
state->element_map->vert[vert_index];
778 for (; element_iter; element_iter = element_iter->
next) {
794 UvEdge *edge_iter = edge->first;
796 for (; edge_iter; edge_iter = edge_iter->
next) {
866 element_iter =
state->element_map->vert[vert_index];
868 for (; element_iter; element_iter = element_iter->
next) {
879 element, ssc,
state, island_stitch_data, preview_position);
906 UvEdge *edge_iter = edge->first;
908 for (; edge_iter; edge_iter = edge_iter->
next) {
909 if (edge_iter == edge) {
918 state->uvs[edge->uv1], ssc,
state, island_stitch_data, preview_position);
920 state->uvs[edge->uv2], ssc,
state, island_stitch_data, preview_position);
964 int face_preview_pos =
969 final_position[index].
uv);
979 element_iter = element_iter->
next;
980 }
while (element_iter && !element_iter->
separate);
1014 "stitch_face_preview_position");
1020 island_stitch_data =
MEM_callocN(
sizeof(*island_stitch_data) *
state->element_map->totalIslands,
1021 "stitch_island_data");
1022 if (!island_stitch_data) {
1033 for (i = 0; i <
state->selection_size; i++) {
1045 for (
int island_idx = 0; island_idx <
state->element_map->totalIslands; island_idx++) {
1051 if (is_active_state) {
1065 for (i = 0; i <
state->selection_size; i++) {
1071 element, ssc,
state, island_stitch_data, preview_position);
1097 int stitchBufferIndex = 0, unstitchBufferIndex = 0;
1101 preview->num_stitchable *
sizeof(
float) * preview_size,
"stitch_preview_stitchable_data");
1103 sizeof(
float) * preview_size,
1104 "stitch_preview_unstitchable_data");
1107 if (!
preview->preview_stitchable || !
preview->preview_unstitchable) {
1113 for (i = 0; i <
state->total_separate_uvs; i++) {
1121 stitchBufferIndex++;
1128 unstitchBufferIndex++;
1133 for (i = 0; i <
state->total_separate_edges; i++) {
1147 stitchBufferIndex++;
1148 BLI_assert(stitchBufferIndex <= preview->num_stitchable);
1159 unstitchBufferIndex++;
1160 BLI_assert(unstitchBufferIndex <= preview->num_unstitchable);
1177 for (i = 0; i <
state->element_map->totalIslands; i++) {
1178 if (island_stitch_data[i].addedForPreview) {
1179 int numOfIslandUVs = 0, j;
1183 for (j = 0; j < numOfIslandUVs; j++,
element++) {
1198 uint buffer_index = 0;
1202 "tri_uv_stitch_prev");
1204 "tri_uv_stitch_prev");
1208 "static_island_preview_tris");
1212 if (!
preview->preview_polys) {
1223 int numoftris = efa->
len - 2;
1225 int face_preview_pos = preview_position[index].
data_position;
1240 if (i < numoftris) {
1247 memcpy(
preview->static_tris + buffer_index, fuv->
uv,
sizeof(
float[2]));
1248 memcpy(
preview->static_tris + buffer_index + 2, luv->
uv,
sizeof(
float[2]));
1249 memcpy(
preview->static_tris + buffer_index + 4, luvnext->
uv,
sizeof(
float[2]));
1266 final_position =
MEM_callocN(
state->selection_size *
sizeof(*final_position),
1267 "stitch_uv_average");
1268 uvfinal_map =
MEM_mallocN(
state->element_map->totalUVs *
sizeof(*uvfinal_map),
1269 "stitch_uv_final_map");
1272 final_position =
MEM_callocN(
state->total_separate_uvs *
sizeof(*final_position),
1273 "stitch_uv_average");
1277 for (i = 0; i <
state->selection_size; i++) {
1292 final_position[i].
count = 1;
1300 for (; element_iter; element_iter = element_iter->
next) {
1303 l = element_iter->
l;
1305 if (stitch_midpoints) {
1307 final_position[i].
count++;
1319 if (stitch_midpoints) {
1320 final_position[i].
uv[0] /= final_position[i].
count;
1321 final_position[i].
uv[1] /= final_position[i].
count;
1332 l =
state->uvs[edge->uv1]->l;
1334 l =
state->uvs[edge->uv2]->l;
1339 final_position[edge->uv1].
count = 1;
1340 final_position[edge->uv2].
count = 1;
1346 !stitch_midpoints) {
1350 for (edge_iter = edge->first; edge_iter; edge_iter = edge_iter->
next) {
1357 if (stitch_midpoints) {
1359 final_position[edge->uv1].
count++;
1361 final_position[edge->uv2].
count++;
1376 for (i = 0; i <
state->total_separate_uvs; i++) {
1377 final_position[i].
uv[0] /= final_position[i].
count;
1378 final_position[i].
uv[1] /= final_position[i].
count;
1385 for (i = 0; i <
state->selection_size; i++) {
1409 for (i = 0; i <
state->total_separate_edges; i++) {
1414 edge, ssc,
state, final_position, uvfinal_map, island_stitch_data);
1421 for (i = 0; i <
state->total_separate_edges; i++) {
1430 for (i = 0; i <
state->selection_size; i++) {
1440 for (i = 0; i <
state->total_separate_uvs; i++) {
1463 for (i = 0; i <
state->selection_size; i++) {
1468 edge, ssc,
state, final_position,
NULL, island_stitch_data);
1475 for (i = 0; i <
state->selection_size; i++) {
1486 for (i = 0; i <
state->selection_size; i++) {
1497 state->uvs[edge->uv1],
1505 state->uvs[edge->uv2],
1546 const UvEdge *edge = key;
1555 if ((edge1->
uv1 == edge2->
uv1) && (edge1->
uv2 == edge2->
uv2)) {
1567 for (eiter = edge->first; eiter; eiter = eiter->
next) {
1570 if (always_select) {
1575 for (i = 0; i <
state->selection_size; i++) {
1576 if (selection_stack[i] == eiter) {
1577 (
state->selection_size)--;
1578 selection_stack[i] = selection_stack[
state->selection_size];
1585 selection_stack[
state->selection_size++] = eiter;
1601 for (; element_iter; element_iter = element_iter->
next) {
1606 if (always_select) {
1611 for (i = 0; i <
state->selection_size; i++) {
1612 if (selection_stack[i] == element_iter) {
1613 (
state->selection_size)--;
1614 selection_stack[i] = selection_stack[
state->selection_size];
1621 selection_stack[
state->selection_size++] = element_iter;
1629 void **old_selection_stack =
state->selection_stack;
1630 int old_selection_size =
state->selection_size;
1631 state->selection_size = 0;
1636 sizeof(*
state->selection_stack),
1637 "stitch_new_edge_selection_stack");
1640 for (i = 0; i <
state->total_separate_edges; i++) {
1651 for (i = 0; i < old_selection_size; i++) {
1660 sizeof(*
state->selection_stack),
1661 "stitch_new_vert_selection_stack");
1663 for (i = 0; i < old_selection_size; i++) {
1664 UvEdge *edge = old_selection_stack[i];
1693 BMLoop *l1 = edge->element->l;
1702 tangent[1] /= aspect;
1730 uint num_line = 0, num_tri, tri_idx = 0, line_idx = 0;
1738 if (
format.attr_len == 0) {
1757 for (
int i = 0; i < stitch_preview->
num_polys; i++) {
1761 num_tri = num_line - 2 * stitch_preview->
num_polys;
1770 for (
int i = 0; i < stitch_preview->
num_polys; i++) {
1776 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + 2]);
1781 vbo, pos_id, tri_idx++, &stitch_preview->
preview_polys[index + (j + 0) * 2]);
1783 vbo, pos_id, tri_idx++, &stitch_preview->
preview_polys[index + (j + 1) * 2]);
1786 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + (j + 0) * 2]);
1788 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + (j + 1) * 2]);
1795 vbo_line, pos_id, line_idx++, &stitch_preview->
preview_polys[index + j * 2]);
1855 int uv1 =
state->map[element1 -
state->element_map->buf];
1856 int uv2 =
state->map[element2 -
state->element_map->buf];
1900 state->obedit = obedit;
1910 if (!
state->element_map) {
1916 state->aspect = aspx / aspy;
1919 for (i = 0; i <
state->element_map->totalUVs; i++) {
1920 if (
state->element_map->buf[i].separate) {
1935 "uv_stitch_unique_map");
1938 all_edges =
MEM_mallocN(
sizeof(*all_edges) *
state->element_map->totalUVs,
"ssc_edges");
1940 if (!
state->uvs || !
map || !edge_hash || !all_edges) {
1973 int offset1, itmp1 =
element -
state->element_map->buf;
1978 offset1 =
map[itmp1];
1979 offset2 =
map[itmp2];
1987 if (offset1 < offset2) {
2009 state->edges = edges =
MEM_mallocN(
sizeof(*edges) * total_edges,
"stitch_edges");
2017 state->total_separate_edges = total_edges;
2032 for (i = 0; i < total_edges; i++) {
2044 for (i = 0; i < total_edges; i++) {
2045 UvEdge *edge = edges + i;
2060 state->selection_size = 0;
2063 if (state_init !=
NULL) {
2064 int faceIndex, elementIndex;
2074 state->total_separate_uvs,
2075 "uv_stitch_selection_stack");
2077 while (selected_count--) {
2088 state->total_separate_edges,
2089 "uv_stitch_selection_stack");
2091 while (selected_count--) {
2123 if (ssc->
mode != stored_mode) {
2130 state->total_separate_uvs,
2131 "uv_stitch_selection_stack");
2146 state->total_separate_edges,
2147 "uv_stitch_selection_stack");
2170 sizeof(*
state->tris_per_island) *
state->element_map->totalIslands,
"stitch island tris");
2171 for (i = 0; i <
state->element_map->totalIslands; i++) {
2172 state->tris_per_island[i] = 0;
2185 if (!
state->island_is_stitchable) {
2201 StitchState *original_active_state = active_state;
2220 }
while (!(active_state == original_active_state && ssc->
static_island == original_island));
2237 uint objects_len = 0;
2239 view_layer, v3d, &objects_len);
2241 if (objects_len == 0) {
2251 "Stitching only works with less than %i objects selected (%u selected)",
2295 int *objs_selection_count =
NULL;
2304 objs_selection_count =
MEM_mallocN(
sizeof(
int *) * objects_len,
"objects_selection_count");
2307 int total_selected = 0;
2308 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2309 total_selected += objs_selection_count[ob_index];
2325 state_init->
to_select = selected_uvs_arr;
2328 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2329 Object *obedit = objects[ob_index];
2331 if (state_init !=
NULL) {
2337 if (state_init !=
NULL) {
2342 if (stitch_state_ob) {
2435 int *objs_selection_count =
NULL;
2437 "objects_selection_count");
2448 for (
int i = 0; i <
state->selection_size; i++) {
2464 objs_selection_count[ob_index] =
state->selection_size;
2581 switch (event->
type) {
2654 if (active_state != new_active_state) {
2746 ot->
description =
"Stitch selected UV vertices by proximity";
2759 ot->
srna,
"use_limit", 0,
"Use Limit",
"Stitch UVs within a specified limit distance");
2764 "Snap islands together (on edge stitch mode, rotates the islands too)");
2772 "Limit distance in normalized coordinates",
2781 "Island that stays in place when stitching islands",
2785 "active_object_index",
2790 "Index of the active object",
2797 "UVs are stitched at midpoint instead of at static island");
2804 "Use vertex or edge stitching");
2809 "Stored Operation Mode",
2810 "Use vertex or edge stitching");
2813 ot->
srna,
"selection", &RNA_SelectedUvElement,
"Selection",
"");
2819 "objects_selection_count",
2824 "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)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
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
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghash_len(const 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)
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], 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 UvElementMap * BM_uv_element_map_create(struct BMesh *bm, const struct Scene *scene, bool uv_selected, bool use_winding, bool do_islands)
struct UvElement * BM_uv_element_get(struct UvElementMap *map, struct BMFace *efa, struct BMLoop *l)
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)
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
bool uvedit_uv_select_test(const struct Scene *scene, struct BMLoop *l, int cd_loop_uv_offset)
void ED_uvedit_get_aspect(struct Object *obedit, float *r_aspx, float *r_aspy)
void uvedit_uv_select_enable(const struct Scene *scene, struct BMEditMesh *em, struct BMLoop *l, bool do_history, int cd_loop_uv_offset)
bool uvedit_edge_select_test(const struct Scene *scene, struct BMLoop *l, 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)
#define RNA_MAX_ARRAY_LENGTH
@ 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
ccl_gpu_kernel_postfix ccl_global int * counter
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])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken preview("preview", pxr::TfToken::Immortal)
SocketIndexByIdentifierMap * map
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
struct ReportList * reports
bool uv_find_nearest_edge_multi(struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], float penalty, 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_vert_multi(struct Scene *scene, struct Object **objects, uint objects_len, const float co[2], float penalty_dist, 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)