Camera tracking integration
[blender.git] / source / blender / blenkernel / intern / depsgraph.c
index 343c4319b98cd78de614f7564ca18080e78fe902..b94891ced4996e4daeba0a90b4d8b0f5530ae951 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -38,6 +36,7 @@
 
 #include "BLI_winstuff.h"
 #include "BLI_utildefines.h"
+#include "BLI_listbase.h"
 #include "BLI_ghash.h"
 
 #include "DNA_anim_types.h"
@@ -649,7 +648,7 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
                        if(cti->type==CONSTRAINT_TYPE_FOLLOWTRACK) {
                                bFollowTrackConstraint *data= (bFollowTrackConstraint *)con->data;
 
-                               if((data->clip || data->flag&FOLLOWTRACK_DEFAULTCLIP) && data->track[0]) {
+                               if((data->clip || data->flag&FOLLOWTRACK_ACTIVECLIP) && data->track[0]) {
                                        if(scene->camera) {
                                                node2 = dag_get_node(dag, scene->camera);
                                                dag_add_relation(dag, node2, node, DAG_RL_DATA_OB|DAG_RL_OB_OB, cti->name);
@@ -1982,7 +1981,7 @@ static void dag_tag_renderlayers(Scene *sce, unsigned int lay)
                        if(node->id==(ID *)sce) {
                                SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
                                if(srl && (srl->lay & lay_changed))
-                                       NodeTagChanged(sce->nodetree, node);
+                                       nodeUpdate(sce->nodetree, node);
                        }
                }
        }
@@ -2031,18 +2030,6 @@ void DAG_scene_flush_update(Main *bmain, Scene *sce, unsigned int lay, const sho
                                        flush_pointcache_reset(sce, itA->node, lasttime, 0);
                        }
                }
-
-               /* also all objects which are parented to tracking data should be re-calculated */
-               for(ob=bmain->object.first; ob; ob= ob->id.next){
-                       bConstraint *con;
-                       for (con = ob->constraints.first; con; con=con->next) {
-                               bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
-                               if(ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER)) {
-                                       ob->recalc |= OB_RECALC_OB;
-                                       break;
-                               }
-                       }
-               }
        }
        
        dag_tag_renderlayers(sce, lay);
@@ -2526,7 +2513,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
 
                                for(node= sce->nodetree->nodes.first; node; node= node->next) {
                                        if(node->id==id) {
-                                               NodeTagChanged(sce->nodetree, node);
+                                               nodeUpdate(sce->nodetree, node);
                                        }
                                }
                        }