Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/scene.c
| Show First 20 Lines • Show All 1,503 Lines • ▼ Show 20 Lines | if ((obedit->type == OB_MESH) && | ||||
| DEG_id_tag_update(&mesh->id, 0); | DEG_id_tag_update(&mesh->id, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* TODO(sergey): This actually should become view_layer_graph or so. | /* TODO(sergey): This actually should become view_layer_graph or so. | ||||
| * Same applies to update_for_newframe. | * Same applies to update_for_newframe. | ||||
| * | |||||
| * If only_if_tagged is truth then the function will do nothing if the dependency graph is up | |||||
| * to date already. | |||||
| */ | */ | ||||
| void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain) | static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool only_if_tagged) | ||||
| { | { | ||||
| if (only_if_tagged && DEG_is_fully_evaluated(depsgraph)) { | |||||
| return; | |||||
| } | |||||
| Scene *scene = DEG_get_input_scene(depsgraph); | Scene *scene = DEG_get_input_scene(depsgraph); | ||||
| ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); | ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); | ||||
| bool run_callbacks = DEG_id_type_any_updated(depsgraph); | bool run_callbacks = DEG_id_type_any_updated(depsgraph); | ||||
| if (run_callbacks) { | if (run_callbacks) { | ||||
| BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_PRE); | BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_PRE); | ||||
| } | } | ||||
| Show All 20 Lines | if (run_callbacks) { | ||||
| BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_POST); | BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_POST); | ||||
| } | } | ||||
| /* Inform editors about possible changes. */ | /* Inform editors about possible changes. */ | ||||
| DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false); | DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false); | ||||
| /* Clear recalc flags. */ | /* Clear recalc flags. */ | ||||
| DEG_ids_clear_recalc(bmain, depsgraph); | DEG_ids_clear_recalc(bmain, depsgraph); | ||||
| } | } | ||||
| void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain) | |||||
| { | |||||
| scene_graph_update_tagged(depsgraph, bmain, false); | |||||
| } | |||||
| void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain) | |||||
| { | |||||
| scene_graph_update_tagged(depsgraph, bmain, true); | |||||
| } | |||||
| /* applies changes right away, does all sets too */ | /* applies changes right away, does all sets too */ | ||||
| void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain) | void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain) | ||||
| { | { | ||||
| Scene *scene = DEG_get_input_scene(depsgraph); | Scene *scene = DEG_get_input_scene(depsgraph); | ||||
| ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); | ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); | ||||
| /* TODO(sergey): Some functions here are changing global state, | /* TODO(sergey): Some functions here are changing global state, | ||||
| * for example, clearing update tags from bmain. | * for example, clearing update tags from bmain. | ||||
| ▲ Show 20 Lines • Show All 846 Lines • Show Last 20 Lines | |||||