102 const bNode **r_node,
107 bNodeTree *ntree = ma ? ma->nodetree :
nullptr;
112 *r_ima = id_cast<Image *>(
node->id);
184 const bool skip_invisible,
216 const bool skip_invisible,
217 const bool skip_nonselected,
220 for (
Object *obedit : objects_edit) {
231 bool changed =
false;
275 bool changed =
false;
301 bool changed =
false;
306 if (r_has_select !=
nullptr) {
309 bmain, scene, view_layer,
nullptr);
317 bmain, scene, view_layer,
nullptr);
319 if (r_has_select !=
nullptr) {
320 *r_has_select = changed;
346 *bmain, scene, view_layer,
nullptr);
353 float distance_final;
363 for (
Object *obedit : objects) {
365 bool changed =
false;
371 luv[int(axis)] += distance_final;
390 {0,
nullptr, 0,
nullptr,
nullptr},
396 {0,
nullptr, 0,
nullptr,
nullptr},
400 ot->
name =
"Move on Axis";
402 ot->
idname =
"UV_OT_move_on_axis";
419 "Distance to move UVs",
449 bool changed =
false;
453 if (luv[0] != cent[0]) {
459 if (luv[1] != cent[1]) {
506 if ((*prec_a < flags && 0.0f < len_sq_b) || (*prec_a == flags && len_sq_ab < len_sq_b)) {
512 if ((*prec_b < flags && 0.0f < len_sq_a) || (*prec_b == flags && len_sq_ab < len_sq_a)) {
536 for (
int i = 0; i < 10; i++) {
538 for (
int j = 0; j <
len; j++) {
556 if (uv_start[1] == uv_end[1]) {
561 a = (uv_end[0] - uv_start[0]) / (uv_end[1] - uv_start[1]);
565 if (uv_start[0] == uv_end[0]) {
570 a = (uv_end[1] - uv_start[1]) / (uv_end[0] - uv_start[0]);
574 bool changed =
false;
575 for (
int j = 0; j <
len; j++) {
582 luv[0] = a * (luv[1] - uv_start[1]) + uv_start[0];
585 luv[1] = a * (luv[0] - uv_start[0]) + uv_start[1];
601 if (offsets.
uv == -1) {
606 if (element_map ==
nullptr) {
610 bool changed =
false;
660 bool changed =
false;
662 if (element_map ==
nullptr) {
667 const uint other_axis = (
uint(axis) + 1) % 2;
677 island_bounds.
index = i;
679 std::stable_sort(island_bounds_all.
begin(),
680 island_bounds_all.
end(),
682 if (order == UVAlignIslandOrder::Fixed) {
683 return a.bounds.min[int(axis)] < b.bounds.min[int(axis)];
685 const float area_a = (a.
bounds.size()[0] * a.
bounds.size()[1]);
686 const float area_b = (
b.bounds.size()[0] *
b.bounds.size()[1]);
691 for (
const UVAlignIslandBounds &island_bounds : island_bounds_all) {
692 UvElement *
element = element_map->storage + element_map->island_indices[island_bounds.index];
693 for (
int j = 0; j < element_map->island_total_uvs[island_bounds.index]; j++) {
696 luv[other_axis] +=
position[other_axis] - island_bounds.bounds.min[other_axis];
699 luv[other_axis] +=
position[other_axis] - island_bounds.bounds.center()[other_axis];
702 luv[other_axis] +=
position[other_axis] - island_bounds.bounds.max[other_axis];
704 luv[int(axis)] +=
position[int(axis)] - island_bounds.bounds.min[int(axis)];
706 position[int(axis)] += island_bounds.bounds.size()[int(axis)] + margin;
721 *bmain, scene, view_layer,
nullptr);
729 const uint other_axis = (
uint(axis) + 1) % 2;
735 for (
Object *obedit : objects) {
744 const int tile_x = sima->
image->active_tile_index % 10;
745 const int tile_y = sima->
image->active_tile_index / 10;
748 bounds.max[0] = tile_x + 1.0f;
749 bounds.max[1] = tile_y + 1.0f;
764 if (
ELEM(initial_position,
780 for (
Object *obedit : objects) {
801 "Initial alignment based on the islands bounding box"},
806 "Initial alignment based on UV Tile Grid"},
811 "Initial alignment based on Active UDIM"},
816 "Initial alignment based on 2D cursor"},
817 {0,
nullptr, 0,
nullptr,
nullptr},
823 {0,
nullptr, 0,
nullptr,
nullptr},
831 "Align the islands to the max side of the island"},
836 "Align the islands to the center of the largest island"},
838 {0,
nullptr, 0,
nullptr,
nullptr},
845 "Largest to Smallest",
846 "Sort islands from largest to smallest"},
850 "Smallest to Largest",
851 "Sort islands from smallest to largest"},
853 {0,
nullptr, 0,
nullptr,
nullptr},
856 ot->
name =
"Arrange/Align Islands";
857 ot->
description =
"Arrange selected UV islands on a line";
858 ot->
idname =
"UV_OT_arrange_islands";
868 initial_position_items,
871 "Initial position to arrange islands from");
877 "Axis to arrange UV islands on");
883 "Location to align islands on");
892 ot->
srna,
"margin", 0.05f, 0.0f, 1.0f,
"Margin",
"Space between islands", 0.0f, 1.0f);
904 *bmain, scene, view_layer,
nullptr);
908 for (
Object *obedit : objects) {
910 bool changed =
false;
932 float pos[2],
min[2],
max[2];
937 *bmain, scene, view_layer,
nullptr);
962 for (
Object *obedit : objects) {
964 bool changed =
false;
998 if (
STREQ(prop_id,
"position_mode")) {
1013 "Align UV vertices along the line defined by the endpoints"},
1018 "Align UV vertices, moving them horizontally to the line defined by the endpoints"},
1023 "Align UV vertices, moving them vertically to the line defined by the endpoints"},
1028 "Automatically choose the direction on which there is most alignment already"},
1029 {
UV_ALIGN_X,
"ALIGN_X", 0,
"Align Vertically",
"Align UV vertices on a vertical line"},
1030 {
UV_ALIGN_Y,
"ALIGN_Y", 0,
"Align Horizontally",
"Align UV vertices on a horizontal line"},
1031 {0,
nullptr, 0,
nullptr,
nullptr},
1038 {0,
nullptr, 0,
nullptr,
nullptr},
1044 ot->
description =
"Aligns selected UV vertices on a line";
1045 ot->
idname =
"UV_OT_align";
1056 ot->
srna,
"axis", axis_items,
UV_ALIGN_AUTO,
"Axis",
"Axis to align UV locations on");
1059 position_mode_items,
1062 "Method of calculating the alignment position");
1081 *bmain, scene, view_layer,
nullptr);
1091 for (
Object *obedit : objects) {
1105 int uv_map_count = 0;
1107 for (
const int ob_index : objects.
index_range()) {
1108 Object *obedit = objects[ob_index];
1117 ob_uv_map_max_idx[ob_index] = uv_map_count - 1;
1122 tree, threshold,
false, duplicates.
data());
1124 if (found_duplicates > 0) {
1127 for (
int i = 0; i < uv_map_count; i++) {
1128 if (duplicates[i] == -1) {
1129 uv_duplicate_count[i]++;
1133 if (duplicates[i] != i) {
1136 add_v2_v2(uv_map_arr[duplicates[i]], uv_map_arr[i]);
1138 uv_duplicate_count[duplicates[i]]++;
1141 for (
int i = 0; i < uv_map_count; i++) {
1142 if (uv_duplicate_count[i] < 2) {
1146 mul_v2_fl(uv_map_arr[i], 1.0f /
float(uv_duplicate_count[i]));
1148 MEM_delete(uv_duplicate_count);
1152 for (
int i = 0; i < uv_map_count; i++) {
1156 while (ob_uv_map_max_idx[ob_index] < i) {
1160 if (duplicates[i] == -1) {
1164 copy_v2_v2(uv_map_arr[i], uv_map_arr[duplicates[i]]);
1165 changed[ob_index] =
true;
1168 for (ob_index = 0; ob_index < objects.
size(); ob_index++) {
1169 if (changed[ob_index]) {
1170 Object *obedit = objects[ob_index];
1179 MEM_delete(changed);
1180 MEM_delete(ob_uv_map_max_idx);
1194 *bmain, scene, view_layer,
nullptr);
1198 for (
Object *obedit : objects) {
1207 int uv_map_count = 0;
1219 for (
Object *obedit : objects) {
1220 bool changed =
false;
1226 if (i != -1 && nearest.
dist < threshold) {
1254 *bmain, scene, view_layer,
nullptr);
1259 for (
Object *obedit : objects) {
1269 bool changed =
false;
1279 if (uvs.
size() <= 1) {
1284 while (uvs.
size() > 1) {
1285 const int uvs_num = uvs.
size();
1286 float2 uv_average = {0.0f, 0.0f};
1287 for (
const float *luv : uvs) {
1288 uv_average +=
float2(luv);
1290 uv_average /= uvs_num;
1296 float *uv_ref = uvs[0];
1297 int uv_ref_index = 0;
1298 for (
int i = 1; i < uvs_num; i++) {
1300 if (dist_test_sq < dist_best_sq) {
1301 dist_best_sq = dist_test_sq;
1307 const int uvs_end = uvs_num - 1;
1308 std::swap(uvs[uv_ref_index], uvs[uvs_end]);
1313 float2 uv_merged_average = {uv_ref[0], uv_ref[1]};
1315 int uvs_num_merged = 1;
1316 while (uvs[i] != uv_ref && i < uvs_num - uvs_num_merged) {
1318 if (dist_test_sq < threshold_sq) {
1319 uv_merged_average +=
float2(uvs[i]);
1320 std::swap(uvs[i], uvs[uvs_end - uvs_num_merged]);
1322 if (dist_test_sq != 0.0f) {
1333 if (uvs_num_merged > 1) {
1334 uv_merged_average /= uvs_num_merged;
1336 for (
int j = uvs_num - uvs_num_merged; j < uvs_num; j++) {
1341 uvs.resize(uvs_num - uvs_num_merged);
1369 ot->
name =
"Merge UVs by Distance";
1371 "Selected UV vertices that are within a radius of each other are welded together";
1372 ot->
idname =
"UV_OT_remove_doubles";
1385 "Maximum distance between welded vertices",
1392 "Merge selected to other unselected vertices");
1394 ot->
srna,
"use_shared_vertex",
false,
"Shared Vertex",
"Weld UVs based on shared vertices");
1414 ot->
description =
"Weld selected UV vertices together";
1415 ot->
idname =
"UV_OT_weld";
1432 uvco[1] =
roundf(uvco[1] * h) / h;
1437 int width = 0, height = 0;
1460 bool changed =
false;
1474 *bmain, scene, view_layer,
nullptr);
1496 {0,
"PIXELS", 0,
"Pixels",
""},
1497 {1,
"SELECTED", 0,
"Selected",
""},
1498 {2,
"ORIGIN", 0,
"Origin",
""},
1499 {0,
nullptr, 0,
nullptr,
nullptr},
1503 ot->
name =
"Snap Cursor";
1505 ot->
idname =
"UV_OT_snap_cursor";
1514 ot->
srna,
"target", target_items, 0,
"Target",
"Target to snap the selected UVs to");
1526 bool changed =
false;
1539 bool changed =
false;
1554 BMIter iter, liter, lsubiter;
1556 bool changed =
false;
1577 float uv[2] = {0.0f, 0.0f};
1606 int width = 0, height = 0;
1608 bool changed =
false;
1629 float offset[2] = {0};
1632 *bmain, scene, view_layer,
nullptr);
1642 bool changed_multi =
false;
1643 for (
Object *obedit : objects) {
1649 bool changed =
false;
1666 changed_multi =
true;
1679 {0,
"PIXELS", 0,
"Pixels",
""},
1680 {1,
"CURSOR", 0,
"Cursor",
""},
1681 {2,
"CURSOR_OFFSET", 0,
"Cursor (Offset)",
""},
1682 {3,
"ADJACENT_UNSELECTED", 0,
"Adjacent Unselected",
""},
1683 {0,
nullptr, 0,
nullptr,
nullptr},
1687 ot->
name =
"Snap Selection";
1688 ot->
description =
"Snap selected UV vertices to target type";
1689 ot->
idname =
"UV_OT_snap_selected";
1698 ot->
srna,
"target", target_items, 0,
"Target",
"Target to snap the selected UVs to");
1719 *bmain, scene, view_layer,
nullptr);
1721 for (
Object *obedit : objects) {
1722 Mesh &
mesh = *id_cast<Mesh *>(obedit->data);
1725 bool changed =
false;
1774 "Set/clear selected UV vertices as anchored between multiple unwrap operations";
1775 ot->
idname =
"UV_OT_pin";
1784 ot->
srna,
"clear",
false,
"Clear",
"Clear pinning for the selection instead of setting it");
1790 "Invert pinning for the selection instead of setting it");
1802#define UV_VERT_SEL_TEST(ts, bm, l, bool_test) \
1803 (uvedit_vert_select_get_no_sync(ts, bm, l) == bool_test)
1805#define UV_EDGE_SEL_TEST(ts, bm, l, bool_test) \
1806 (uvedit_edge_select_get_no_sync(ts, bm, l) == bool_test)
1867 }
while ((l_iter = l_iter->
next) != l_first);
1874 const bool select_to_hide = !
swap;
1876 bool changed =
false;
1898 BMLoop *l_iter, *l_first;
1908 }
while ((l_iter = l_iter->
next) != l_first);
1918 BMLoop *l_iter, *l_first;
1928 }
while ((l_iter = l_iter->
next) != l_first);
2007 bool changed =
false;
2008 bool changed_uv =
false;
2010 const auto bm_vert_deselect_for_pass_fn = [&scene, &
bm, &
swap](
BMVert *
v,
int pass) ->
bool {
2027 const auto bm_edge_deselect_for_pass_fn = [&scene, &
bm, &
swap](
BMEdge *
e,
int pass) ->
bool {
2029 BMLoop *l_iter, *l_first;
2030 l_iter = l_first =
e->l;
2038 }
while ((l_iter = l_iter->
radial_next) != l_first);
2112 for (
int pass = 0; pass <= pass_end; pass++) {
2119 if (use_face_center) {
2125 changed |= bm_vert_deselect_for_pass_fn(
l->
v, pass);
2135 if (e_select_prev || e_select_curr) {
2136 changed |= bm_vert_deselect_for_pass_fn(
l->
v, pass);
2138 e_select_prev = e_select_curr;
2144 changed |= bm_vert_deselect_for_pass_fn(
l->
v, pass);
2149 if (pass == pass_end) {
2157 if (use_face_center) {
2161 changed |= bm_edge_deselect_for_pass_fn(
l->
e, pass);
2170 changed |= bm_edge_deselect_for_pass_fn(
l->
e, pass);
2175 changed |= bm_edge_deselect_for_pass_fn(
l->
e, pass);
2180 if (pass == pass_end) {
2188 if (use_face_center) {
2229 if (changed || changed_uv) {
2234 return changed || changed_uv;
2246 *bmain, scene, view_layer,
nullptr);
2248 for (
Object *ob : objects) {
2262#undef UV_VERT_SEL_TEST
2263#undef UV_EDGE_SEL_TEST
2268 ot->
name =
"Hide Selected";
2269 ot->
description =
"Hide (un)selected UV vertices";
2270 ot->
idname =
"UV_OT_hide";
2279 ot->
srna,
"unselected",
false,
"Unselected",
"Hide unselected rather than selected");
2299 *bmain, scene, view_layer,
nullptr);
2301 for (
Object *ob : objects) {
2316 Mesh *
mesh = id_cast<Mesh *>(ob->data);
2330 if (use_face_center) {
2415 ot->
name =
"Reveal Hidden";
2416 ot->
description =
"Reveal all hidden UV vertices";
2417 ot->
idname =
"UV_OT_reveal";
2468 ®ion->
v2d, event->
mval[0], event->
mval[1], &location[0], &location[1]);
2477 ot->
name =
"Set 2D Cursor";
2479 ot->
idname =
"UV_OT_cursor_set";
2494 "Cursor location in normalized (0.0 to 1.0) coordinates",
2512 bool changed_multi =
false;
2515 *bmain, scene, view_layer,
nullptr);
2517 for (
Object *ob : objects) {
2518 Mesh *
mesh = id_cast<Mesh *>(ob->data);
2527 bool changed =
false;
2554 }
while ((l_other = l_other->
radial_next) != l_iter);
2565 }
while ((l_iter = l_iter->
next) != l_first);
2569 changed_multi =
true;
2581 ot->
name =
"Seams from Islands";
2582 ot->
description =
"Set mesh seams according to island setup in the UV editor";
2583 ot->
idname =
"UV_OT_seams_from_islands";
2592 RNA_def_boolean(ot->
srna,
"mark_seams",
true,
"Mark Seams",
"Mark boundary edges as seams");
2593 RNA_def_boolean(ot->
srna,
"mark_sharp",
false,
"Mark Sharp",
"Mark boundary edges as sharp");
2617 *bmain, scene, view_layer,
nullptr);
2619 bool changed =
false;
2621 for (
Object *ob : objects) {
2622 Mesh *
mesh = id_cast<Mesh *>(ob->data);
2662 ui::Layout &layout = *popup_menu_layout(pup);
2672 popup_menu_end(
C, pup);
2680 ot->
name =
"Mark Seam";
2681 ot->
description =
"Mark selected UV edges as seams";
2682 ot->
idname =
"UV_OT_mark_seam";
2692 RNA_def_boolean(ot->
srna,
"clear",
false,
"Clear Seams",
"Clear instead of marking seams");
2697 const int mesh_axis,
2699 const int precision,
2703 const float precision_scale =
powf(10.0f, precision);
2714 const int axis = mesh_axis % 3;
2717 if (pos[axis] >= 0.0f) {
2722 if (pos[axis] <= 0.0f) {
2729 for (
const auto &[pos,
v] : mirror_gt.
items()) {
2731 mirror_pos[axis] = -mirror_pos[axis];
2734 vmap.
add(
v, v_mirror);
2737 for (
const auto &[pos,
v] : mirror_lt.
items()) {
2739 mirror_pos[axis] = -mirror_pos[axis];
2742 vmap.
add(
v, v_mirror);
2763 sorted_verts[loop_index] =
l->
v;
2766 std::ranges::sort(sorted_verts);
2767 sorted_verts_to_face.
add(std::move(sorted_verts), f);
2771 for (
const auto &[sorted_verts, f_dst] : sorted_verts_to_face.
items()) {
2776 std::ranges::sort(mirror_verts);
2779 if (f_src != f_dst) {
2780 face_map.
add(f_dst, f_src);
2787 bool changed =
false;
2788 const int other_uv_axis = 1 - uv_axis;
2790 for (
const auto &[f_dst, f_src] : face_map.
items()) {
2801 float f_dst_center[3];
2803 if (
is_negative ? (f_dst_center[axis] > 0.0f) : (f_dst_center[axis] < 0.0f)) {
2824 uv_dst[uv_axis] = -(uv_src[uv_axis] - 0.5f) + 0.5f;
2825 uv_dst[other_uv_axis] = uv_src[other_uv_axis];
2839 *bmain, scene, view_layer,
nullptr);
2845 int total_duplicates = 0;
2846 int meshes_with_duplicates = 0;
2848 for (
Object *obedit : objects) {
2851 int double_warn = 0;
2856 total_duplicates += double_warn;
2857 meshes_with_duplicates++;
2866 if (total_duplicates) {
2869 "%d duplicates found in %d mesh(es), mirror may be incomplete",
2871 meshes_with_duplicates);
2878 ot->
name =
"Copy Mirrored UV Coords";
2879 ot->
description =
"Copy mirror UV coordinates based on a mirrored mesh";
2880 ot->
idname =
"UV_OT_copy_mirrored_faces";
2892 "Mirror vertices based on mesh axis");
2901 "Tolerance for finding vertex duplicates",
2981 "Unstitch UVs and move the result",
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for materials.
#define SH_NODE_TEX_IMAGE
#define SH_NODE_TEX_ENVIRONMENT
A KD-tree for nearest neighbor search.
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define INIT_MINMAX2(min, max)
#define UNUSED_VARS_NDEBUG(...)
#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)
#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)
#define BM_elem_hide_set(bm, ele, hide)
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(float, float) RET
float2x2 invert(float2x2 mat)
bool is_negative(float3x3 mat)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
ENUM_OPERATORS(Layer::Flags)
bNode * node_get_active_texture(bNodeTree &ntree)
T distance_squared(const VecBase< T, Size > &a, const VecBase< T, Size > &b)
PopupMenu * popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void UV_OT_paste(wmOperatorType *ot)
static wmOperatorStatus uv_move_on_axis_exec(bContext *C, wmOperator *op)
void WM_main_add_notifier(uint type, void *reference)
void EDBM_flag_disable_all(BMesh *bm, char hflag)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
void uvedit_live_unwrap_update(SpaceImage *sima, Scene *scene, Object *obedit)
void kdtree_balance(KDTree< CoordT > *tree)
bool BM_uv_map_attr_pin_exists(const BMesh *bm, const StringRef uv_map_name)
static void UV_OT_cursor_set(wmOperatorType *ot)
bool ED_operator_uvedit(bContext *C)
void UV_OT_minimize_stretch(wmOperatorType *ot)
static wmOperatorStatus uv_set_2d_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void UV_OT_custom_region_set(wmOperatorType *ot)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void UV_OT_project_from_view(wmOperatorType *ot)
bool uvedit_edge_select_test(const Scene *scene, const BMesh *bm, const BMLoop *l, const BMUVOffsets &offsets)
static wmOperatorStatus uv_arrange_islands_exec(bContext *C, wmOperator *op)
static void uv_weld(bContext *C)
void EDBM_selectmode_flush(BMesh *bm, short selectmode)
void UV_OT_copy(wmOperatorType *ot)
bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, ARegion *region, const int mval[2])
static bool uv_snap_uvs_to_adjacent_unselected(Scene *scene, Object *obedit)
const EnumPropertyItem rna_enum_object_axis_flip_items[]
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void UV_OT_pack_islands(wmOperatorType *ot)
void UV_OT_select_linked(wmOperatorType *ot)
void ED_uvedit_foreach_uv(const Scene *scene, BMesh *bm, const bool skip_invisible, const bool selected, FunctionRef< void(float[2])> user_fn)
void UV_OT_shortest_path_select(wmOperatorType *ot)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
bool uvedit_face_visible_test(const Scene *scene, const BMFace *efa)
static wmOperatorStatus uv_seams_from_islands_exec(bContext *C, wmOperator *op)
MINLINE void mul_v2_fl(float r[2], float f)
static bool uv_snap_cursor_to_selection(Scene *scene, Span< Object * > objects_edit, SpaceImage *sima)
static wmOperatorStatus uv_remove_doubles_exec(bContext *C, wmOperator *op)
static wmOperatorStatus uv_set_2d_cursor_exec(bContext *C, wmOperator *op)
const char * RNA_property_identifier(const PropertyRNA *prop)
MINLINE void copy_v2_v2(float r[2], const float a[2])
Material * BKE_object_material_get(Object *ob, short act)
static bool bm_face_is_any_edge_sel(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
void uvedit_face_select_disable(const Scene *scene, BMesh *bm, BMFace *efa)
void uvedit_vert_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMLoop *l, bool select)
const EnumPropertyItem rna_enum_axis_xy_items[]
bool uvedit_select_is_any_selected_multi(const Scene *scene, Span< Object * > objects)
static wmOperatorStatus uv_snap_cursor_exec(bContext *C, wmOperator *op)
void ED_space_image_get_size(SpaceImage *sima, int *r_width, int *r_height)
static void uv_snap_to_pixel(float uvco[2], float w, float h)
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CENTER_MEDIAN
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit)
void ED_uvedit_foreach_uv_multi(const Scene *scene, Span< Object * > objects_edit, const bool skip_invisible, const bool skip_nonselected, FunctionRef< void(float[2])> user_fn)
void UV_OT_select_similar(wmOperatorType *ot)
void UV_OT_select_linked_pick(wmOperatorType *ot)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
static void UV_OT_snap_cursor(wmOperatorType *ot)
int RNA_int_get(PointerRNA *ptr, const char *name)
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
bool ED_uvedit_minmax_multi(const Scene *scene, Span< Object * > objects_edit, float r_min[2], float r_max[2])
static void uv_align(bContext *C, eUVWeldAlign tool, UVAlignPositionMode position_mode)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static bool uv_mesh_hide_no_sync(const Scene *scene, Object *ob, BMEditMesh *em, bool swap)
static wmOperatorStatus uv_hide_exec(bContext *C, wmOperator *op)
void UV_OT_rip(wmOperatorType *ot)
static bool uvedit_uv_straighten(Scene *scene, BMesh *bm, eUVWeldAlign tool)
void BM_uv_element_map_free(UvElementMap *element_map)
void UV_OT_select_by_winding(wmOperatorType *ot)
void ED_uvedit_live_unwrap_re_solve()
void BM_mesh_select_mode_flush(BMesh *bm)
bool EDBM_uv_check(const Mesh *mesh)
ViewLayer * CTX_data_view_layer(const bContext *C)
static wmOperatorStatus uv_mark_seam_invoke(bContext *C, wmOperator *op, const wmEvent *)
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)
static void UV_OT_arrange_islands(wmOperatorType *ot)
bool uvedit_uv_select_test(const Scene *scene, const BMesh *bm, const BMLoop *l, const BMUVOffsets &offsets)
static wmOperatorStatus uv_mark_seam_exec(bContext *C, wmOperator *op)
KDTree< CoordT > * kdtree_new(uint nodes_len_capacity)
void UV_OT_sphere_project(wmOperatorType *ot)
void ED_uvedit_live_unwrap(const Scene *scene, Span< Object * > objects)
bool ED_operator_editmesh(bContext *C)
static bool uvedit_uv_align_weld(Scene *scene, BMesh *bm, const eUVWeldAlign tool, const float cent[2])
void UV_OT_select_circle(wmOperatorType *ot)
void uvedit_edge_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMLoop *l, bool select)
VecBase< float, 2 > float2
MINLINE void add_v2_v2(float r[2], const float a[2])
bool EDBM_mesh_hide(BMesh *bm, const short selectmode, bool swap)
void UV_OT_select_mode(wmOperatorType *ot)
void UV_OT_select_loop(wmOperatorType *ot)
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
void UV_OT_select(wmOperatorType *ot)
void DEG_id_tag_update(ID *id, unsigned int flags)
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)
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)
void UV_OT_shortest_path_pick(wmOperatorType *ot)
bool EDBM_mesh_reveal(BMesh *bm, const short selectmode, bool select)
static wmOperatorStatus uv_reveal_exec(bContext *C, wmOperator *op)
void UV_OT_unwrap(wmOperatorType *ot)
static wmOperatorStatus uv_remove_doubles_to_selected(bContext *C, wmOperator *op)
static void UV_OT_pin(wmOperatorType *ot)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
void kdtree_insert(KDTree< CoordT > *tree, int index, const CoordT &co)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
static bool uv_snap_uvs_to_cursor(Scene *scene, Object *obedit, const float cursor[2])
void UV_OT_select_box(wmOperatorType *ot)
bool ED_uvedit_center_from_pivot_ex(const Main &bmain, const SpaceImage *sima, Scene *scene, ViewLayer *view_layer, float r_center[2], char mode, bool *r_has_select)
bool uvedit_face_select_test(const Scene *scene, const BMesh *bm, const BMFace *efa)
static bool uv_mesh_hide_select_sync(const ToolSettings *ts, Object *ob, BMEditMesh *em, bool swap)
static wmOperatorStatus uv_align_exec(bContext *C, wmOperator *op)
int kdtree_find_nearest(const KDTree< CoordT > *tree, const CoordT &co, KDTreeNearest< CoordT > *r_nearest)
static bool uv_copy_mirrored_faces(const Scene *scene, BMesh *bm, const int mesh_axis, const int uv_axis, const int precision, int *r_double_warn)
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
void uvedit_face_select_set_no_sync(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select)
void ED_operatortypes_uvedit()
static bool bm_face_is_any_vert_sel(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
static void UV_OT_align(wmOperatorType *ot)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
void UV_OT_select_overlap(wmOperatorType *ot)
bool ED_uvedit_sync_uvselect_ignore(const ToolSettings *ts)
static eUVEndPointPrecedence uvedit_line_update_get_precedence(const bool pinned)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool ED_operator_uvedit_space_image(bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
static void UV_OT_move_on_axis(wmOperatorType *ot)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void ED_uvedit_select_all(const ToolSettings *ts, BMesh *bm)
void ED_uvedit_live_unwrap_end(bool cancel)
void UV_OT_select_edge_ring(wmOperatorType *ot)
void BM_uv_map_attr_pin_ensure_named(BMesh *bm, const StringRef uv_map_name)
static wmOperatorStatus uv_pin_exec(bContext *C, wmOperator *op)
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)
void BM_select_history_validate(BMesh *bm)
void UV_OT_select_pinned(wmOperatorType *ot)
static wmOperatorStatus uv_weld_exec(bContext *C, wmOperator *)
void UV_OT_select_tile(wmOperatorType *ot)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
void UV_OT_cube_project(wmOperatorType *ot)
void ED_keymap_uvedit(wmKeyConfig *keyconf)
static bool uv_snap_uvs_offset(Scene *scene, Object *obedit, const float offset[2])
SpaceImage * CTX_wm_space_image(const bContext *C)
void UV_OT_average_islands_scale(wmOperatorType *ot)
void UV_OT_select_more(wmOperatorType *ot)
void kdtree_free(KDTree< CoordT > *tree)
void UV_OT_cylinder_project(wmOperatorType *ot)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
static bool uv_align_poll_property(const bContext *, wmOperator *op, const PropertyRNA *prop)
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)
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
static bool bm_face_is_any_sel(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
void UV_OT_select_all(wmOperatorType *ot)
void ED_operatormacros_uvedit()
Main * CTX_data_main(const bContext *C)
static void UV_OT_snap_selected(wmOperatorType *ot)
UvElementMap * BM_uv_element_map_create(BMesh *bm, const Scene *scene, bool uv_selected, bool use_winding, bool use_seams, bool do_islands)
static void UV_OT_remove_doubles(wmOperatorType *ot)
Material * BKE_object_material_get_eval(Object *ob, short act)
static void UV_OT_seams_from_islands(wmOperatorType *ot)
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
void ED_uvedit_live_unwrap_begin(Scene *scene, Object *obedit, struct wmWindow *win_modal)
int kdtree_calc_duplicates_fast(const KDTree< CoordT > *tree, const typename KDTree< CoordT >::ValueType range, const bool use_index_order, int *duplicates)
void UV_OT_reset(wmOperatorType *ot)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
bool BM_loop_uv_share_edge_check(const BMLoop *l_a, const BMLoop *l_b, const int cd_loop_uv_offset)
bool EDBM_uvselect_clear(BMesh *bm)
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
bool ED_uvedit_test(Object *obedit)
Scene * CTX_data_scene(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
static void UV_OT_mark_seam(wmOperatorType *ot)
bool ED_uvedit_center_multi(const Scene *scene, Span< Object * > objects_edit, float r_cent[2], char mode)
static void uv_snap_cursor_to_origin(float uvco[2])
bool ED_space_image_cursor_poll(bContext *C)
static void UV_OT_reveal(wmOperatorType *ot)
BMUVOffsets BM_uv_map_offsets_get(const BMesh *bm)
VecBase< float, 3 > float3
static wmOperatorStatus uv_copy_mirrored_faces_exec(bContext *C, wmOperator *op)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
ATTR_WARN_UNUSED_RESULT const void * element
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void UV_OT_copy_mirrored_faces(wmOperatorType *ot)
static wmOperatorStatus uv_remove_doubles_to_selected_shared_vertex(bContext *C, wmOperator *op)
static void UV_OT_hide(wmOperatorType *ot)
bool DEG_is_evaluated(const T *id)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
static bool uvedit_uv_straighten_elements(const UvElement *element, const int len, const BMUVOffsets &offsets, const eUVWeldAlign tool)
static bool is_image_texture_node(bNode *node)
float closest_to_line_segment_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
void UV_OT_select_lasso(wmOperatorType *ot)
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)
void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *ima)
MINLINE void zero_v2(float r[2])
ARegion * CTX_wm_region(const bContext *C)
static wmOperatorStatus uv_remove_doubles_to_unselected(bContext *C, wmOperator *op)
void UV_OT_select_split(wmOperatorType *ot)
static wmOperatorStatus uv_snap_selection_exec(bContext *C, wmOperator *op)
float RNA_float_get(PointerRNA *ptr, const char *name)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void UV_OT_smart_project(wmOperatorType *ot)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
static bool bm_face_is_all_uv_sel(const ToolSettings *ts, const BMesh *bm, BMFace *f, bool select_test)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
static bool uvedit_median_multi(const Scene *scene, const Span< Object * > objects_edit, float co[2])
void UV_OT_stitch(wmOperatorType *ot)
static void UV_OT_weld(wmOperatorType *ot)
void UV_OT_select_less(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)
static void uv_snap_cursor_to_pixels(SpaceImage *sima)
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
struct BMLoop * radial_next
bool uv_select_sync_valid
struct ToolSettings * toolsettings
int custom_grid_subdiv[2]
void operator_context_set(wm::OpCallContext opcontext)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
bool(*) poll(struct bContext *)
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
#define UV_VERT_SEL_TEST(ts, bm, l, bool_test)
#define UV_EDGE_SEL_TEST(ts, bm, l, bool_test)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)