Blender V4.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
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
35/* Dependency Graph */
36struct Depsgraph;
37
38/* ------------------------------------------------ */
39
40struct Main;
41struct Scene;
42struct ViewLayer;
43
45 DAG_EVAL_VIEWPORT = 0, /* evaluate for OpenGL viewport */
46 DAG_EVAL_RENDER = 1, /* evaluate for render purposes */
47};
48
49/* DagNode->eval_flags */
50enum {
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/* ************************************************ */
61/* Depsgraph API */
62
63/* -------------------------------------------------------------------- */
67/* Get main depsgraph instance from context! */
68
74Depsgraph *DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode);
75
83 Main *bmain,
84 Scene *scene,
85 ViewLayer *view_layer);
86
88void DEG_graph_free(Depsgraph *graph);
89
92/* -------------------------------------------------------------------- */
98
101
104/* -------------------------------------------------------------------- */
109void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time);
110
112void DEG_tag_on_visible_update(Main *bmain, bool do_time);
113
119
121void DEG_id_tag_update(ID *id, unsigned int flags);
122void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags);
123
124void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags);
125
133void DEG_id_tag_update_for_side_effect_request(Depsgraph *depsgraph, ID *id, unsigned int flags);
134
136void DEG_time_tag_update(Main *bmain);
137
139void DEG_graph_time_tag_update(Depsgraph *depsgraph);
140
146void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type);
147void DEG_id_type_tag(Main *bmain, short id_type);
148
153void DEG_enable_editors_update(Depsgraph *depsgraph);
154
156void DEG_editors_update(Depsgraph *depsgraph, bool time);
157
159void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup);
160
165void DEG_ids_restore_recalc(Depsgraph *depsgraph);
166
169/* ************************************************ */
170/* Evaluation Engine API */
171
172/* -------------------------------------------------------------------- */
184
191 Depsgraph *graph,
192 float frame,
194
200 Depsgraph *graph,
202
205/* -------------------------------------------------------------------- */
218
219using DEG_EditorUpdateIDCb = void (*)(const DEGEditorUpdateContext *update_ctx, ID *id);
220using DEG_EditorUpdateSceneCb = void (*)(const DEGEditorUpdateContext *update_ctx, bool updated);
221
224
227/* -------------------------------------------------------------------- */
231bool DEG_is_evaluating(const Depsgraph *depsgraph);
232
233bool DEG_is_active(const Depsgraph *depsgraph);
234void DEG_make_active(Depsgraph *depsgraph);
235void DEG_make_inactive(Depsgraph *depsgraph);
236
237/* Returns the number of times the graph has been evaluated. */
238uint64_t DEG_get_update_count(const Depsgraph *depsgraph);
239
247
250/* -------------------------------------------------------------------- */
254void DEG_debug_print_begin(Depsgraph *depsgraph);
255
256void DEG_debug_print_eval(Depsgraph *depsgraph,
257 const char *function_name,
258 const char *object_name,
259 const void *object_address);
260
262 const char *function_name,
263 const char *object_name,
264 const void *object_address,
265 const char *subdata_comment,
266 const char *subdata_name,
267 const void *subdata_address);
268
270 const char *function_name,
271 const char *object_name,
272 const void *object_address,
273 const char *subdata_comment,
274 const char *subdata_name,
275 const void *subdata_address,
276 int subdata_index);
277
279 const char *function_name,
280 const char *object_name,
281 const void *object_address,
282 const char *parent_comment,
283 const char *parent_name,
284 const void *parent_address);
285
287 const char *function_name,
288 const char *object_name,
289 const void *object_address,
290 float time);
291
void DEG_graph_time_tag_update(Depsgraph *depsgraph)
void DEG_id_tag_update(ID *id, unsigned int flags)
bool DEG_is_evaluating(const Depsgraph *depsgraph)
Definition depsgraph.cc:312
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)
DepsgraphEvaluateSyncWriteback
@ DEG_EVALUATE_SYNC_WRITEBACK_YES
@ DEG_EVALUATE_SYNC_WRITEBACK_NO
void DEG_id_type_tag(Main *bmain, short id_type)
void(*)(const DEGEditorUpdateContext *update_ctx, ID *id) DEG_EditorUpdateIDCb
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time)
void DEG_editors_update(Depsgraph *depsgraph, bool time)
void DEG_debug_print_eval_time(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address, float time)
void DEG_editors_set_update_cb(DEG_EditorUpdateIDCb id_func, DEG_EditorUpdateSceneCb scene_func)
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)
uint64_t DEG_get_update_count(const Depsgraph *depsgraph)
Definition depsgraph.cc:350
void DEG_disable_visibility_optimization(Depsgraph *depsgraph)
Definition depsgraph.cc:344
void DEG_enable_editors_update(Depsgraph *depsgraph)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
void DEG_free_node_types()
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup)
void DEG_id_tag_update_for_side_effect_request(Depsgraph *depsgraph, ID *id, unsigned int flags)
eEvaluationMode
@ DAG_EVAL_RENDER
@ DAG_EVAL_VIEWPORT
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
Definition depsgraph.cc:273
@ DAG_EVAL_NEED_SHRINKWRAP_BOUNDARY
@ DAG_EVAL_NEED_CURVE_PATH
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
bool DEG_is_active(const Depsgraph *depsgraph)
Definition depsgraph.cc:318
void DEG_evaluate_on_refresh(Depsgraph *graph, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
void DEG_register_node_types()
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_time_tag_update(Main *bmain)
void DEG_graph_replace_owners(Depsgraph *depsgraph, Main *bmain, Scene *scene, ViewLayer *view_layer)
Definition depsgraph.cc:280
void DEG_debug_print_begin(Depsgraph *depsgraph)
void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags)
void DEG_graph_free(Depsgraph *graph)
Definition depsgraph.cc:301
void DEG_debug_print_eval(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
void DEG_make_inactive(Depsgraph *depsgraph)
Definition depsgraph.cc:338
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
void(*)(const DEGEditorUpdateContext *update_ctx, bool updated) DEG_EditorUpdateSceneCb
void DEG_ids_restore_recalc(Depsgraph *depsgraph)
void DEG_make_active(Depsgraph *depsgraph)
Definition depsgraph.cc:331
void DEG_evaluate_on_framechange(Depsgraph *graph, float frame, DepsgraphEvaluateSyncWriteback sync_writeback=DEG_EVALUATE_SYNC_WRITEBACK_NO)
ID and Library types, which are fundamental for SDNA.
IDRecalcFlag
Definition DNA_ID.h:1016
const Depsgraph * depsgraph
unsigned __int64 uint64_t
Definition stdint.h:90
Definition DNA_ID.h:413
uint8_t flag
Definition wm_window.cc:138