Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jan 2018 09:04:54 +0000 (20:04 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jan 2018 09:04:54 +0000 (20:04 +1100)
1  2 
build_files/cmake/macros.cmake
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_view.c

Simple merge
index d286e608de44d38ed847d123be72c6d811c3bf22,c401b6618f2b776fb2bbe35a7446f73fb5185ac0..1d97541e813043f59249d7b595fd1bfa10630c9e
@@@ -893,15 -920,15 +930,17 @@@ static void viewops_data_free(bContext 
                ar = CTX_wm_region(C);
        }
  
 +#if 0
        if (p && (p->flags & PAINT_FAST_NAVIGATE))
 +#endif
                ED_region_tag_redraw(ar);
  }
- /** \} */
  
+ /** \} */
  
- /* ************************** viewrotate **********************************/
+ /* -------------------------------------------------------------------- */
+ /** \name View Rotate
+  * \{ */
  
  enum {
        VIEW_PASS = 0,
@@@ -3375,9 -3457,14 +3470,15 @@@ void VIEW3D_OT_view_center_pick(wmOpera
        ot->flag = 0;
  }
  
+ /** \} */
+ /* -------------------------------------------------------------------- */
+ /** \name View Camera Center Operator
+  * \{ */
  static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
  {
 +      const Depsgraph *depsgraph = CTX_data_depsgraph(C);
        Scene *scene = CTX_data_scene(C);
        float xfac, yfac;
        float size[2];
@@@ -3764,8 -3882,15 +3883,15 @@@ void VIEW3D_OT_zoom_border(wmOperatorTy
        WM_operator_properties_gesture_border_zoom(ot);
  }
  
- /* sets the view to 1:1 camera/render-pixel */
+ /** \} */
+ /* -------------------------------------------------------------------- */
+ /** \name Set Camera Zoom 1:1 Operator
+  *
+  * Sets the view to 1:1 camera/render-pixel.
+  * \{ */
 -static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar, View3D *v3d)
 +static void view3d_set_1_to_1_viewborder(Scene *scene, const Depsgraph *depsgraph, ARegion *ar, View3D *v3d)
  {
        RegionView3D *rv3d = ar->regiondata;
        float size[2];
@@@ -4520,14 -4678,17 +4681,17 @@@ void VIEW3D_OT_navigate(wmOperatorType 
        ot->poll = ED_operator_view3d_active;
  }
  
+ /** \} */
  
- /* ******************** add background image operator **************** */
+ /* -------------------------------------------------------------------- */
+ /** \name Background Image Add Operator
+  * \{ */
  
 -static BGpic *background_image_add(bContext *C)
 +static CameraBGImage *background_image_add(bContext *C)
  {
 -      View3D *v3d = CTX_wm_view3d(C);
 +      Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data;
  
 -      return ED_view3D_background_image_new(v3d);
 +      return BKE_camera_background_image_new(cam);
  }
  
  static int background_image_add_exec(bContext *C, wmOperator *UNUSED(op))
@@@ -4580,19 -4741,23 +4744,23 @@@ void VIEW3D_OT_background_image_add(wmO
                WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
  }
  
+ /** \} */
+ /* -------------------------------------------------------------------- */
+ /** \name Background Image Remove Operator
+  * \{ */
  
- /* ***** remove image operator ******* */
  static int background_image_remove_exec(bContext *C, wmOperator *op)
  {
 -      View3D *v3d = CTX_wm_view3d(C);
 +      Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data;
        const int index = RNA_int_get(op->ptr, "index");
 -      BGpic *bgpic_rem = BLI_findlink(&v3d->bgpicbase, index);
 +      CameraBGImage *bgpic_rem = BLI_findlink(&cam->bg_images, index);
  
        if (bgpic_rem) {
 -              if (bgpic_rem->source == V3D_BGPIC_IMAGE) {
 +              if (bgpic_rem->source == CAM_BGIMG_SOURCE_IMAGE) {
                        id_us_min((ID *)bgpic_rem->ima);
                }
 -              else if (bgpic_rem->source == V3D_BGPIC_MOVIE) {
 +              else if (bgpic_rem->source == CAM_BGIMG_SOURCE_MOVIE) {
                        id_us_min((ID *)bgpic_rem->clip);
                }
  
@@@ -4819,7 -4992,55 +4997,11 @@@ void VIEW3D_OT_cursor3d(wmOperatorType 
  
  }
  
- /* ***************** manipulator op ******************* */
+ /** \} */
 -/* -------------------------------------------------------------------- */
 -/** \name Transform Manipulator Operator
 - * \{ */
 -
 -static int manipulator_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 -{
 -      View3D *v3d = CTX_wm_view3d(C);
 -
 -      if (!(v3d->twflag & V3D_USE_MANIPULATOR)) return OPERATOR_PASS_THROUGH;
 -      if (!(v3d->twflag & V3D_DRAW_MANIPULATOR)) return OPERATOR_PASS_THROUGH;
 -
 -      /* note; otherwise opengl won't work */
 -      view3d_operator_needs_opengl(C);
 -
 -      if (BIF_do_manipulator(C, event, op) == 0)
 -              return OPERATOR_PASS_THROUGH;
 -
 -      return OPERATOR_FINISHED;
 -}
 -
 -void VIEW3D_OT_manipulator(wmOperatorType *ot)
 -{
 -      PropertyRNA *prop;
 -
 -      /* identifiers */
 -      ot->name = "3D Manipulator";
 -      ot->description = "Manipulate selected item by axis";
 -      ot->idname = "VIEW3D_OT_manipulator";
 -
 -      /* api callbacks */
 -      ot->invoke = manipulator_invoke;
 -
 -      ot->poll = ED_operator_view3d_active;
 -
 -      /* properties to pass to transform */
 -      Transform_Properties(ot, P_CONSTRAINT);
 -
 -      prop = RNA_def_boolean(ot->srna, "use_planar_constraint", false, "Planar Constraint", "Limit the transformation to the "
 -                             "two axes that have not been clicked (translate/scale only)");
 -      RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
 -}
 -
 -/** \} */
 -
+ /* -------------------------------------------------------------------- */
+ /** \name Enable Transform Manipulator Operator
+  * \{ */
  
  static int enable_manipulator_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
  {
@@@ -5183,22 -5437,47 +5378,6 @@@ void ED_view3d_to_object(Object *ob, co
        BKE_object_apply_mat4(ob, mat, true, true);
  }
  
- /**
-  * Use to store the last view, before entering camera view.
-  */
- void ED_view3d_lastview_store(RegionView3D *rv3d)
- {
-       copy_qt_qt(rv3d->lviewquat, rv3d->viewquat);
-       rv3d->lview = rv3d->view;
-       if (rv3d->persp != RV3D_CAMOB) {
-               rv3d->lpersp = rv3d->persp;
-       }
- }
+ /** \} */
 -/* -------------------------------------------------------------------- */
 -/** \name Background Image Utilities
 - * \{ */
 -
 -BGpic *ED_view3D_background_image_new(View3D *v3d)
 -{
 -      BGpic *bgpic = MEM_callocN(sizeof(BGpic), "Background Image");
 -
 -      bgpic->rotation = 0.0f;
 -      bgpic->size = 5.0f;
 -      bgpic->blend = 0.5f;
 -      bgpic->iuser.fie_ima = 2;
 -      bgpic->iuser.ok = 1;
 -      bgpic->view = 0; /* 0 for all */
 -      bgpic->flag |= V3D_BGPIC_EXPANDED;
 -
 -      BLI_addtail(&v3d->bgpicbase, bgpic);
 -
 -      return bgpic;
 -}
  
- void ED_view3D_lock_clear(View3D *v3d)
 -void ED_view3D_background_image_remove(View3D *v3d, BGpic *bgpic)
--{
-       v3d->ob_centre = NULL;
-       v3d->ob_centre_bone[0] = '\0';
-       v3d->ob_centre_cursor = false;
-       v3d->flag2 &= ~V3D_LOCK_CAMERA;
 -      BLI_remlink(&v3d->bgpicbase, bgpic);
 -
 -      MEM_freeN(bgpic);
 -}
 -
 -void ED_view3D_background_image_clear(View3D *v3d)
 -{
 -      BGpic *bgpic = v3d->bgpicbase.first;
 -
 -      while (bgpic) {
 -              BGpic *next_bgpic = bgpic->next;
 -
 -              ED_view3D_background_image_remove(v3d, bgpic);
 -
 -              bgpic = next_bgpic;
 -      }
--}
 -
 -/** \} */