Blender  V3.3
DEG_depsgraph.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
25 /* ************************************************* */
26 /* Forward-defined typedefs for core types
27  * - These are used in all depsgraph code and by all callers of Depsgraph API...
28  */
29 
30 #pragma once
31 
32 #include "DNA_ID.h"
33 
34 /* Dependency Graph */
35 typedef struct Depsgraph Depsgraph;
36 
37 /* ------------------------------------------------ */
38 
39 struct Main;
40 
41 struct Scene;
42 struct ViewLayer;
43 
44 typedef enum eEvaluationMode {
45  DAG_EVAL_VIEWPORT = 0, /* evaluate for OpenGL viewport */
46  DAG_EVAL_RENDER = 1, /* evaluate for render purposes */
48 
49 /* DagNode->eval_flags */
50 enum {
51  /* Regardless to curve->path animation flag path is to be evaluated anyway,
52  * to meet dependencies with such a things as curve modifier and other guys
53  * who're using curve deform, where_on_path and so. */
55  /* A shrinkwrap modifier or constraint targeting this mesh needs information
56  * about non-manifold boundary edges for the Target Normal Project mode. */
58 };
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /* ************************************************ */
65 /* Depsgraph API */
66 
67 /* -------------------------------------------------------------------- */
71 /* Get main depsgraph instance from context! */
72 
78 Depsgraph *DEG_graph_new(struct Main *bmain,
79  struct Scene *scene,
80  struct ViewLayer *view_layer,
81  eEvaluationMode mode);
82 
90  struct Main *bmain,
91  struct Scene *scene,
92  struct ViewLayer *view_layer);
93 
96 
99 /* -------------------------------------------------------------------- */
104 void DEG_register_node_types(void);
105 
107 void DEG_free_node_types(void);
108 
111 /* -------------------------------------------------------------------- */
117 
119 void DEG_tag_on_visible_update(struct Main *bmain, bool do_time);
120 
126 
128 void DEG_id_tag_update(struct ID *id, int flag);
129 void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag);
130 
131 void DEG_graph_id_tag_update(struct Main *bmain,
132  struct Depsgraph *depsgraph,
133  struct ID *id,
134  int flag);
135 
137 void DEG_time_tag_update(struct Main *bmain);
138 
141 
147 void DEG_graph_id_type_tag(struct Depsgraph *depsgraph, short id_type);
148 void DEG_id_type_tag(struct Main *bmain, short id_type);
149 
155 
157 void DEG_editors_update(struct Depsgraph *depsgraph, bool time);
158 
161 
167 
170 /* ************************************************ */
171 /* Evaluation Engine API */
172 
173 /* -------------------------------------------------------------------- */
182 void DEG_evaluate_on_framechange(Depsgraph *graph, float frame);
183 
189 
192 /* -------------------------------------------------------------------- */
199 typedef struct DEGEditorUpdateContext {
200  struct Main *bmain;
202  struct Scene *scene;
205 
206 typedef void (*DEG_EditorUpdateIDCb)(const DEGEditorUpdateContext *update_ctx, struct ID *id);
207 typedef void (*DEG_EditorUpdateSceneCb)(const DEGEditorUpdateContext *update_ctx, bool updated);
208 
211 
214 /* -------------------------------------------------------------------- */
218 bool DEG_is_evaluating(const struct Depsgraph *depsgraph);
219 
220 bool DEG_is_active(const struct Depsgraph *depsgraph);
221 void DEG_make_active(struct Depsgraph *depsgraph);
223 
226 /* -------------------------------------------------------------------- */
231 
233  const char *function_name,
234  const char *object_name,
235  const void *object_address);
236 
238  const char *function_name,
239  const char *object_name,
240  const void *object_address,
241  const char *subdata_comment,
242  const char *subdata_name,
243  const void *subdata_address);
244 
246  const char *function_name,
247  const char *object_name,
248  const void *object_address,
249  const char *subdata_comment,
250  const char *subdata_name,
251  const void *subdata_address,
252  int subdata_index);
253 
255  const char *function_name,
256  const char *object_name,
257  const void *object_address,
258  const char *parent_comment,
259  const char *parent_name,
260  const void *parent_address);
261 
263  const char *function_name,
264  const char *object_name,
265  const void *object_address,
266  float time);
267 
270 #ifdef __cplusplus
271 } /* extern "C" */
272 #endif
void DEG_debug_print_eval_subdata_index(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, const char *subdata_comment, const char *subdata_name, const void *subdata_address, int subdata_index)
void DEG_evaluate_on_refresh(Depsgraph *graph)
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
Definition: depsgraph.cc:267
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
struct DEGEditorUpdateContext DEGEditorUpdateContext
void DEG_editors_update(struct Depsgraph *depsgraph, bool time)
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time)
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
bool DEG_is_active(const struct Depsgraph *depsgraph)
Definition: depsgraph.cc:312
void DEG_tag_on_visible_update(struct Main *bmain, bool do_time)
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
void DEG_debug_print_eval_time(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, float time)
void DEG_enable_editors_update(struct Depsgraph *depsgraph)
void DEG_graph_id_tag_update(struct Main *bmain, struct Depsgraph *depsgraph, struct ID *id, int flag)
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup)
void DEG_make_active(struct Depsgraph *depsgraph)
Definition: depsgraph.cc:325
void DEG_graph_time_tag_update(struct Depsgraph *depsgraph)
eEvaluationMode
Definition: DEG_depsgraph.h:44
@ DAG_EVAL_RENDER
Definition: DEG_depsgraph.h:46
@ DAG_EVAL_VIEWPORT
Definition: DEG_depsgraph.h:45
void DEG_debug_print_eval(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
void(* DEG_EditorUpdateSceneCb)(const DEGEditorUpdateContext *update_ctx, bool updated)
void DEG_id_type_tag(struct Main *bmain, short id_type)
void DEG_free_node_types(void)
void(* DEG_EditorUpdateIDCb)(const DEGEditorUpdateContext *update_ctx, struct ID *id)
void DEG_time_tag_update(struct Main *bmain)
void DEG_graph_replace_owners(struct Depsgraph *depsgraph, struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: depsgraph.cc:274
void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag)
void DEG_graph_free(Depsgraph *graph)
Definition: depsgraph.cc:295
void DEG_register_node_types(void)
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_make_inactive(struct Depsgraph *depsgraph)
Definition: depsgraph.cc:332
void DEG_ids_restore_recalc(Depsgraph *depsgraph)
void DEG_debug_print_begin(struct Depsgraph *depsgraph)
void DEG_debug_print_eval_subdata(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, const char *subdata_comment, const char *subdata_name, const void *subdata_address)
bool DEG_is_evaluating(const struct Depsgraph *depsgraph)
Definition: depsgraph.cc:306
void DEG_debug_print_eval_parent_typed(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, const char *parent_comment, const char *parent_name, const void *parent_address)
@ DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY
Definition: DEG_depsgraph.h:57
@ DAG_EVAL_NEED_CURVE_PATH
Definition: DEG_depsgraph.h:54
void DEG_graph_id_type_tag(struct Depsgraph *depsgraph, short id_type)
ID and Library types, which are fundamental for sdna.
IDRecalcFlag
Definition: DNA_ID.h:766
Depsgraph * graph
double time
Scene scene
const Depsgraph * depsgraph
AnimationBackup * backup
SyclQueue void void size_t num_bytes void
struct Depsgraph * depsgraph
struct ViewLayer * view_layer
struct Scene * scene
Definition: DNA_ID.h:368
Definition: BKE_main.h:121