blender-v3.6-release backports #109694

Merged
Philipp Oeser merged 19 commits from lichtwerk/blender:blender-v3.6-release into blender-v3.6-release 2023-07-04 13:55:25 +02:00
3 changed files with 14 additions and 1 deletions
Showing only changes of commit 7fe112c56d - Show all commits

View File

@ -105,6 +105,8 @@ typedef enum {
BKE_CB_EVT_COMPOSITE_PRE,
BKE_CB_EVT_COMPOSITE_POST,
BKE_CB_EVT_COMPOSITE_CANCEL,
BKE_CB_EVT_ANIMATION_PLAYBACK_PRE,
BKE_CB_EVT_ANIMATION_PLAYBACK_POST,
BKE_CB_EVT_TOT,
} eCbEvent;

View File

@ -30,6 +30,7 @@
#include "DNA_userdef_types.h"
#include "DNA_workspace_types.h"
#include "BKE_callbacks.h"
#include "BKE_context.h"
#include "BKE_editmesh.h"
#include "BKE_fcurve.h"
@ -4867,18 +4868,26 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
{
bScreen *screen = CTX_wm_screen(C);
Scene *scene = CTX_data_scene(C);
Scene *scene_eval = DEG_get_evaluated_scene(CTX_data_ensure_evaluated_depsgraph(C));
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Main *bmain = DEG_get_bmain(depsgraph);
if (ED_screen_animation_playing(CTX_wm_manager(C))) {
/* stop playback now */
ED_screen_animation_timer(C, 0, 0, 0);
BKE_sound_stop_scene(scene_eval);
BKE_callback_exec_id_depsgraph(
bmain, &scene->id, depsgraph, BKE_CB_EVT_ANIMATION_PLAYBACK_POST);
/* Triggers redraw of sequencer preview so that it does not show to fps anymore after stopping
* playback. */
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_SEQUENCER, scene);
}
else {
BKE_callback_exec_id_depsgraph(
bmain, &scene->id, depsgraph, BKE_CB_EVT_ANIMATION_PLAYBACK_PRE);
/* these settings are currently only available from a menu in the TimeLine */
if (mode == 1) { /* XXX only play audio forwards!? */
BKE_sound_play_scene(scene_eval);

View File

@ -86,6 +86,8 @@ static PyStructSequence_Field app_cb_info_fields[] = {
{"composite_pre", "on a compositing background job (before)"},
{"composite_post", "on a compositing background job (after)"},
{"composite_cancel", "on a compositing background job (cancel)"},
{"animation_playback_pre", "on starting animation playback"},
{"animation_playback_post", "on ending animation playback"},
/* sets the permanent tag */
#define APP_CB_OTHER_FIELDS 1