122 const bNode **r_node,
204 const bool skip_invisible,
210 if (synced_selection &&
bm->totvertsel == (selected ? 0 :
bm->totvert)) {
236 const bool skip_invisible,
237 const bool skip_nonselected,
240 for (
Object *obedit : objects_edit) {
251 bool changed =
false;
295 bool changed =
false;
320 bool changed =
false;
325 if (r_has_select !=
nullptr) {
328 scene, view_layer,
nullptr);
336 scene, view_layer,
nullptr);
338 if (r_has_select !=
nullptr) {
339 *r_has_select = changed;
364 scene, view_layer,
nullptr);
371 float distance_final;
381 for (
Object *obedit : objects) {
383 bool changed =
false;
389 scene, em->
bm,
true,
true, [&axis, &distance_final, &changed](
float luv[2]) {
390 luv[int(axis)] += distance_final;
409 {0,
nullptr, 0,
nullptr,
nullptr},
415 {0,
nullptr, 0,
nullptr,
nullptr},
419 ot->name =
"Move on Axis";
420 ot->description =
"Move UVs on an axis";
421 ot->idname =
"UV_OT_move_on_axis";
438 "Distance to move UVs",
468 bool changed =
false;
472 if (luv[0] != cent[0]) {
478 if (luv[1] != cent[1]) {
525 if ((*prec_a < flags && 0.0f < len_sq_b) || (*prec_a == flags && len_sq_ab < len_sq_b)) {
531 if ((*prec_b < flags && 0.0f < len_sq_a) || (*prec_b == flags && len_sq_ab < len_sq_a)) {
555 for (
int i = 0;
i < 10;
i++) {
557 for (
int j = 0; j <
len; j++) {
575 if (uv_start[1] == uv_end[1]) {
580 a = (uv_end[0] - uv_start[0]) / (uv_end[1] - uv_start[1]);
584 if (uv_start[0] == uv_end[0]) {
589 a = (uv_end[1] - uv_start[1]) / (uv_end[0] - uv_start[0]);
593 bool changed =
false;
594 for (
int j = 0; j <
len; j++) {
601 luv[0] = a * (luv[1] - uv_start[1]) + uv_start[0];
604 luv[1] = a * (luv[0] - uv_start[0]) + uv_start[1];
620 if (offsets.
uv == -1) {
625 if (element_map ==
nullptr) {
629 bool changed =
false;
679 bool changed =
false;
681 if (element_map ==
nullptr) {
686 const uint other_axis = (
uint(axis) + 1) % 2;
698 std::stable_sort(island_bounds_all.
begin(),
699 island_bounds_all.
end(),
701 if (order == UVAlignIslandOrder::Fixed) {
702 return a.bounds.min[int(axis)] < b.bounds.min[int(axis)];
704 const float area_a = (a.
bounds.size()[0] * a.
bounds.size()[1]);
705 const float area_b = (
b.bounds.size()[0] *
b.bounds.size()[1]);
711 UvElement *
element = element_map->storage + element_map->island_indices[island_bounds.index];
712 for (
int j = 0; j < element_map->island_total_uvs[island_bounds.index]; j++) {
715 luv[other_axis] += position[other_axis] - island_bounds.bounds.min[other_axis];
718 luv[other_axis] += position[other_axis] - island_bounds.bounds.center()[other_axis];
721 luv[other_axis] += position[other_axis] - island_bounds.bounds.max[other_axis];
723 luv[int(axis)] += position[int(axis)] - island_bounds.bounds.min[int(axis)];
725 position[int(axis)] += island_bounds.bounds.size()[int(axis)] + margin;
739 scene, view_layer,
nullptr);
747 const uint other_axis = (
uint(axis) + 1) % 2;
749 float2 position = {0.0f, 0.0f};
753 for (
Object *obedit : objects) {
766 bounds.max[0] = tile_x + 1.0f;
767 bounds.max[1] = tile_y + 1.0f;
780 if (
ELEM(initial_position,
786 position[other_axis] =
bounds.min[other_axis];
789 position[other_axis] =
bounds.center()[other_axis];
792 position[other_axis] =
bounds.max[other_axis];
794 position[int(axis)] =
bounds.min[int(axis)];
796 for (
Object *obedit : objects) {
818 "Initial alignment based on the islands bounding box"},
823 "Initial alignment based on UV Tile Grid"},
828 "Initial alignment based on Active UDIM"},
833 "Initial alignment based on 2D cursor"},
834 {0,
nullptr, 0,
nullptr,
nullptr},
840 {0,
nullptr, 0,
nullptr,
nullptr},
848 "Align the islands to the left side of the island"},
853 "Align the islands to the center of the largest island"},
855 {0,
nullptr, 0,
nullptr,
nullptr},
862 "Largest to Smallest",
863 "Sort islands from largest to smallest"},
867 "Smallest to Largest",
868 "Sort islands from smallest to largest"},
870 {0,
nullptr, 0,
nullptr,
nullptr},
873 ot->name =
"Arrange/Align Islands";
874 ot->description =
"Arrange selected UV islands on a line";
875 ot->idname =
"UV_OT_arrange_islands";
885 initial_position_items,
888 "Initial position to arrange islands from");
894 "Axis to arrange UV islands on");
900 "Location to align islands on");
909 ot->srna,
"margin", 0.05f, 0.0f, 1.0f,
"Margin",
"Space between islands", 0.0f, 1.0f);
920 scene, view_layer,
nullptr);
924 for (
Object *obedit : objects) {
926 bool changed =
false;
952 scene, view_layer,
nullptr);
977 for (
Object *obedit : objects) {
979 bool changed =
false;
1013 if (
STREQ(prop_id,
"position_mode")) {
1028 "Align UV vertices along the line defined by the endpoints"},
1033 "Align UV vertices, moving them horizontally to the line defined by the endpoints"},
1038 "Align UV vertices, moving them vertically to the line defined by the endpoints"},
1043 "Automatically choose the direction on which there is most alignment already"},
1044 {
UV_ALIGN_X,
"ALIGN_X", 0,
"Align Vertically",
"Align UV vertices on a vertical line"},
1045 {
UV_ALIGN_Y,
"ALIGN_Y", 0,
"Align Horizontally",
"Align UV vertices on a horizontal line"},
1046 {0,
nullptr, 0,
nullptr,
nullptr},
1053 {0,
nullptr, 0,
nullptr,
nullptr},
1059 ot->description =
"Aligns selected UV vertices on a line";
1060 ot->idname =
"UV_OT_align";
1071 ot->srna,
"axis", axis_items,
UV_ALIGN_AUTO,
"Axis",
"Axis to align UV locations on");
1074 position_mode_items,
1077 "Method of calculating the alignment position");
1095 scene, view_layer,
nullptr);
1105 for (
Object *obedit : objects) {
1115 KDTree_2d *
tree = BLI_kdtree_2d_new(uv_maxlen);
1120 int uv_map_count = 0;
1122 for (
const int ob_index : objects.
index_range()) {
1123 Object *obedit = objects[ob_index];
1126 BLI_kdtree_2d_insert(tree, uv_map_count, luv);
1127 duplicates.append(-1);
1128 uv_map_arr.append(luv);
1132 ob_uv_map_max_idx[ob_index] = uv_map_count - 1;
1135 BLI_kdtree_2d_balance(
tree);
1136 int found_duplicates = BLI_kdtree_2d_calc_duplicates_fast(
1137 tree, threshold,
false, duplicates.
data());
1139 if (found_duplicates > 0) {
1142 for (
int i = 0;
i < uv_map_count;
i++) {
1143 if (duplicates[
i] == -1) {
1144 uv_duplicate_count[
i]++;
1148 if (duplicates[
i] !=
i) {
1151 add_v2_v2(uv_map_arr[duplicates[
i]], uv_map_arr[
i]);
1153 uv_duplicate_count[duplicates[
i]]++;
1156 for (
int i = 0;
i < uv_map_count;
i++) {
1157 if (uv_duplicate_count[
i] < 2) {
1161 mul_v2_fl(uv_map_arr[
i], 1.0f /
float(uv_duplicate_count[
i]));
1167 for (
int i = 0;
i < uv_map_count;
i++) {
1171 while (ob_uv_map_max_idx[ob_index] <
i) {
1175 if (duplicates[
i] == -1) {
1180 changed[ob_index] =
true;
1183 for (ob_index = 0; ob_index < objects.
size(); ob_index++) {
1184 if (changed[ob_index]) {
1185 Object *obedit = objects[ob_index];
1193 BLI_kdtree_2d_free(
tree);
1208 scene, view_layer,
nullptr);
1212 for (
Object *obedit : objects) {
1217 KDTree_2d *
tree = BLI_kdtree_2d_new(uv_maxlen);
1221 int uv_map_count = 0;
1225 BLI_kdtree_2d_insert(
tree, uv_map_count, luv);
1230 BLI_kdtree_2d_balance(
tree);
1233 for (
Object *obedit : objects) {
1234 bool changed =
false;
1237 KDTreeNearest_2d nearest;
1238 const int i = BLI_kdtree_2d_find_nearest(tree, luv, &nearest);
1240 if (i != -1 && nearest.dist < threshold) {
1241 copy_v2_v2(luv, uv_map_arr[i]);
1253 BLI_kdtree_2d_free(
tree);
1267 scene, view_layer,
nullptr);
1272 for (
Object *obedit : objects) {
1282 bool changed =
false;
1292 if (uvs.
size() <= 1) {
1297 while (uvs.
size() > 1) {
1298 const int uvs_num = uvs.
size();
1299 float2 uv_average = {0.0f, 0.0f};
1300 for (
const float *luv : uvs) {
1301 uv_average +=
float2(luv);
1303 uv_average /= uvs_num;
1309 float *uv_ref = uvs[0];
1310 int uv_ref_index = 0;
1311 for (
int i = 1;
i < uvs_num;
i++) {
1313 if (dist_test_sq < dist_best_sq) {
1314 dist_best_sq = dist_test_sq;
1320 const int uvs_end = uvs_num - 1;
1321 std::swap(uvs[uv_ref_index], uvs[uvs_end]);
1326 float2 uv_merged_average = {uv_ref[0], uv_ref[1]};
1328 int uvs_num_merged = 1;
1329 while (uvs[
i] != uv_ref &&
i < uvs_num - uvs_num_merged) {
1331 if (dist_test_sq < threshold_sq) {
1332 uv_merged_average +=
float2(uvs[
i]);
1333 std::swap(uvs[
i], uvs[uvs_end - uvs_num_merged]);
1335 if (dist_test_sq != 0.0f) {
1346 if (uvs_num_merged > 1) {
1347 uv_merged_average /= uvs_num_merged;
1349 for (
int j = uvs_num - uvs_num_merged; j < uvs_num; j++) {
1354 uvs.resize(uvs_num - uvs_num_merged);
1382 ot->name =
"Merge UVs by Distance";
1384 "Selected UV vertices that are within a radius of each other are welded together";
1385 ot->idname =
"UV_OT_remove_doubles";
1398 "Maximum distance between welded vertices",
1405 "Merge selected to other unselected vertices");
1407 ot->srna,
"use_shared_vertex",
false,
"Shared Vertex",
"Weld UVs based on shared vertices");
1427 ot->description =
"Weld selected UV vertices together";
1428 ot->idname =
"UV_OT_weld";
1445 uvco[1] =
roundf(uvco[1] * h) / h;
1450 int width = 0, height = 0;
1473 bool changed =
false;
1486 scene, view_layer,
nullptr);
1508 {0,
"PIXELS", 0,
"Pixels",
""},
1509 {1,
"SELECTED", 0,
"Selected",
""},
1510 {2,
"ORIGIN", 0,
"Origin",
""},
1511 {0,
nullptr, 0,
nullptr,
nullptr},
1515 ot->name =
"Snap Cursor";
1516 ot->description =
"Snap cursor to target type";
1517 ot->idname =
"UV_OT_snap_cursor";
1526 ot->srna,
"target", target_items, 0,
"Target",
"Target to snap the selected UVs to");
1538 bool changed =
false;
1541 copy_v2_v2(luv, cursor);
1551 bool changed =
false;
1554 add_v2_v2(luv, offset);
1567 BMIter iter, liter, lsubiter;
1569 bool changed =
false;
1590 float uv[2] = {0.0f, 0.0f};
1619 int width = 0, height = 0;
1621 bool changed =
false;
1628 uv_snap_to_pixel(luv, w, h);
1641 float offset[2] = {0};
1644 scene, view_layer,
nullptr);
1654 bool changed_multi =
false;
1655 for (
Object *obedit : objects) {
1662 bool changed =
false;
1679 changed_multi =
true;
1692 {0,
"PIXELS", 0,
"Pixels",
""},
1693 {1,
"CURSOR", 0,
"Cursor",
""},
1694 {2,
"CURSOR_OFFSET", 0,
"Cursor (Offset)",
""},
1695 {3,
"ADJACENT_UNSELECTED", 0,
"Adjacent Unselected",
""},
1696 {0,
nullptr, 0,
nullptr,
nullptr},
1700 ot->name =
"Snap Selection";
1701 ot->description =
"Snap selected UV vertices to target type";
1702 ot->idname =
"UV_OT_snap_selected";
1711 ot->srna,
"target", target_items, 0,
"Target",
"Target to snap the selected UVs to");
1731 scene, view_layer,
nullptr);
1733 for (
Object *obedit : objects) {
1736 bool changed =
false;
1785 "Set/clear selected UV vertices as anchored between multiple unwrap operations";
1786 ot->idname =
"UV_OT_pin";
1795 ot->srna,
"clear",
false,
"Clear",
"Clear pinning for the selection instead of setting it");
1801 "Invert pinning for the selection instead of setting it");
1813#define UV_VERT_SEL_TEST(ts, bm, l, bool_test) \
1814 (uvedit_vert_select_get_no_sync(ts, bm, l) == bool_test)
1816#define UV_EDGE_SEL_TEST(ts, bm, l, bool_test) \
1817 (uvedit_edge_select_get_no_sync(ts, bm, l) == bool_test)
1833 }
while ((l_iter = l_iter->
next) != l_first);
1840 const bool select_to_hide = !
swap;
1842 bool changed =
false;
1864 BMLoop *l_iter, *l_first;
1874 }
while ((l_iter = l_iter->
next) != l_first);
1884 BMLoop *l_iter, *l_first;
1894 }
while ((l_iter = l_iter->
next) != l_first);
1950 params.calc_looptris =
true;
1951 params.calc_normals =
false;
1952 params.is_destructive =
false;
1969 scene, view_layer,
nullptr);
1971 for (
Object *ob : objects) {
1998 if (use_face_center) {
2039 if (use_select_linked) {
2093#undef UV_VERT_SEL_TEST
2094#undef UV_EDGE_SEL_TEST
2099 ot->name =
"Hide Selected";
2100 ot->description =
"Hide (un)selected UV vertices";
2101 ot->idname =
"UV_OT_hide";
2110 ot->srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected");
2129 scene, view_layer,
nullptr);
2131 for (
Object *ob : objects) {
2145 Mesh *mesh =
static_cast<Mesh *
>(ob->data);
2147 params.calc_looptris =
true;
2148 params.calc_normals =
false;
2149 params.is_destructive =
false;
2159 if (use_face_center) {
2244 ot->name =
"Reveal Hidden";
2245 ot->description =
"Reveal all hidden UV vertices";
2246 ot->idname =
"UV_OT_reveal";
2297 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
2306 ot->name =
"Set 2D Cursor";
2307 ot->description =
"Set 2D cursor location";
2308 ot->idname =
"UV_OT_cursor_set";
2323 "Cursor location in normalized (0.0 to 1.0) coordinates",
2340 bool changed_multi =
false;
2343 scene, view_layer,
nullptr);
2345 for (
Object *ob : objects) {
2356 bool changed =
false;
2383 }
while ((l_other = l_other->
radial_next) != l_iter);
2394 }
while ((l_iter = l_iter->
next) != l_first);
2398 changed_multi =
true;
2410 ot->name =
"Seams from Islands";
2411 ot->description =
"Set mesh seams according to island setup in the UV editor";
2412 ot->idname =
"UV_OT_seams_from_islands";
2421 RNA_def_boolean(
ot->srna,
"mark_seams",
true,
"Mark Seams",
"Mark boundary edges as seams");
2422 RNA_def_boolean(
ot->srna,
"mark_sharp",
false,
"Mark Sharp",
"Mark boundary edges as sharp");
2445 scene, view_layer,
nullptr);
2447 bool changed =
false;
2449 for (
Object *ob : objects) {
2454 if (synced_selection && (
bm->totedgesel == 0)) {
2500 op_ptr = layout->
op(
2512 ot->name =
"Mark Seam";
2513 ot->description =
"Mark selected UV edges as seams";
2514 ot->idname =
"UV_OT_mark_seam";
2524 RNA_def_boolean(
ot->srna,
"clear",
false,
"Clear Seams",
"Clear instead of marking seams");
2528 const Scene *scene,
BMesh *
bm,
int direction,
int precision,
int *r_double_warn)
2531 const float precision_scale =
powf(10.0f, precision);
2544 if (
pos.x >= 0.0f) {
2549 if (
pos.x <= 0.0f) {
2556 for (
const auto &[
pos,
v] : mirror_gt.
items()) {
2558 mirror_pos[0] = -mirror_pos[0];
2561 vmap.
add(
v, v_mirror);
2564 for (
const auto &[
pos,
v] : mirror_lt.
items()) {
2566 mirror_pos[0] = -mirror_pos[0];
2569 vmap.
add(
v, v_mirror);
2590 sorted_verts[loop_index] =
l->v;
2593 std::sort(sorted_verts.
begin(), sorted_verts.
end());
2594 sorted_verts_to_face.
add(std::move(sorted_verts), f);
2598 for (
const auto &[sorted_verts, f_dst] : sorted_verts_to_face.
items()) {
2600 for (
int index = 0; index < sorted_verts.size(); index++) {
2601 mirror_verts[index] = vmap.
lookup_default(sorted_verts[index],
nullptr);
2603 std::sort(mirror_verts.
begin(), mirror_verts.
end());
2606 if (f_src != f_dst) {
2607 face_map.
add(f_dst, f_src);
2614 bool changed =
false;
2615 for (
const auto &[f_dst, f_src] : face_map.
items()) {
2623 float f_dst_center[3];
2625 if (direction ? (f_dst_center[0] > 0.0f) : (f_dst_center[0] < 0.0f)) {
2646 uv_dst[0] = -(uv_src[0] - 0.5f) + 0.5f;
2647 uv_dst[1] = uv_src[1];
2660 scene, view_layer,
nullptr);
2664 int total_duplicates = 0;
2665 int meshes_with_duplicates = 0;
2667 for (
Object *obedit : objects) {
2670 int double_warn = 0;
2675 total_duplicates += double_warn;
2676 meshes_with_duplicates++;
2685 if (total_duplicates) {
2688 "%d duplicates found in %d mesh(es), mirror may be incomplete",
2690 meshes_with_duplicates);
2698 {0,
"POSITIVE", 0,
"Positive",
""},
2699 {1,
"NEGATIVE", 0,
"Negative",
""},
2700 {0,
nullptr, 0,
nullptr,
nullptr},
2703 ot->name =
"Copy Mirrored UV Coords";
2704 ot->description =
"Copy mirror UV coordinates on the X axis based on a mirrored mesh";
2705 ot->idname =
"UV_OT_copy_mirrored_faces";
2712 RNA_def_enum(
ot->srna,
"direction", direction_items, 0,
"Axis Direction",
"");
2719 "Tolerance for finding vertex duplicates",
2796 "Unstitch UVs and move the result",
SpaceImage * CTX_wm_space_image(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
const char * CustomData_get_active_layer_name(const CustomData *data, eCustomDataType type)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
General operations, lookup, etc. for materials.
Material * BKE_object_material_get(Object *ob, short act)
Material * BKE_object_material_get_eval(Object *ob, short act)
#define SH_NODE_TEX_IMAGE
#define SH_NODE_TEX_ENVIRONMENT
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
A KD-tree for nearest neighbor search.
float closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE void add_v2_v2(float r[2], const float a[2])
void mid_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 void zero_v2(float r[2])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
#define INIT_MINMAX2(min, max)
#define UNUSED_FUNCTION(x)
#define ENUM_OPERATORS(_type, _max)
#define UNUSED_VARS_NDEBUG(...)
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
void DEG_id_tag_update(ID *id, unsigned int flags)
bool DEG_is_evaluated(const T *id)
Object is a sort of wrapper for general info.
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
bool ED_space_image_cursor_poll(bContext *C)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
void EDBM_flag_disable_all(BMEditMesh *em, char hflag)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
bool EDBM_uvselect_clear(BMEditMesh *em)
bool EDBM_mesh_reveal(BMEditMesh *em, bool select)
bool EDBM_uv_check(BMEditMesh *em)
void BM_uv_element_map_free(UvElementMap *element_map)
bool EDBM_mesh_hide(BMEditMesh *em, bool swap)
UvElementMap * BM_uv_element_map_create(BMesh *bm, const Scene *scene, bool uv_selected, bool use_winding, bool use_seams, bool do_islands)
void EDBM_selectmode_flush(BMEditMesh *em)
bool ED_operator_uvedit_space_image(bContext *C)
bool ED_operator_editmesh(bContext *C)
bool ED_operator_uvedit(bContext *C)
bool uvedit_edge_select_test(const Scene *scene, const BMesh *bm, const BMLoop *l, const BMUVOffsets &offsets)
void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit, struct wmWindow *win_modal)
bool ED_uvedit_sync_uvselect_ignore(const ToolSettings *ts)
void ED_uvedit_live_unwrap_re_solve()
bool uvedit_uv_select_test(const Scene *scene, const BMesh *bm, const BMLoop *l, const BMUVOffsets &offsets)
bool ED_uvedit_select_island_check(const ToolSettings *ts)
void ED_uvedit_live_unwrap_end(bool cancel)
bool uvedit_face_visible_test(const Scene *scene, const BMFace *efa)
void ED_uvedit_live_unwrap(const Scene *scene, blender::Span< Object * > objects)
void uvedit_face_select_disable(const Scene *scene, BMesh *bm, BMFace *efa)
bool uvedit_face_select_test(const Scene *scene, const BMesh *bm, const BMFace *efa)
Read Guarded memory(de)allocation.
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
#define BM_ELEM_CD_GET_BOOL(ele, offset)
#define BM_ELEM_SELECT_UV_EDGE
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_FLOAT_P(ele, offset)
#define BM_ELEM_CD_SET_BOOL(ele, offset, f)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
bool BM_uv_map_attr_pin_exists(const BMesh *bm, const StringRef uv_map_name)
void BM_uv_map_attr_pin_ensure_named(BMesh *bm, const StringRef uv_map_name)
#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)
void BM_mesh_select_mode_flush(BMesh *bm)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
void BM_select_history_validate(BMesh *bm)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_elem_hflag_enable_test(BMesh *bm, const char htype, const char hflag, const bool respecthide, const bool overwrite, const char hflag_test)
#define BM_elem_hide_set(bm, ele, hide)
ATTR_WARN_UNUSED_RESULT const void * element
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
BMUVOffsets BM_uv_map_offsets_get(const BMesh *bm)
bool BM_loop_uv_share_edge_check(const BMLoop *l_a, const BMLoop *l_b, const int cd_loop_uv_offset)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool add_overwrite(const Key &key, const Value &value)
bool add(const Key &key, const Value &value)
Value lookup_default(const Key &key, const Value &default_value) const
bool contains(const Key &key) const
ItemIterator items() const &
void append(const T &value)
IndexRange index_range() const
void reserve(const int64_t min_capacity)
float distance(VecOp< float, D >, VecOp< float, D >) RET
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
static void clear(Message &msg)
bNode * node_get_active_texture(bNodeTree &ntree)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
VecBase< float, 2 > float2
VecBase< float, 3 > float3
static void update(bNodeTree *ntree)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
const char * RNA_property_identifier(const PropertyRNA *prop)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
struct BMLoop * radial_next
struct bNodeTree * nodetree
MeshRuntimeHandle * runtime
struct ToolSettings * toolsettings
int custom_grid_subdiv[2]
void operator_context_set(blender::wm::OpCallContext opcontext)
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, blender::wm::OpCallContext context, eUI_Item_Flag flag)
bool(* poll)(struct bContext *)
struct ReportList * reports
struct wmOperatorType * type
void UV_OT_copy(wmOperatorType *ot)
void UV_OT_paste(wmOperatorType *ot)
void UV_OT_select_all(wmOperatorType *ot)
void UV_OT_select_edge_ring(wmOperatorType *ot)
void uvedit_face_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select)
void UV_OT_copy_mirrored_faces(wmOperatorType *ot)
void UV_OT_select(wmOperatorType *ot)
void UV_OT_select_split(wmOperatorType *ot)
void UV_OT_shortest_path_pick(wmOperatorType *ot)
void UV_OT_select_linked(wmOperatorType *ot)
void UV_OT_stitch(wmOperatorType *ot)
bool uvedit_select_is_any_selected_multi(const Scene *scene, blender::Span< Object * > objects)
void UV_OT_cylinder_project(wmOperatorType *ot)
void UV_OT_project_from_view(wmOperatorType *ot)
void UV_OT_smart_project(wmOperatorType *ot)
void UV_OT_unwrap(wmOperatorType *ot)
void UV_OT_select_circle(wmOperatorType *ot)
void UV_OT_select_mode(wmOperatorType *ot)
void UV_OT_select_similar(wmOperatorType *ot)
void UV_OT_sphere_project(wmOperatorType *ot)
void UV_OT_rip(wmOperatorType *ot)
void UV_OT_select_linked_pick(wmOperatorType *ot)
void UV_OT_custom_region_set(wmOperatorType *ot)
void UV_OT_select_more(wmOperatorType *ot)
void UV_OT_cube_project(wmOperatorType *ot)
void UV_OT_select_pinned(wmOperatorType *ot)
void UV_OT_select_loop(wmOperatorType *ot)
void UV_OT_shortest_path_select(wmOperatorType *ot)
void uvedit_edge_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMLoop *l, bool select)
void UV_OT_average_islands_scale(wmOperatorType *ot)
void UV_OT_reset(wmOperatorType *ot)
void UV_OT_select_overlap(wmOperatorType *ot)
void UV_OT_minimize_stretch(wmOperatorType *ot)
void UV_OT_select_lasso(wmOperatorType *ot)
void uvedit_vert_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMLoop *l, bool select)
void UV_OT_pack_islands(wmOperatorType *ot)
void UV_OT_select_less(wmOperatorType *ot)
void UV_OT_select_box(wmOperatorType *ot)
bool ED_object_get_active_image(Object *ob, int mat_nr, Image **r_ima, ImageUser **r_iuser, const bNode **r_node, const bNodeTree **r_ntree)
void ED_keymap_uvedit(wmKeyConfig *keyconf)
static void UV_OT_snap_cursor(wmOperatorType *ot)
static bool uvedit_uv_straighten_elements(const UvElement *element, const int len, const BMUVOffsets &offsets, const eUVWeldAlign tool)
void ED_uvedit_select_all(const ToolSettings *ts, BMesh *bm)
static wmOperatorStatus uv_seams_from_islands_exec(bContext *C, wmOperator *op)
static wmOperatorStatus uv_mark_seam_invoke(bContext *C, wmOperator *op, const wmEvent *)
static void UV_OT_cursor_set(wmOperatorType *ot)
static void uv_weld(bContext *C)
void ED_operatortypes_uvedit()
void UV_OT_copy_mirrored_faces(wmOperatorType *ot)
static wmOperatorStatus uv_snap_selection_exec(bContext *C, wmOperator *op)
static void UV_OT_align(wmOperatorType *ot)
static bool uvedit_uv_straighten(Scene *scene, BMesh *bm, eUVWeldAlign tool)
#define UV_VERT_SEL_TEST(ts, bm, l, bool_test)
static void UV_OT_arrange_islands(wmOperatorType *ot)
static wmOperatorStatus uv_remove_doubles_to_selected_shared_vertex(bContext *C, wmOperator *op)
bool ED_uvedit_center_from_pivot_ex(const SpaceImage *sima, Scene *scene, ViewLayer *view_layer, float r_center[2], char mode, bool *r_has_select)
#define UV_EDGE_SEL_TEST(ts, bm, l, bool_test)
static bool uvedit_uv_islands_arrange(const Scene *scene, BMesh *bm, const UVAlignIslandAxis axis, const UVAlignIslandMode align, const UVAlignIslandOrder order, const float margin, float2 &position)
static void uv_snap_cursor_to_origin(float uvco[2])
static wmOperatorStatus uv_remove_doubles_to_selected(bContext *C, wmOperator *op)
static wmOperatorStatus uv_snap_cursor_exec(bContext *C, wmOperator *op)
static bool bm_face_is_all_uv_sel(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static void UV_OT_mark_seam(wmOperatorType *ot)
static void UV_OT_weld(wmOperatorType *ot)
static wmOperatorStatus uv_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool uv_align_poll_property(const bContext *, wmOperator *op, const PropertyRNA *prop)
static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
static bool uv_snap_uvs_to_cursor(Scene *scene, Object *obedit, const float cursor[2])
bool ED_uvedit_test(Object *obedit)
static wmOperatorStatus uv_weld_exec(bContext *C, wmOperator *)
static wmOperatorStatus uv_hide_exec(bContext *C, wmOperator *op)
static bool uvedit_uv_align_weld(Scene *scene, BMesh *bm, const eUVWeldAlign tool, const float cent[2])
static wmOperatorStatus uv_remove_doubles_exec(bContext *C, wmOperator *op)
static void UV_OT_snap_selected(wmOperatorType *ot)
static wmOperatorStatus uv_reveal_exec(bContext *C, wmOperator *op)
static void uv_snap_to_pixel(float uvco[2], float w, float h)
void ED_uvedit_foreach_uv_multi(const Scene *scene, const Span< Object * > objects_edit, const bool skip_invisible, const bool skip_nonselected, FunctionRef< void(float[2])> user_fn)
static bool uv_snap_uvs_to_adjacent_unselected(Scene *scene, Object *obedit)
static eUVEndPointPrecedence uvedit_line_update_get_precedence(const bool pinned)
bool ED_uvedit_center_multi(const Scene *scene, Span< Object * > objects_edit, float cent[2], char mode)
static void UV_OT_reveal(wmOperatorType *ot)
static bool uvedit_median_multi(const Scene *scene, const Span< Object * > objects_edit, float co[2])
static bool uv_snap_uvs_offset(Scene *scene, Object *obedit, const float offset[2])
static void uv_align(bContext *C, eUVWeldAlign tool, UVAlignPositionMode position_mode)
void ED_uvedit_foreach_uv(const Scene *scene, BMesh *bm, const bool skip_invisible, const bool selected, FunctionRef< void(float[2])> user_fn)
static bool uv_snap_cursor_to_selection(Scene *scene, Span< Object * > objects_edit, SpaceImage *sima)
static bool uv_copy_mirrored_faces(const Scene *scene, BMesh *bm, int direction, int precision, int *r_double_warn)
static wmOperatorStatus uv_arrange_islands_exec(bContext *C, wmOperator *op)
static void UV_OT_hide(wmOperatorType *ot)
static void uv_snap_cursor_to_pixels(SpaceImage *sima)
static bool uvedit_line_update_endpoint(const float *luv, const bool pinned, float uv_a[2], eUVEndPointPrecedence *prec_a, float uv_b[2], eUVEndPointPrecedence *prec_b)
static void UV_OT_move_on_axis(wmOperatorType *ot)
static wmOperatorStatus uv_mark_seam_exec(bContext *C, wmOperator *op)
static wmOperatorStatus uv_remove_doubles_to_unselected(bContext *C, wmOperator *op)
void uvedit_live_unwrap_update(SpaceImage *sima, Scene *scene, Object *obedit)
bool ED_uvedit_minmax_multi(const Scene *scene, const Span< Object * > objects_edit, float r_min[2], float r_max[2])
static void UV_OT_seams_from_islands(wmOperatorType *ot)
static wmOperatorStatus uv_align_exec(bContext *C, wmOperator *op)
void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *ima)
static int UNUSED_FUNCTION ED_operator_uvmap_mesh(bContext *C)
static wmOperatorStatus uv_set_2d_cursor_exec(bContext *C, wmOperator *op)
static void UV_OT_pin(wmOperatorType *ot)
static wmOperatorStatus uv_copy_mirrored_faces_exec(bContext *C, wmOperator *op)
static bool uv_mesh_hide_sync_select(const ToolSettings *ts, Object *ob, BMEditMesh *em, bool swap)
void ED_operatormacros_uvedit()
static void UV_OT_remove_doubles(wmOperatorType *ot)
static bool is_image_texture_node(bNode *node)
static wmOperatorStatus uv_move_on_axis_exec(bContext *C, wmOperator *op)
static wmOperatorStatus uv_pin_exec(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)