Blender V5.3
DEG_depsgraph.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
25
26/* ************************************************* */
27/* Forward-defined typedefs for core types
28 * - These are used in all depsgraph code and by all callers of Depsgraph API...
29 */
30
31#pragma once
32
33#include "DNA_ID.h"
34
35namespace blender {
36
37/* Dependency Graph */
38struct Depsgraph;
39
40/* ------------------------------------------------ */
41
42struct Main;
43struct Scene;
44struct ViewLayer;
45
47 DAG_EVAL_VIEWPORT = 0, /* evaluate for OpenGL viewport */
48 DAG_EVAL_RENDER = 1, /* evaluate for render purposes */
49};
50
51/* DagNode->eval_flags */
52enum {
53 /* Regardless to curve->path animation flag path is to be evaluated anyway,
54 * to meet dependencies with such a things as curve modifier and other guys
55 * who're using curve deform, where_on_path and so. */
57 /* A shrinkwrap modifier or constraint targeting this mesh needs information
58 * about non-manifold boundary edges for the Target Normal Project mode. */
60};
61
62/* ************************************************ */
63/* Depsgraph API */
64
65/* -------------------------------------------------------------------- */
68
69/* Get main depsgraph instance from context! */
70
76Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode);
77
84void DEG_graph_replace_owners(Depsgraph *depsgraph,
85 Main *bmain,
86 Scene *scene,
87 ViewLayer *view_layer);
88
90void DEG_graph_free(Depsgraph *graph);
91
93
94/* -------------------------------------------------------------------- */
97
100
103
105
106/* -------------------------------------------------------------------- */
109
111void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time);
112
114void DEG_tag_on_visible_update(Main *bmain, bool do_time);
115
120const char *DEG_update_tag_as_string(IDRecalcFlag flag);
121
123void DEG_id_tag_update(ID *id, unsigned int flags);
124void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags);
125
126void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags);
127
135void DEG_id_tag_update_for_side_effect_request(Depsgraph *depsgraph, ID *id, unsigned int flags);
136
138void DEG_time_tag_update(Main *bmain);
139
141void DEG_graph_time_tag_update(Depsgraph *depsgraph);
142
148void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type);
149void DEG_id_type_tag(Main *bmain, short id_type);
150
155void DEG_enable_editors_update(Depsgraph *depsgraph);
156
158void DEG_editors_update(Depsgraph *depsgraph, bool time);
159
161void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup);
162
167void DEG_ids_restore_recalc(Depsgraph *depsgraph);
168
170
171/* ************************************************ */
172/* Evaluation Engine API */
173
174/* -------------------------------------------------------------------- */
177
186
193 Depsgraph *graph,
194 float frame,
196
202 Depsgraph *graph,
204
206
207/* -------------------------------------------------------------------- */
213
220
221using DEG_EditorUpdateIDCb = void (*)(const DEGEditorUpdateContext *update_ctx, ID *id);
222using DEG_EditorUpdateSceneCb = void (*)(const DEGEditorUpdateContext *update_ctx, bool updated);
223
226
228
229/* -------------------------------------------------------------------- */
232
233bool DEG_is_evaluating(const Depsgraph *depsgraph);
234
235bool DEG_is_active(const Depsgraph *depsgraph);
236void DEG_make_active(Depsgraph *depsgraph);
237void DEG_make_inactive(Depsgraph *depsgraph);
238
239/* Returns the number of times the graph has been evaluated. */
240uint64_t DEG_get_update_count(const Depsgraph *depsgraph);
241
249void DEG_disable_visibility_optimization(Depsgraph *depsgraph);
250
252
253/* -------------------------------------------------------------------- */
256
257void DEG_debug_print_begin(Depsgraph *depsgraph);
258
259void DEG_debug_print_eval(Depsgraph *depsgraph,
260 const char *function_name,
261 const char *object_name,
262 const void *object_address);
263
264void DEG_debug_print_eval_subdata(Depsgraph *depsgraph,
265 const char *function_name,
266 const char *object_name,
267 const void *object_address,
268 const char *subdata_comment,
269 const char *subdata_name,
270 const void *subdata_address);
271
272void DEG_debug_print_eval_subdata_index(Depsgraph *depsgraph,
273 const char *function_name,
274 const char *object_name,
275 const void *object_address,
276 const char *subdata_comment,
277 const char *subdata_name,
278 const void *subdata_address,
279 int subdata_index);
280
281void DEG_debug_print_eval_parent_typed(Depsgraph *depsgraph,
282 const char *function_name,
283 const char *object_name,
284 const void *object_address,
285 const char *parent_comment,
286 const char *parent_name,
287 const void *parent_address);
288
289void DEG_debug_print_eval_time(Depsgraph *depsgraph,
290 const char *function_name,
291 const char *object_name,
292 const void *object_address,
293 float time);
294
296
297} // namespace blender
ID and Library types, which are fundamental for SDNA.
Definition scene.h:133
BMesh Iterators.
void DEG_time_tag_update(Main *bmain)
unsigned __int64 uint64_t
Definition BKE_text.h:91
void DEG_free_node_types()
void DEG_enable_editors_update(Depsgraph *depsgraph)
bool DEG_is_active(const Depsgraph *depsgraph)
Definition depsgraph.cc:324
void DEG_graph_free(Depsgraph *graph)
Definition depsgraph.cc:307
uint64_t DEG_get_update_count(const Depsgraph *depsgraph)
Definition depsgraph.cc:356
void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags)
void DEG_debug_print_eval_time(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, float time)
void DEG_debug_print_eval(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
Definition depsgraph.cc:279
void DEG_make_inactive(Depsgraph *depsgraph)
Definition depsgraph.cc:344
void(*)(const DEGEditorUpdateContext *update_ctx, ID *id) DEG_EditorUpdateIDCb
void DEG_make_active(Depsgraph *depsgraph)
Definition depsgraph.cc:337
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup)
void DEG_evaluate_on_refresh(Depsgraph *graph, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
void(*)(const DEGEditorUpdateContext *update_ctx, bool updated) DEG_EditorUpdateSceneCb
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_debug_print_begin(Depsgraph *depsgraph)
void DEG_id_type_tag(Main *bmain, short id_type)
void DEG_graph_replace_owners(Depsgraph *depsgraph, Main *bmain, Scene *scene, ViewLayer *view_layer)
Definition depsgraph.cc:286
@ DAG_EVAL_VIEWPORT
void DEG_ids_restore_recalc(Depsgraph *depsgraph)
void DEG_editors_update(Depsgraph *depsgraph, bool time)
void DEG_id_tag_update_for_side_effect_request(Depsgraph *depsgraph, ID *id, unsigned int flags)
@ DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY
@ DAG_EVAL_NEED_CURVE_PATH
void DEG_debug_print_eval_subdata(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)
void DEG_graph_time_tag_update(Depsgraph *depsgraph)
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
IDRecalcFlag
Definition DNA_ID.h:1049
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
void DEG_register_node_types()
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
DepsgraphEvaluateSyncWriteback
@ DEG_EVALUATE_SYNC_WRITEBACK_NO
@ DEG_EVALUATE_SYNC_WRITEBACK_YES
bool DEG_is_evaluating(const Depsgraph *depsgraph)
Definition depsgraph.cc:318
void DEG_debug_print_eval_parent_typed(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)
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time)
void DEG_debug_print_eval_subdata_index(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_disable_visibility_optimization(Depsgraph *depsgraph)
Definition depsgraph.cc:350