Commit: ad58a423ea435ca49dd9638d8fdec5f9faeab0b9
Author: Campbell Barton
Date:   Tue Mar 13 18:50:42 2018 +1100
Branches: temp-object-multi-mode
https://developer.blender.org/rBad58a423ea435ca49dd9638d8fdec5f9faeab0b9

Merge branch '28' into temp-object-multi-mode

===================================================================



===================================================================

diff --cc source/blender/editors/include/ED_uvedit.h
index e834c5b1ca7,15de57da09c..c3b9d43a54a
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@@ -102,8 -118,8 +118,10 @@@ void ED_uvedit_live_unwrap_re_solve(voi
  void ED_uvedit_live_unwrap_end(short cancel);
  
  void ED_uvedit_live_unwrap(struct Scene *scene, struct Object *obedit);
- void ED_uvedit_pack_islands_single(struct Scene *scene, struct Object *ob, 
struct BMesh *bm, bool selected, bool correct_aspect, bool do_rotate);
- void ED_uvedit_pack_islands_multi(struct Scene *scene, ViewLayer *view_layer, 
bool selected, bool correct_aspect, bool do_rotate);
 -void ED_uvedit_pack_islands(
 -struct Scene *scene, struct Object *ob, struct BMesh *bm, bool selected, bool 
correct_aspect, bool do_rotate);
++void ED_uvedit_pack_islands_single(
++        struct Scene *scene, struct Object *ob, struct BMesh *bm, bool 
selected, bool correct_aspect, bool do_rotate);
++void ED_uvedit_pack_islands_multi(
++        struct Scene *scene, ViewLayer *view_layer, bool selected, bool 
correct_aspect, bool do_rotate);
  void ED_uvedit_unwrap_cube_project(
          struct BMesh *bm, float cube_size, bool use_select, const float 
center[3]);
  
@@@ -112,7 -128,8 +130,8 @@@ void ED_unwrap_lscm(struct Scene *scene
  
  
  /* uvedit_draw.c */
- void ED_image_draw_cursor(struct ARegion *ar, const float cursor[2]);
+ void ED_image_draw_cursor(
 -struct ARegion *ar, const float cursor[2]);
++       struct ARegion *ar, const float cursor[2]);
  void ED_uvedit_draw_main(
          struct SpaceImage *sima, const struct EvaluationContext *eval_ctx,
          struct ARegion *ar, struct Scene *scene, struct ViewLayer *view_layer,
diff --cc source/blender/editors/uvedit/uvedit_ops.c
index 8c16e3b29b8,1acd6a1152d..2ac6dfda78c
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@@ -810,22 -837,9 +855,23 @@@ bool uv_find_nearest_face
        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(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)
+ static bool uv_nearest_between(
+         const BMLoop *l, const float co[2],
+         const int cd_loop_uv_offset)
  {
        const float *uv_prev = ((MLoopUV *)BM_ELEM_CD_GET_VOID_P(l->prev, 
cd_loop_uv_offset))->uv;
        const float *uv_curr = ((MLoopUV *)BM_ELEM_CD_GET_VOID_P(l,       
cd_loop_uv_offset))->uv;
@@@ -1138,13 -1141,16 +1188,17 @@@ static int uv_select_edgeloop
        return (select) ? 1 : -1;
  }
  
- /*********************** linked select ***********************/
+ /** \} */
+ 
+ /* -------------------------------------------------------------------- */
+ /** \name Select Linked
+  * \{ */
  
  static void uv_select_linked(
-         Scene *scene, Image *ima, Object *obedit,
-         const float limit[2], UvNearestHit *hit_final, bool extend, bool 
select_faces)
 -        Scene *scene, Image *ima, Object *obedit, BMEditMesh *em, const float 
limit[2],
++        Scene *scene, Image *ima, Object *obedit, 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;
@@@ -1923,55 -1951,15 +1999,58 @@@ static void UV_OT_weld(wmOperatorType *
        ot->poll = ED_operator_uvedit;
  }
  
+ /** \} */
  
- /* ******************** (de)select all operator **************** */
+ /* -------------------------------------------------------------------- */
+ /** \name (De)Select All Operator
+  * \{ */
  
 -static void uv_select_all_perform(Scene *scene, Image *ima, Object *obedit, 
BMEditMesh *em, int action)
 +
 +static bool uv_select_is_any_selected(Scene *scene, Image *ima, Object 
*obedit)
 +{
 +      ToolSettings *ts = scene->toolsettings;
 +      BMEditMesh *em = BKE_editmesh_from_object(obedit);
 +      BMFace *efa;
 +      BMLoop *l;
 +      BMIter iter, liter;
 +      MLoopUV *luv;
 +
 +      if (ts->uv_flag & UV_SYNC_SELECTION) {
 +              return (em->bm->totvertsel || em->bm->totedgesel || 
em->bm->totfacesel);
 +      }
 +      else {
 +              const int cd_loop_uv_offset  = 
CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 +              BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 +                      if (!uvedit_face_visible_test(scene, obedit, ima, efa)) 
{
 +                              continue;
 +                      }
 +                      BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
 +                              luv = BM_ELEM_CD_GET_VOID_P(l, 
cd_loop_uv_offset);
 +                              if (luv->flag & MLOOPUV_VERTSEL) {
 +                                      return true;
 +                              }
 +                      }
 +              }
 +      }
 +      return false;
 +}
 +
 +static bool uv_select_is_any_selected_multi(Scene *scene, Image *ima, 
ViewLayer *view_layer)
 +{
 +      bool found = false;
 +      FOREACH_OBJECT_IN_EDIT_MODE_BEGIN (view_layer, ob_iter) {
 +              if (uv_select_is_any_selected(scene, ima, ob_iter)) {
 +                      found = true;
 +                      break;
 +              }
 +      } FOREACH_OBJECT_IN_EDIT_MODE_END;
 +      return found;
 +}
 +
 +static void uv_select_all_perform(Scene *scene, Image *ima, Object *obedit, 
int action)
  {
        ToolSettings *ts = scene->toolsettings;
 +      BMEditMesh *em = BKE_editmesh_from_object(obedit);
        BMFace *efa;
        BMLoop *l;
        BMIter iter, liter;
@@@ -2892,11 -2888,14 +2993,12 @@@ static int uv_border_select_exec(bConte
        BMIter iter, liter;
        MLoopUV *luv;
        rctf rectf;
 -      bool changed, pinned, select, extend;
 +      bool pinned, select, extend;
-       const bool use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ?
-                                   (ts->selectmode == SCE_SELECT_FACE) :
-                                   (ts->uv_selectmode == UV_SELECT_FACE);
+       const bool use_face_center = (
+               (ts->uv_flag & UV_SYNC_SELECTION) ?
+               (ts->selectmode == SCE_SELECT_FACE) :
+               (ts->uv_selectmode == UV_SELECT_FACE));
  
 -      const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, 
CD_MLOOPUV);
 -
        /* get rectangle from operator */
        WM_operator_properties_border_to_rctf(op, &rectf);
        UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf);
@@@ -3136,11 -3125,15 +3243,14 @@@ static void UV_OT_circle_select(wmOpera
        WM_operator_properties_gesture_circle_select(ot);
  }
  
+ /** \} */
  
- /* ******************** lasso select operator **************** */
+ /* -------------------------------------------------------------------- */
+ /** \name Lasso Select Operator
+  * \{ */
  
 -static bool do_lasso_select_mesh_uv(
 -        bContext *C, const int mcords[][2], short moves,
 -        const bool select, const bool extend)
 +static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short 
moves,
 +                                    const bool select, const bool extend)
  {
        SpaceImage *sima = CTX_wm_space_image(C);
        Image *ima = CTX_data_edit_image(C);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to