62void depsgraph_geometry_tag_to_component(
const ID *
id,
NodeType *component_type)
70bool is_selectable_data_id_type(
const ID_Type id_type)
75void depsgraph_select_tag_to_component_opcode(
const ID *
id,
92 else if (id_type ==
ID_OB) {
96 else if (is_selectable_data_id_type(id_type)) {
106void depsgraph_base_flags_tag_to_component_opcode(
const ID *
id,
115 else if (id_type ==
ID_OB) {
129void depsgraph_tag_to_component_opcode(
const ID *
id,
148 depsgraph_geometry_tag_to_component(
id, component_type);
157 if (id_type ==
ID_PA) {
164 *operation_code = psysTagToOperationCode(tag);
177 depsgraph_select_tag_to_component_opcode(
id, component_type, operation_code);
180 depsgraph_base_flags_tag_to_component_opcode(
id, component_type, operation_code);
235void id_tag_update_ntree_special(
239 if (ntree ==
nullptr) {
245void depsgraph_update_editors_tag(Main *bmain,
Depsgraph *graph,
ID *
id)
250 DEGEditorUpdateContext update_ctx = {
nullptr};
251 update_ctx.
bmain = bmain;
252 update_ctx.
depsgraph = (::Depsgraph *)graph;
253 update_ctx.
scene = graph->scene;
261 if (cow_comp ==
nullptr) {
268void depsgraph_tag_component(
Depsgraph *graph,
274 ComponentNode *component_node = id_node->find_component(component_type);
278 if (component_node ==
nullptr) {
280 id_node->is_cow_explicitly_tagged =
true;
281 depsgraph_id_tag_copy_on_write(graph, id_node, update_source);
286 component_node->tag_update(graph, update_source);
289 OperationNode *operation_node = component_node->find_operation(operation_code);
290 if (operation_node !=
nullptr) {
291 operation_node->tag_update(graph, update_source);
295 if (component_node->need_tag_cow_before_update(
IDRecalcFlag(id_node->id_cow->recalc))) {
296 depsgraph_id_tag_copy_on_write(graph, id_node, update_source);
299 id_node->is_cow_explicitly_tagged =
true;
308void deg_graph_id_tag_legacy_compat(
316 if (data_id !=
nullptr) {
326 if (mesh->
key !=
nullptr) {
328 if (key_id !=
nullptr) {
336 if (lattice->
key !=
nullptr) {
337 ID *key_id = &lattice->
key->
id;
338 if (key_id !=
nullptr) {
346 if (curve->
key !=
nullptr) {
348 if (key_id !=
nullptr) {
360void graph_id_tag_update_single_flag(Main *bmain,
368 if (graph !=
nullptr && graph->is_active) {
369 depsgraph_update_editors_tag(bmain, graph,
id);
376 depsgraph_tag_to_component_opcode(
id, tag, &component_type, &operation_code);
384 if (id_node ==
nullptr) {
392 id_node->id_cow->recalc |= factory->id_recalc_tag();
395 id_node->tag_update(graph, update_source);
398 depsgraph_tag_component(graph, id_node, component_type, operation_code, update_source);
402 deg_graph_id_tag_legacy_compat(bmain, graph,
id, tag, update_source);
405std::string stringify_update_bitfield(
uint flags)
425 return "SIDE_EFFECT_REQUEST";
431int deg_recalc_flags_for_legacy_zero()
439 if (graph !=
nullptr) {
440 if (!graph->is_active) {
445 return deg_recalc_flags_for_legacy_zero();
455void deg_graph_node_tag_zero(Main *bmain,
460 if (id_node ==
nullptr) {
463 ID *
id = id_node->id_orig;
465 id_node->id_cow->
recalc |= deg_recalc_flags_for_legacy_zero();
467 for (
ComponentNode *comp_node : id_node->components.values()) {
472 id_node->is_cow_explicitly_tagged =
true;
475 comp_node->tag_update(graph, update_source);
477 deg_graph_id_tag_legacy_compat(bmain, graph,
id, (
IDRecalcFlag)0, update_source);
485void deg_graph_tag_parameters_if_needed(Main *bmain,
504 const uint clean_flags = flags &
511 if (clean_flags == 0) {
516 graph_id_tag_update_single_flag(bmain, graph,
id, id_node,
ID_RECALC_PARAMETERS, update_source);
519void graph_tag_on_visible_update(
Depsgraph *graph,
const bool do_time)
521 graph->need_tag_id_on_graph_visibility_update =
true;
522 graph->need_tag_id_on_graph_visibility_time_update |= do_time;
568 if (id_type ==
ID_OB) {
605 switch (object->
type) {
663 id->recalc_after_undo_push |= deg_recalc_flags_effective(
nullptr, flags);
683 static std::atomic<uint64_t> global_image_update_count = 0;
684 image->
runtime->update_count = global_image_update_count.fetch_add(1) + 1;
694 printf(
"ID tagged for update during dependency graph evaluation.\n");
699 printf(
"%s: id=%s flags=%s source=%s\n",
702 stringify_update_bitfield(flags).c_str(),
703 update_source_as_string(update_source));
709 if (graph !=
nullptr) {
713 deg_graph_node_tag_zero(bmain, graph, id_node, update_source);
717 if (id_node !=
nullptr) {
728 id->recalc |= deg_recalc_flags_effective(graph, flags);
730 uint current_flag = flags;
731 while (current_flag != 0) {
733 graph_id_tag_update_single_flag(bmain, graph,
id, id_node, tag, update_source);
736 id_tag_update_ntree_special(bmain, graph,
id, flags, update_source);
742 graph_id_tag_update_single_flag(
745 deg_graph_tag_parameters_if_needed(bmain, graph,
id, id_node, flags, update_source);
758 return "GEOMETRY_ALL_MODES";
772 return "COPY_ON_EVAL";
780 return "POINT_CACHE";
784 return "SEQUENCER_STRIPS";
786 return "FRAME_CHANGE";
790 return "AUDIO_VOLUME";
794 return "AUDIO_LISTENER";
804 return "TAG_FOR_UNDO";
806 return "ID_RECALC_NTREE_OUTPUT";
809 return "ID_RECALC_HIERARCHY";
871 if (id_type ==
ID_NT) {
895 deg::graph_tag_on_visible_update(graph, do_time);
901 deg::graph_tag_on_visible_update(
depsgraph, do_time);
924 update_ctx.
bmain = bmain;
926 update_ctx.
scene = scene;
AnimData * BKE_animdata_from_id(const ID *id)
int BKE_idtype_idcode_to_index(short idcode)
void BKE_lib_override_id_tag_on_deg_tag_from_user(ID *id)
#define BLI_assert_msg(a, msg)
MINLINE unsigned int bitscan_forward_clear_uint(unsigned int *a)
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
std::string DEG_stringify_recalc_flags(unsigned int flags)
int DEG_debug_flags_get(const Depsgraph *depsgraph)
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
Main * DEG_get_bmain(const Depsgraph *graph)
bool DEG_id_type_any_updated(const Depsgraph *depsgraph)
Scene * DEG_get_input_scene(const Depsgraph *graph)
#define ID_TYPE_USE_COPY_ON_EVAL(_id_type)
@ ID_RECALC_AUDIO_LISTENER
@ ID_RECALC_GEOMETRY_ALL_MODES
@ ID_RECALC_SEQUENCER_STRIPS
struct bNodeTree bNodeTree
Object is a sort of wrapper for general info.
BPy_StructRNA * depsgraph
void DEG_graph_time_tag_update(Depsgraph *depsgraph)
void DEG_id_type_tag(Main *bmain, short id_type)
void DEG_editors_update(Depsgraph *depsgraph, bool time)
void DEG_id_tag_update_ex(Main *bmain, ID *id, uint flags)
void DEG_enable_editors_update(Depsgraph *depsgraph)
void DEG_ids_clear_recalc(Depsgraph *depsgraph, const bool backup)
void DEG_time_tag_update(Main *bmain)
void DEG_tag_on_visible_update(Main *bmain, const bool do_time)
void DEG_id_tag_update(ID *id, uint flags)
void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, uint flags)
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, const bool do_time)
void DEG_id_tag_update_for_side_effect_request(Depsgraph *depsgraph, ID *id, uint flags)
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
void DEG_ids_restore_recalc(Depsgraph *depsgraph)
static void deg_graph_clear_id_recalc_flags(ID *id)
bNodeTree * node_tree_from_id(ID *id)
Span< Depsgraph * > get_all_registered_graphs(Main *bmain)
NodeType geometry_tag_to_component(const ID *id)
static void set_id_update_count(ID *id)
void deg_editors_id_update(const DEGEditorUpdateContext *update_ctx, ID *id)
void deg_editors_scene_update(const DEGEditorUpdateContext *update_ctx, bool updated)
void graph_tag_ids_for_visible_update(Depsgraph *graph)
bool deg_eval_copy_is_expanded(const ID *id_cow)
@ OBJECT_FROM_LAYER_ENTRY
@ PARTICLE_SETTINGS_RESET
bool deg_eval_copy_is_needed(const ID *id_orig)
DepsNodeFactory * type_get_factory(const NodeType type)
void id_tag_update(Main *bmain, ID *id, uint flags, eUpdateSource update_source)
void graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, uint flags, eUpdateSource update_source)
@ DEG_UPDATE_SOURCE_SIDE_EFFECT_REQUEST
@ DEG_UPDATE_SOURCE_USER_EDIT
@ DEG_UPDATE_SOURCE_RELATIONS
@ DEG_UPDATE_SOURCE_VISIBILITY
ImageRuntimeHandle * runtime
void tag_update(Depsgraph *graph, eUpdateSource source) override
IDNode * find_id_node(const ID *id) const
char id_type_updated[INDEX_ID_MAX]
bool need_tag_id_on_graph_visibility_time_update
bool need_tag_id_on_graph_visibility_update
char id_type_updated_backup[INDEX_ID_MAX]
IDComponentsMask previously_visible_components_mask
bool is_cow_explicitly_tagged
IDComponentsMask visible_components_mask
void tag_update(Depsgraph *graph, eUpdateSource source) override