Blender  V2.93
depsgraph_eval.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2013 Blender Foundation.
17  * All rights reserved.
18  */
19 
26 #include "MEM_guardedalloc.h"
27 
28 #include "BLI_listbase.h"
29 #include "BLI_utildefines.h"
30 
31 #include "BKE_scene.h"
32 
33 #include "DNA_object_types.h"
34 #include "DNA_scene_types.h"
35 
36 #include "DEG_depsgraph.h"
37 #include "DEG_depsgraph_query.h"
38 
39 #include "intern/eval/deg_eval.h"
41 
42 #include "intern/node/deg_node.h"
45 
46 #include "intern/depsgraph.h"
47 
48 namespace deg = blender::deg;
49 
51 {
52  /* Update the time on the cow scene. */
53  if (deg_graph->scene_cow) {
54  BKE_scene_frame_set(deg_graph->scene_cow, deg_graph->ctime);
55  }
56 
59 }
60 
61 /* Evaluate all nodes tagged for updating. */
63 {
64  deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
66  const float ctime = BKE_scene_frame_get(scene);
67 
68  if (ctime != deg_graph->ctime) {
69  deg_graph->tag_time_source();
70  deg_graph->ctime = ctime;
71  }
72 
74 }
75 
76 /* Frame-change happened for root scene that graph belongs to. */
78 {
79  deg::Depsgraph *deg_graph = reinterpret_cast<deg::Depsgraph *>(graph);
80  deg_graph->tag_time_source();
81  deg_graph->ctime = ctime;
83 }
void BKE_scene_frame_set(struct Scene *scene, double cfra)
Definition: scene.c:2475
float BKE_scene_frame_get(const struct Scene *scene)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
Depsgraph * graph
Scene scene
static void deg_flush_updates_and_refresh(deg::Depsgraph *deg_graph)
void DEG_evaluate_on_refresh(Depsgraph *graph)
void DEG_evaluate_on_framechange(Depsgraph *graph, float ctime)
void deg_graph_flush_updates(Depsgraph *graph)
void deg_evaluate_on_refresh(Depsgraph *graph)
Definition: deg_eval.cc:366