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);
237void id_tag_update_ntree_special(
241 if (ntree ==
nullptr) {
247void depsgraph_update_editors_tag(Main *bmain,
Depsgraph *graph, ID *
id)
252 DEGEditorUpdateContext update_ctx = {
nullptr};
253 update_ctx.bmain = bmain;
254 update_ctx.depsgraph =
reinterpret_cast<::blender::Depsgraph *
>(graph);
255 update_ctx.scene = graph->scene;
256 update_ctx.view_layer = graph->view_layer;
263 if (cow_comp ==
nullptr) {
270void depsgraph_tag_component(
Depsgraph *graph,
276 ComponentNode *component_node = id_node->find_component(component_type);
280 if (component_node ==
nullptr) {
282 id_node->is_cow_explicitly_tagged =
true;
283 depsgraph_id_tag_copy_on_write(graph, id_node, update_source);
288 component_node->tag_update(graph, update_source);
291 OperationNode *operation_node = component_node->find_operation(operation_code);
292 if (operation_node !=
nullptr) {
293 operation_node->tag_update(graph, update_source);
297 if (component_node->need_tag_cow_before_update(
IDRecalcFlag(id_node->id_cow->recalc))) {
298 depsgraph_id_tag_copy_on_write(graph, id_node, update_source);
301 id_node->is_cow_explicitly_tagged =
true;
310void deg_graph_id_tag_legacy_compat(
314 switch (
GS(id->name)) {
316 Object *
object = id_cast<Object *>(
id);
317 ID *data_id =
object->data;
318 if (data_id !=
nullptr) {
327 Mesh *mesh = id_cast<Mesh *>(
id);
328 if (mesh->key !=
nullptr) {
329 ID *key_id = &mesh->key->id;
330 if (key_id !=
nullptr) {
337 Lattice *lattice = id_cast<Lattice *>(
id);
338 if (lattice->key !=
nullptr) {
339 ID *key_id = &lattice->key->id;
340 if (key_id !=
nullptr) {
347 Curve *curve = id_cast<Curve *>(
id);
348 if (curve->key !=
nullptr) {
349 ID *key_id = &curve->key->id;
350 if (key_id !=
nullptr) {
362void graph_id_tag_update_single_flag(Main *bmain,
370 if (graph !=
nullptr && graph->is_active) {
371 depsgraph_update_editors_tag(bmain, graph,
id);
378 depsgraph_tag_to_component_opcode(
id, tag, &component_type, &operation_code);
386 if (id_node ==
nullptr) {
394 id_node->id_cow->recalc |= factory->id_recalc_tag();
397 id_node->tag_update(graph, update_source);
400 depsgraph_tag_component(graph, id_node, component_type, operation_code, update_source);
404 deg_graph_id_tag_legacy_compat(bmain, graph,
id, tag, update_source);
407std::string stringify_update_bitfield(
uint flags)
427 return "SIDE_EFFECT_REQUEST";
433int deg_recalc_flags_for_legacy_zero()
443 if (graph !=
nullptr) {
444 if (!graph->is_active) {
449 return deg_recalc_flags_for_legacy_zero();
459void deg_graph_node_tag_zero(Main *bmain,
464 if (id_node ==
nullptr) {
467 ID *
id = id_node->id_orig;
469 id_node->id_cow->recalc |= deg_recalc_flags_for_legacy_zero();
471 for (
ComponentNode *comp_node : id_node->components.values()) {
476 id_node->is_cow_explicitly_tagged =
true;
479 comp_node->tag_update(graph, update_source);
481 deg_graph_id_tag_legacy_compat(bmain, graph,
id,
IDRecalcFlag(0), update_source);
489void deg_graph_tag_parameters_if_needed(Main *bmain,
508 const uint clean_flags = flags &
515 if (clean_flags == 0) {
520 graph_id_tag_update_single_flag(bmain, graph,
id, id_node,
ID_RECALC_PARAMETERS, update_source);
523void graph_tag_on_visible_update(
Depsgraph *graph,
const bool do_time)
525 graph->need_tag_id_on_graph_visibility_update =
true;
526 graph->need_tag_id_on_graph_visibility_time_update |= do_time;
572 if (id_type ==
ID_OB) {
608 const Object *
object = id_cast<Object *>(
const_cast<ID *
>(
id));
677 id->recalc_after_undo_push |= deg_recalc_flags_effective(
nullptr, flags);
697 static std::atomic<uint64_t> global_image_update_count = 0;
698 image->runtime->update_count = global_image_update_count.fetch_add(1) + 1;
705 const int debug_flags = (graph !=
nullptr) ?
707 reinterpret_cast<::blender::Depsgraph *
>(graph)) :
711 printf(
"ID tagged for update during dependency graph evaluation.\n");
716 printf(
"%s: id=%s flags=%s source=%s\n",
719 stringify_update_bitfield(flags).c_str(),
720 update_source_as_string(update_source));
726 if (graph !=
nullptr) {
730 deg_graph_node_tag_zero(bmain, graph, id_node, update_source);
734 if (id_node !=
nullptr) {
745 id->recalc |= deg_recalc_flags_effective(graph, flags);
747 uint current_flag = flags;
748 while (current_flag != 0) {
750 graph_id_tag_update_single_flag(bmain, graph,
id, id_node, tag, update_source);
753 id_tag_update_ntree_special(bmain, graph,
id, flags, update_source);
759 graph_id_tag_update_single_flag(
762 deg_graph_tag_parameters_if_needed(bmain, graph,
id, id_node, flags, update_source);
775 return "GEOMETRY_ALL_MODES";
789 return "COPY_ON_EVAL";
797 return "POINT_CACHE";
801 return "SEQUENCER_STRIPS";
803 return "FRAME_CHANGE";
807 return "AUDIO_VOLUME";
811 return "AUDIO_LISTENER";
821 return "TAG_FOR_UNDO";
823 return "ID_RECALC_NTREE_OUTPUT";
825 return "ID_RECALC_HIERARCHY";
827 return "ID_RECALC_COMPOSITOR";
888 if (id_type ==
ID_NT) {
912 deg::graph_tag_on_visible_update(graph, do_time);
918 deg::graph_tag_on_visible_update(depsgraph, do_time);
941 update_ctx.
bmain = bmain;
943 update_ctx.
scene = scene;
978 component_node->is_user_modified =
false;
#define ID_TYPE_USE_COPY_ON_EVAL(_id_type)
Object is a sort of wrapper for general info.
#define BLI_assert_msg(a, msg)
constexpr IndexRange()=default
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
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void DEG_time_tag_update(Main *bmain)
void DEG_enable_editors_update(Depsgraph *depsgraph)
void DEG_graph_id_tag_update(Main *bmain, Depsgraph *depsgraph, ID *id, unsigned int flags)
static void deg_graph_clear_id_recalc_flags(ID *id)
void BKE_lib_override_id_tag_on_deg_tag_from_user(ID *id)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void DEG_ids_clear_recalc(Depsgraph *depsgraph, bool backup)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
AnimData * BKE_animdata_from_id(const ID *id)
MINLINE unsigned int bitscan_forward_clear_uint(unsigned int *a)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
ViewLayer * DEG_get_input_view_layer(const Depsgraph *graph)
bool DEG_id_type_any_updated(const Depsgraph *depsgraph)
Main * DEG_get_bmain(const Depsgraph *graph)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_type_tag(Main *bmain, short id_type)
int BKE_idtype_idcode_to_index(short idcode)
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)
void DEG_graph_time_tag_update(Depsgraph *depsgraph)
void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type)
@ ID_RECALC_AUDIO_LISTENER
@ ID_RECALC_GEOMETRY_ALL_MODES
@ ID_RECALC_SEQUENCER_STRIPS
ID_Type GS(const char *name)
Scene * DEG_get_input_scene(const Depsgraph *graph)
int DEG_debug_flags_get(const Depsgraph *depsgraph)
const char * DEG_update_tag_as_string(IDRecalcFlag flag)
void DEG_graph_tag_on_visible_update(Depsgraph *depsgraph, bool do_time)
std::string DEG_stringify_recalc_flags(unsigned int flags)
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
Map< ComponentIDKey, ComponentNode * > components
void tag_update(Depsgraph *graph, eUpdateSource source) override