67void depsgraph_geometry_tag_to_component(
const ID *
id,
NodeType *component_type)
75bool is_selectable_data_id_type(
const ID_Type id_type)
80void depsgraph_select_tag_to_component_opcode(
const ID *
id,
97 else if (id_type ==
ID_OB) {
101 else if (is_selectable_data_id_type(id_type)) {
111void depsgraph_base_flags_tag_to_component_opcode(
const ID *
id,
120 else if (id_type ==
ID_OB) {
134void depsgraph_tag_to_component_opcode(
const ID *
id,
153 depsgraph_geometry_tag_to_component(
id, component_type);
162 if (id_type ==
ID_PA) {
169 *operation_code = psysTagToOperationCode(tag);
182 depsgraph_select_tag_to_component_opcode(
id, component_type, operation_code);
185 depsgraph_base_flags_tag_to_component_opcode(
id, component_type, operation_code);
240void id_tag_update_ntree_special(
244 if (ntree ==
nullptr) {
250void depsgraph_update_editors_tag(
Main *bmain, Depsgraph *graph,
ID *
id)
256 update_ctx.
bmain = bmain;
257 update_ctx.
depsgraph = (::Depsgraph *)graph;
258 update_ctx.
scene = graph->scene;
263void depsgraph_id_tag_copy_on_write(Depsgraph *graph, IDNode *
id_node,
eUpdateSource update_source)
266 if (cow_comp ==
nullptr) {
270 cow_comp->tag_update(graph, update_source);
273void depsgraph_tag_component(Depsgraph *graph,
283 if (component_node ==
nullptr) {
286 depsgraph_id_tag_copy_on_write(graph,
id_node, update_source);
291 component_node->tag_update(graph, update_source);
294 OperationNode *operation_node = component_node->find_operation(operation_code);
295 if (operation_node !=
nullptr) {
296 operation_node->tag_update(graph, update_source);
301 depsgraph_id_tag_copy_on_write(graph,
id_node, update_source);
313void deg_graph_id_tag_legacy_compat(
317 switch (
GS(id->name)) {
320 ID *data_id = (
ID *)object->data;
321 if (data_id !=
nullptr) {
331 if (mesh->key !=
nullptr) {
332 ID *key_id = &mesh->key->id;
333 if (key_id !=
nullptr) {
343 if (key_id !=
nullptr) {
351 if (curve->key !=
nullptr) {
352 ID *key_id = &curve->key->id;
353 if (key_id !=
nullptr) {
365void graph_id_tag_update_single_flag(
Main *bmain,
373 if (graph !=
nullptr && graph->is_active) {
374 depsgraph_update_editors_tag(bmain, graph,
id);
381 depsgraph_tag_to_component_opcode(
id, tag, &component_type, &operation_code);
403 depsgraph_tag_component(graph,
id_node, component_type, operation_code, update_source);
407 deg_graph_id_tag_legacy_compat(bmain, graph,
id, tag, update_source);
413 if (tag_name ==
nullptr) {
417 if (!result.empty()) {
424string stringify_update_bitfield(
uint flags)
430 uint current_flag = flags;
437 while (current_flag != 0) {
439 result = stringify_append_bit(result, tag);
456 return "SIDE_EFFECT_REQUEST";
462int deg_recalc_flags_for_legacy_zero()
468int deg_recalc_flags_effective(Depsgraph *graph,
uint flags)
470 if (graph !=
nullptr) {
471 if (!graph->is_active) {
476 return deg_recalc_flags_for_legacy_zero();
486void deg_graph_node_tag_zero(
Main *bmain,
498 for (ComponentNode *comp_node :
id_node->components.values()) {
506 comp_node->tag_update(graph, update_source);
508 deg_graph_id_tag_legacy_compat(bmain, graph,
id, (
IDRecalcFlag)0, update_source);
516void deg_graph_tag_parameters_if_needed(
Main *bmain,
535 const uint clean_flags = flags &
542 if (clean_flags == 0) {
550void graph_tag_on_visible_update(Depsgraph *graph,
const bool do_time)
552 graph->need_tag_id_on_graph_visibility_update =
true;
553 graph->need_tag_id_on_graph_visibility_time_update |= do_time;
560 if (!graph->need_tag_id_on_graph_visibility_update) {
564 const bool do_time = graph->need_tag_id_on_graph_visibility_time_update;
565 Main *bmain = graph->bmain;
599 if (id_type ==
ID_OB) {
626 graph->need_tag_id_on_graph_visibility_update =
false;
627 graph->need_tag_id_on_graph_visibility_time_update =
false;
636 switch (object->type) {
695 id->recalc_after_undo_push |= deg_recalc_flags_effective(
nullptr, flags);
702 if (graph !=
nullptr && graph->is_evaluating) {
704 printf(
"ID tagged for update during dependency graph evaluation.\n");
709 printf(
"%s: id=%s flags=%s source=%s\n",
712 stringify_update_bitfield(flags).c_str(),
713 update_source_as_string(update_source));
715 IDNode *
id_node = (graph !=
nullptr) ? graph->find_id_node(
id) :
nullptr;
716 if (graph !=
nullptr) {
720 deg_graph_node_tag_zero(bmain, graph,
id_node, update_source);
735 id->recalc |= deg_recalc_flags_effective(graph, flags);
737 uint current_flag = flags;
738 while (current_flag != 0) {
740 graph_id_tag_update_single_flag(bmain, graph,
id,
id_node, tag, update_source);
743 id_tag_update_ntree_special(bmain, graph,
id, flags, update_source);
749 graph_id_tag_update_single_flag(
752 deg_graph_tag_parameters_if_needed(bmain, graph,
id,
id_node, flags, update_source);
765 return "GEOMETRY_ALL_MODES";
779 return "COPY_ON_EVAL";
787 return "POINT_CACHE";
791 return "SEQUENCER_STRIPS";
793 return "FRAME_CHANGE";
797 return "AUDIO_VOLUME";
801 return "AUDIO_LISTENER";
811 return "TAG_FOR_UNDO";
813 return "ID_RECALC_NTREE_OUTPUT";
816 return "ID_RECALC_HIERARCHY";
878 if (id_type ==
ID_NT) {
902 deg::graph_tag_on_visible_update(graph, do_time);
908 deg::graph_tag_on_visible_update(
depsgraph, do_time);
921 if (!graph->use_editors_update) {
931 update_ctx.
bmain = bmain;
940 id->recalc &= ~ID_RECALC_ALL;
965 id_node->is_user_modified =
false;
966 id_node->is_cow_explicitly_tagged =
false;
989 id_node->id_cow_recalc_backup = 0;
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)
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
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
Object is a sort of wrapper for general info.
const Depsgraph * 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)
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
char id_type_updated[INDEX_ID_MAX]
char id_type_updated_backup[INDEX_ID_MAX]
IDComponentsMask previously_visible_components_mask
bool is_cow_explicitly_tagged
IDComponentsMask visible_components_mask
ComponentNode * find_component(NodeType type, const char *name="") const
virtual void tag_update(Depsgraph *graph, eUpdateSource source) override