Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sound/sound_ops.c
| Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* ******************************************************* */ | /* ******************************************************* */ | ||||
| static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op)) | static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *scene_layer = CTX_data_scene_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| struct Depsgraph *depsgraph = CTX_data_depsgraph(C); | struct Depsgraph *depsgraph = CTX_data_depsgraph(C); | ||||
| int oldfra = scene->r.cfra; | int oldfra = scene->r.cfra; | ||||
| int cfra; | int cfra; | ||||
| sound_update_animation_flags_exec(C, NULL); | sound_update_animation_flags_exec(C, NULL); | ||||
| for (cfra = (scene->r.sfra > 0) ? (scene->r.sfra - 1) : 0; cfra <= scene->r.efra + 1; cfra++) { | for (cfra = (scene->r.sfra > 0) ? (scene->r.sfra - 1) : 0; cfra <= scene->r.efra + 1; cfra++) { | ||||
| scene->r.cfra = cfra; | scene->r.cfra = cfra; | ||||
| BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); | BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, view_layer); | ||||
| } | } | ||||
| scene->r.cfra = oldfra; | scene->r.cfra = oldfra; | ||||
| BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, scene_layer); | BKE_scene_graph_update_for_newframe(bmain->eval_ctx, depsgraph, bmain, scene, view_layer); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static void SOUND_OT_bake_animation(wmOperatorType *ot) | static void SOUND_OT_bake_animation(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Update Animation Cache"; | ot->name = "Update Animation Cache"; | ||||
| ▲ Show 20 Lines • Show All 499 Lines • Show Last 20 Lines | |||||