doxygen: blender/editors tagged.
[blender.git] / source / blender / editors / space_view3d / view3d_fly.c
index 5f4c551e2d64818281c1d5f765a6dc7a9f14b317..d6dcd67c756baf3a297e27b000c816178f608bb2 100644 (file)
@@ -1,5 +1,5 @@
-/**
- * $Id: view3d_view.c 32630 2010-10-21 09:02:21Z campbellbarton $
+/*
+ * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/space_view3d/view3d_fly.c
+ *  \ingroup spview3d
+ */
+
+
 /* defines VIEW3D_OT_fly modal operator */
 
 #include "DNA_anim_types.h"
@@ -32,6 +37,7 @@
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
+#include "BLI_utildefines.h"
 
 #include "BKE_context.h"
 #include "BKE_object.h"
@@ -368,7 +374,7 @@ static int flyEnd(bContext *C, FlyInfo *fly)
                        /* store the original camera loc and rot */
                        object_tfm_restore(ob_back, fly->obtfm);
 
-                       DAG_id_flush_update(&ob_back->id, OB_RECALC_OB);
+                       DAG_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*/
                        copy_qt_qt(rv3d->viewquat, fly->rot_backup);
@@ -377,7 +383,7 @@ static int flyEnd(bContext *C, FlyInfo *fly)
                }
        }
        else if (fly->persp_backup==RV3D_CAMOB) {       /* camera */
-               DAG_id_flush_update(fly->root_parent ? &fly->root_parent->id : &v3d->camera->id, OB_RECALC_OB);
+               DAG_id_tag_update(fly->root_parent ? &fly->root_parent->id : &v3d->camera->id, OB_RECALC_OB);
        }
        else { /* not camera */
                /* Apply the fly mode view */
@@ -794,13 +800,13 @@ static int flyApply(bContext *C, FlyInfo *fly)
                                        view3d_persp_mat4(rv3d, view_mat);
                                        mul_m4_m4m4(diff_mat, prev_view_imat, view_mat);
                                        mul_m4_m4m4(parent_mat, fly->root_parent->obmat, diff_mat);
-                                       object_apply_mat4(fly->root_parent, parent_mat, TRUE);
+                                       object_apply_mat4(fly->root_parent, parent_mat, TRUE, FALSE);
 
                                        // where_is_object(scene, fly->root_parent);
 
                                        ob_update= v3d->camera->parent;
                                        while(ob_update) {
-                                               DAG_id_flush_update(&ob_update->id, OB_RECALC_OB);
+                                               DAG_id_tag_update(&ob_update->id, OB_RECALC_OB);
                                                ob_update= ob_update->parent;
                                        }
 
@@ -812,7 +818,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
                                else {
                                        float view_mat[4][4];
                                        view3d_persp_mat4(rv3d, view_mat);
-                                       object_apply_mat4(v3d->camera, view_mat, TRUE);
+                                       object_apply_mat4(v3d->camera, view_mat, TRUE, FALSE);
                                        id_key= &v3d->camera->id;
                                }
 
@@ -894,7 +900,9 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event)
 {
        int exit_code;
        short do_draw= FALSE;
-       FlyInfo *fly = op->customdata;
+       FlyInfo *fly= op->customdata;
+       RegionView3D *rv3d= fly->rv3d;
+       Object *fly_object= fly->root_parent ? fly->root_parent : fly->v3d->camera;
 
        fly->redraw= 0;
 
@@ -909,10 +917,10 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event)
 
        if(exit_code!=OPERATOR_RUNNING_MODAL)
                do_draw= TRUE;
-       
+
        if(do_draw) {
-               if(fly->rv3d->persp==RV3D_CAMOB) {
-                       WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, fly->root_parent ? fly->root_parent : fly->v3d->camera);
+               if(rv3d->persp==RV3D_CAMOB) {
+                       WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, fly_object);
                }
 
                ED_region_tag_redraw(CTX_wm_region(C));