[Bf-blender-cvs] [04e76696f91] temp-object-multi-mode: Merge branch 'blender2.8' into temp-object-multi-mode
Campbell Barton
noreply at git.blender.org
Mon Mar 12 04:30:33 CET 2018
Commit: 04e76696f918de616ef5db78ef8e28cc4df691fb
Author: Campbell Barton
Date: Mon Mar 12 14:38:10 2018 +1100
Branches: temp-object-multi-mode
https://developer.blender.org/rB04e76696f918de616ef5db78ef8e28cc4df691fb
Merge branch 'blender2.8' into temp-object-multi-mode
===================================================================
===================================================================
diff --cc source/blender/editors/uvedit/uvedit_intern.h
index 9441dafb7c9,c5f16d6fb14..4d0dae069ae
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@@ -65,26 -63,17 +65,26 @@@ typedef struct UvNearestHit
#define UV_NEAREST_HIT_INIT { .dist_sq = FLT_MAX, }
- bool uv_find_nearest_vert_single(
+ bool uv_find_nearest_vert(
struct Scene *scene, struct Image *ima, struct Object *obedit,
const float co[2], const float penalty_dist, struct UvNearestHit *hit_final);
+bool uv_find_nearest_vert_multi(
+ struct Scene *scene, struct Image *ima, struct ViewLayer *view_layer,
+ const float co[2], const float penalty_dist, struct UvNearestHit *hit_final);
- bool uv_find_nearest_edge_single(
+ bool uv_find_nearest_edge(
struct Scene *scene, struct Image *ima, struct Object *obedit,
const float co[2], struct UvNearestHit *hit_final);
+bool uv_find_nearest_edge_multi(
+ struct Scene *scene, struct Image *ima, struct ViewLayer *view_layer,
+ const float co[2], struct UvNearestHit *hit_final);
- bool uv_find_nearest_face_single(
+ bool uv_find_nearest_face(
struct Scene *scene, struct Image *ima, struct Object *obedit,
const float co[2], struct UvNearestHit *hit_final);
+bool uv_find_nearest_face_multi(
+ struct Scene *scene, struct Image *ima, struct ViewLayer *view_layer,
+ const float co[2], struct UvNearestHit *hit_final);
/* utility tool functions */
diff --cc source/blender/editors/uvedit/uvedit_ops.c
index 298a48a483d,1c54ea0ebc1..c9ab8b1d3df
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@@ -753,21 -749,7 +753,21 @@@ bool uv_find_nearest_edge
return found;
}
+bool uv_find_nearest_edge_multi(
+ Scene *scene, Image *ima, ViewLayer *view_layer, const float co[2],
+ UvNearestHit *hit_final)
+{
+ bool found = false;
+ FOREACH_OBJECT_IN_EDIT_MODE_BEGIN (view_layer, ob_iter) {
- if (uv_find_nearest_edge_single(scene, ima, ob_iter, co, hit_final)) {
++ if (uv_find_nearest_edge(scene, ima, ob_iter, co, hit_final)) {
+ hit_final->ob = ob_iter;
+ found = true;
+ }
+ } FOREACH_OBJECT_IN_EDIT_MODE_END;
+ return found;
+}
+
- bool uv_find_nearest_face_single(
+ bool uv_find_nearest_face(
Scene *scene, Image *ima, Object *obedit, const float co[2],
UvNearestHit *hit_final)
{
@@@ -810,20 -792,6 +810,20 @@@
return found;
}
+bool uv_find_nearest_face_multi(
+ Scene *scene, Image *ima, ViewLayer *view_layer, const float co[2],
+ UvNearestHit *hit_final)
+{
+ bool found = false;
+ FOREACH_OBJECT_IN_EDIT_MODE_BEGIN (view_layer, ob_iter) {
- if (uv_find_nearest_face_single(scene, ima, ob_iter, co, hit_final)) {
++ if (uv_find_nearest_face(scene, ima, ob_iter, co, hit_final)) {
+ hit_final->ob = ob_iter;
+ found = true;
+ }
+ } FOREACH_OBJECT_IN_EDIT_MODE_END;
+ return found;
+}
+
static bool uv_nearest_between(const BMLoop *l, const float co[2],
const int cd_loop_uv_offset)
{
@@@ -904,20 -872,6 +904,20 @@@ bool uv_find_nearest_vert
return found;
}
+bool uv_find_nearest_vert_multi(
+ Scene *scene, Image *ima, ViewLayer *view_layer,
+ float const co[2], const float penalty_dist, UvNearestHit *hit_final)
+{
+ bool found = false;
+ FOREACH_OBJECT_IN_EDIT_MODE_BEGIN (view_layer, ob_iter) {
- if (uv_find_nearest_vert_single(scene, ima, ob_iter, co, penalty_dist, hit_final)) {
++ if (uv_find_nearest_vert(scene, ima, ob_iter, co, penalty_dist, hit_final)) {
+ hit_final->ob = ob_iter;
+ found = true;
+ }
+ } FOREACH_OBJECT_IN_EDIT_MODE_END;
+ return found;
+}
+
bool ED_uvedit_nearest_uv(Scene *scene, Object *obedit, Image *ima, const float co[2], float r_uv[2])
{
BMEditMesh *em = BKE_editmesh_from_object(obedit);
@@@ -1061,7 -1014,7 +1061,7 @@@ static int uv_select_edgeloop
BM_mesh_elem_index_ensure(em->bm, BM_VERT | BM_FACE);
if (!extend) {
-- uv_select_all_perform(scene, ima, obedit, em, SEL_DESELECT);
++ uv_select_all_perform(scene, ima, obedit, SEL_DESELECT);
}
BM_mesh_elem_hflag_disable_all(em->bm, BM_FACE, BM_ELEM_TAG, false);
@@@ -1141,10 -1094,9 +1141,10 @@@
/*********************** linked select ***********************/
static void uv_select_linked(
- Scene *scene, Image *ima, Object *obedit, BMEditMesh *em, const float limit[2],
- UvNearestHit *hit_final, bool extend, bool select_faces)
+ Scene *scene, Image *ima, Object *obedit,
- const float limit[2], UvNearestHit *hit, bool extend, bool select_faces)
++ const float limit[2], UvNearestHit *hit_final, bool extend, bool select_faces)
{
+ BMEditMesh *em = BKE_editmesh_from_object(obedit);
BMFace *efa;
BMLoop *l;
BMIter iter, liter;
@@@ -2490,11 -2389,7 +2491,11 @@@ static int uv_select_linked_internal(bC
}
}
- uv_select_linked(scene, ima, obedit, em, limit, pick ? &hit : NULL, extend, select_faces);
+ if (!extend) {
+ uv_select_all_perform_multi(scene, ima, view_layer, SEL_DESELECT);
+ }
+
- uv_select_linked(scene, ima, obedit, limit, hit_p, extend, select_faces);
++ uv_select_linked(scene, ima, obedit, limit, pick ? &hit : NULL, extend, select_faces);
DEG_id_tag_update(obedit->data, 0);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
More information about the Bf-blender-cvs
mailing list