Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_view3d / view3d_camera_control.c
index e27b3fe13f9857e0987d31c6f98037adab419a96..5962f1ed2ff149d5aa5c18234ad055411d1953b6 100644 (file)
@@ -54,8 +54,9 @@
 #include "BLI_utildefines.h"
 
 #include "BKE_object.h"
+#include "BKE_context.h"
 
-#include "BKE_depsgraph.h" /* for object updating */
+#include "DEG_depsgraph.h"
 
 #include "ED_screen.h"
 
@@ -137,7 +138,7 @@ Object *ED_view3d_cameracontrol_object_get(View3DCameraControl *vctrl)
  * the view for first-person style navigation.
  */
 struct View3DCameraControl *ED_view3d_cameracontrol_acquire(
-        Scene *scene, View3D *v3d, RegionView3D *rv3d,
+        const EvaluationContext *eval_ctx, Scene *scene, View3D *v3d, RegionView3D *rv3d,
         const bool use_parent_root)
 {
        View3DCameraControl *vctrl;
@@ -177,7 +178,7 @@ struct View3DCameraControl *ED_view3d_cameracontrol_acquire(
                /* store the original camera loc and rot */
                vctrl->obtfm = BKE_object_tfm_backup(ob_back);
 
-               BKE_object_where_is_calc(scene, v3d->camera);
+               BKE_object_where_is_calc(eval_ctx, scene, v3d->camera);
                negate_v3_v3(rv3d->ofs, v3d->camera->obmat[3]);
 
                rv3d->dist = 0.0;
@@ -242,7 +243,7 @@ void ED_view3d_cameracontrol_update(
 
                ob_update = v3d->camera->parent;
                while (ob_update) {
-                       DAG_id_tag_update(&ob_update->id, OB_RECALC_OB);
+                       DEG_id_tag_update(&ob_update->id, OB_RECALC_OB);
                        ob_update = ob_update->parent;
                }
 
@@ -264,7 +265,7 @@ void ED_view3d_cameracontrol_update(
 
                BKE_object_apply_mat4(v3d->camera, view_mat, true, true);
 
-               DAG_id_tag_update(&v3d->camera->id, OB_RECALC_OB);
+               DEG_id_tag_update(&v3d->camera->id, OB_RECALC_OB);
 
                copy_v3_v3(v3d->camera->size, size_back);
 
@@ -299,7 +300,7 @@ void ED_view3d_cameracontrol_release(
                        /* store the original camera loc and rot */
                        BKE_object_tfm_restore(ob_back, vctrl->obtfm);
 
-                       DAG_id_tag_update(&ob_back->id, OB_RECALC_OB);
+                       DEG_id_tag_update(&ob_back->id, OB_RECALC_OB);
                }
                else {
                        /* Non Camera we need to reset the view back to the original location bacause the user canceled*/
@@ -311,7 +312,7 @@ void ED_view3d_cameracontrol_release(
                rv3d->dist = vctrl->dist_backup;
        }
        else if (vctrl->persp_backup == RV3D_CAMOB) { /* camera */
-               DAG_id_tag_update((ID *)view3d_cameracontrol_object(vctrl), OB_RECALC_OB);
+               DEG_id_tag_update((ID *)view3d_cameracontrol_object(vctrl), OB_RECALC_OB);
 
                /* always, is set to zero otherwise */
                copy_v3_v3(rv3d->ofs, vctrl->ofs_backup);