Blender V5.3
wm_playanim.cc File Reference
#include <algorithm>
#include <cerrno>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/times.h>
#include <sys/wait.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "BLI_enum_flags.hh"
#include "BLI_fileops.hh"
#include "BLI_listbase.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_path_utils.hh"
#include "BLI_rect.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_system.hh"
#include "BLI_time.hh"
#include "IMB_colormanagement.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "MOV_read.hh"
#include "MOV_util.hh"
#include "BKE_blender.hh"
#include "BKE_image.hh"
#include "BKE_sound.hh"
#include "BIF_glutil.hh"
#include "GPU_context.hh"
#include "GPU_framebuffer.hh"
#include "GPU_immediate.hh"
#include "GPU_immediate_util.hh"
#include "GPU_init_exit.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLF_api.hh"
#include "GHOST_CallbackEventConsumer.hh"
#include "GHOST_IEvent.hh"
#include "GHOST_ISystem.hh"
#include "GHOST_IWindow.hh"
#include "GHOST_Types.hh"
#include "wm_window_private.hh"
#include "WM_api.hh"

Go to the source code of this file.

Classes

struct  blender::GhostData
struct  blender::PlayArgs
struct  blender::PlayDisplayContext
struct  blender::PlayState
struct  blender::PlayAnimPict

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_FRAME_CACHE_LIMIT
#define PLAY_FRAME_CACHE_MAX   30
#define WS_QUAL_SHIFT   (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)
#define WS_QUAL_ALT   (WS_QUAL_LALT | WS_QUAL_RALT)
#define WS_QUAL_CTRL   (WS_QUAL_LCTRL | WS_QUAL_RCTRL | WS_QUAL_LCMD | WS_QUAL_RCMD)
#define WS_QUAL_MOUSE   (WS_QUAL_LMOUSE | WS_QUAL_MMOUSE | WS_QUAL_RMOUSE)
#define USE_IMB_CACHE

Enumerations

enum  blender::eWS_Qual {
  blender::WS_QUAL_LSHIFT = (1 << 0) , blender::WS_QUAL_RSHIFT = (1 << 1) , blender::WS_QUAL_LALT = (1 << 2) , blender::WS_QUAL_RALT = (1 << 3) ,
  blender::WS_QUAL_LCTRL = (1 << 4) , blender::WS_QUAL_RCTRL = (1 << 5) , blender::WS_QUAL_LCMD = (1 << 6) , blender::WS_QUAL_RCMD = (1 << 7) ,
  blender::WS_QUAL_LMOUSE = (1 << 16) , blender::WS_QUAL_MMOUSE = (1 << 17) , blender::WS_QUAL_RMOUSE = (1 << 18)
}

Functions

static void blender::playanim_window_zoom (PlayState &ps, const float zoom_offset)
static bool blender::playanim_window_font_scale_from_dpi (PlayState &ps)
static int2 blender::playanim_window_size_get (GHOST_IWindow *ghost_window)
static bool blender::playanim_window_contains_point (GHOST_IWindow *ghost_window, const bool use_window_csd, const int32_t cx, const int32_t cy)
static void blender::playanim_gpu_matrix ()
static void blender::playanim_event_qual_update (GhostData &ghost_data)
static void blender::frame_cache_add (PlayAnimPict *pic)
static void blender::frame_cache_remove (PlayAnimPict *pic)
static void blender::frame_cache_touch (PlayAnimPict *pic)
static bool blender::frame_cache_limit_exceeded ()
static void blender::frame_cache_limit_apply (ImBuf *ibuf_keep)
static ImBuf * blender::ibuf_from_picture (PlayAnimPict *pic)
static PlayAnimPict * blender::playanim_step (PlayAnimPict *playanim, int step)
static int blender::pupdate_time ()
static const void * blender::setup_draw_ocio_transform (const PlayDisplayContext &display_ctx, const ImBuf *ibuf, gpu::TextureFormat &r_texture_format, eGPUDataFormat &r_data_format)
static void blender::draw_display_buffer (const PlayDisplayContext &display_ctx, const ImBuf *ibuf, const rctf *canvas, const bool draw_flip[2])
static void blender::playanim_toscreen_ex (GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, const ImBuf *ibuf, const bool show_status, const int font_id, const int frame_step, const float draw_zoom, const bool draw_flip[2], const float frame_indicator_factor)
static void blender::playanim_toscreen_on_load (GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, const ImBuf *ibuf)
static void blender::playanim_toscreen (PlayState &ps, const PlayAnimPict *picture, const ImBuf *ibuf)
static void blender::build_pict_list_from_anim (ListBaseT< PlayAnimPict > &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int frame_offset)
static void blender::build_pict_list_from_image_sequence (ListBaseT< PlayAnimPict > &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int frame_offset, const int totframes, const int frame_step, const bool *loading_p)
static void blender::build_pict_list (ListBaseT< PlayAnimPict > &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int totframes, const int frame_step, bool *loading_p)
static void blender::update_sound_fps ()
static void blender::playanim_change_frame_tag (PlayState &ps, int cx)
static void blender::playanim_change_frame (PlayState &ps)
static void blender::playanim_audio_resume (PlayState &ps)
static void blender::playanim_audio_stop (PlayState &)
static bool blender::ghost_event_proc (const GHOST_IEvent *ghost_event, GHOST_TUserDataPtr ps_void_ptr)
static GHOST_IWindow * blender::playanim_window_open (GHOST_ISystem *ghost_system, const char *title, int posx, int posy, int sizex, int sizey)
static std::optional< int > blender::wm_main_playanim_intern (int argc, const char **argv, PlayArgs *args_next)
int blender::WM_main_playanim (int argc, const char **argv)
Local Utilities
static bool blender::buffer_from_filepath (const char *filepath, void **r_mem, size_t *r_size, char **r_error_message)

Variables

static CLG_LogRef blender::LOG = {"image"}
static const char * blender::message_prefix = "Animation Player"
static const char * blender::playanim_window_title = "Blender Animation Player"
static struct  blender::g_playanim
static struct  blender::g_frame_cache

Detailed Description

Animation player for image sequences & video's with sound support. Launched in a separate process from Blender's #RENDER_OT_play_rendered_anim

Note
This file uses ghost directly and none of the WM definitions. this could be made into its own module, alongside creator.

Definition in file wm_playanim.cc.

Macro Definition Documentation

◆ PLAY_FRAME_CACHE_MAX

#define PLAY_FRAME_CACHE_MAX   30

Definition at line 99 of file wm_playanim.cc.

Referenced by blender::frame_cache_limit_exceeded().

◆ USE_FRAME_CACHE_LIMIT

#define USE_FRAME_CACHE_LIMIT

Definition at line 97 of file wm_playanim.cc.

◆ USE_IMB_CACHE

#define USE_IMB_CACHE

◆ WS_QUAL_ALT

#define WS_QUAL_ALT   (WS_QUAL_LALT | WS_QUAL_RALT)

Definition at line 174 of file wm_playanim.cc.

◆ WS_QUAL_CTRL

#define WS_QUAL_CTRL   (WS_QUAL_LCTRL | WS_QUAL_RCTRL | WS_QUAL_LCMD | WS_QUAL_RCMD)

Definition at line 179 of file wm_playanim.cc.

Referenced by blender::ghost_event_proc().

◆ WS_QUAL_MOUSE

#define WS_QUAL_MOUSE   (WS_QUAL_LMOUSE | WS_QUAL_MMOUSE | WS_QUAL_RMOUSE)

Definition at line 183 of file wm_playanim.cc.

Referenced by blender::ghost_event_proc().

◆ WS_QUAL_SHIFT

#define WS_QUAL_SHIFT   (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)

Definition at line 171 of file wm_playanim.cc.

Referenced by blender::ghost_event_proc(), and blender::playanim_toscreen().