Blender  V3.3
Classes
clip_ops.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLI_fileops.h"
#include "BLI_math.h"
#include "BLI_path_util.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_movieclip.h"
#include "BKE_report.h"
#include "BKE_tracking.h"
#include "WM_api.h"
#include "WM_types.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "ED_clip.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "UI_view2d.h"
#include "PIL_time.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "clip_intern.h"

Go to the source code of this file.

Classes

struct  ViewPanData
 
struct  ViewZoomData
 
struct  ProxyBuildJob
 
struct  ProxyQueue
 
struct  ProxyThread
 

Functions

View Navigation Utilities
static void sclip_zoom_set (const bContext *C, float zoom, const float location[2], const bool zoom_to_pos)
 
static void sclip_zoom_set_factor (const bContext *C, float zoomfac, const float location[2], const bool zoom_to_pos)
 
static void sclip_zoom_set_factor_exec (bContext *C, const wmEvent *event, float factor)
 
Open Clip Operator
static void clip_filesel (bContext *C, wmOperator *op, const char *path)
 
static void open_init (bContext *C, wmOperator *op)
 
static void open_cancel (bContext *UNUSED(C), wmOperator *op)
 
static int open_exec (bContext *C, wmOperator *op)
 
static int open_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
 
void CLIP_OT_open (wmOperatorType *ot)
 
Reload Clip Operator
static int reload_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_reload (wmOperatorType *ot)
 
View Zoom In/Out Operator
static int view_zoom_in_exec (bContext *C, wmOperator *op)
 
static int view_zoom_in_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CLIP_OT_view_zoom_in (wmOperatorType *ot)
 
static int view_zoom_out_exec (bContext *C, wmOperator *op)
 
static int view_zoom_out_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CLIP_OT_view_zoom_out (wmOperatorType *ot)
 
View Zoom Ratio Operator
static int view_zoom_ratio_exec (bContext *C, wmOperator *op)
 
void CLIP_OT_view_zoom_ratio (wmOperatorType *ot)
 
View All Operator
static int view_all_exec (bContext *C, wmOperator *op)
 
void CLIP_OT_view_all (wmOperatorType *ot)
 
Center View To Cursor Operator
static int view_center_cursor_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_view_center_cursor (wmOperatorType *ot)
 
Frame Selected Operator
static int view_selected_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_view_selected (wmOperatorType *ot)
 
Change Frame Operator
static bool change_frame_poll (bContext *C)
 
static void change_frame_apply (bContext *C, wmOperator *op)
 
static int change_frame_exec (bContext *C, wmOperator *op)
 
static int frame_from_event (bContext *C, const wmEvent *event)
 
static int change_frame_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int change_frame_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
void CLIP_OT_change_frame (wmOperatorType *ot)
 
Mode Set Operator
static int mode_set_exec (bContext *C, wmOperator *op)
 
void CLIP_OT_mode_set (wmOperatorType *ot)
 
Prefetch Operator
static int clip_prefetch_modal (bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
 
static int clip_prefetch_invoke (bContext *C, wmOperator *op, const wmEvent *UNUSED(_event))
 
void CLIP_OT_prefetch (wmOperatorType *ot)
 
Set Scene Frames Operator
static int clip_set_scene_frames_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_set_scene_frames (wmOperatorType *ot)
 
Set 3d Cursor Operator
static int clip_set_2d_cursor_exec (bContext *C, wmOperator *op)
 
static int clip_set_2d_cursor_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void CLIP_OT_cursor_set (wmOperatorType *ot)
 
Toggle Lock To Selection Operator
static int lock_selection_toggle_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_lock_selection_toggle (wmOperatorType *ot)
 
Macros
void ED_operatormacros_clip (void)
 

View Pan Operator

typedef struct ViewPanData ViewPanData
 
static void view_pan_init (bContext *C, wmOperator *op, const wmEvent *event)
 
static void view_pan_exit (bContext *C, wmOperator *op, bool cancel)
 
static int view_pan_exec (bContext *C, wmOperator *op)
 
static int view_pan_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int view_pan_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void view_pan_cancel (bContext *C, wmOperator *op)
 
void CLIP_OT_view_pan (wmOperatorType *ot)
 

View Zoom Operator

typedef struct ViewZoomData ViewZoomData
 
static void view_zoom_init (bContext *C, wmOperator *op, const wmEvent *event)
 
static void view_zoom_exit (bContext *C, wmOperator *op, bool cancel)
 
static int view_zoom_exec (bContext *C, wmOperator *op)
 
static int view_zoom_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void view_zoom_apply (bContext *C, ViewZoomData *vpd, wmOperator *op, const wmEvent *event, const bool zoom_to_pos)
 
static int view_zoom_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static void view_zoom_cancel (bContext *C, wmOperator *op)
 
void CLIP_OT_view_zoom (wmOperatorType *ot)
 

Rebuild Proxies Operator

typedef struct ProxyBuildJob ProxyJob
 
typedef struct ProxyQueue ProxyQueue
 
typedef struct ProxyThread ProxyThread
 
static void proxy_freejob (void *pjv)
 
static int proxy_bitflag_to_array (int size_flag, int build_sizes[4], int undistort)
 
static void do_movie_proxy (void *pjv, int *UNUSED(build_sizes), int UNUSED(build_count), int *build_undistort_sizes, int build_undistort_count, short *stop, short *do_update, float *progress)
 
static ucharproxy_thread_next_frame (ProxyQueue *queue, MovieClip *clip, size_t *r_size, int *r_cfra)
 
static void proxy_task_func (TaskPool *__restrict pool, void *task_data)
 
static void do_sequence_proxy (void *pjv, int *build_sizes, int build_count, int *build_undistort_sizes, int build_undistort_count, short *stop, short *do_update, float *progress)
 
static void proxy_startjob (void *pjv, short *stop, short *do_update, float *progress)
 
static void proxy_endjob (void *pjv)
 
static int clip_rebuild_proxy_exec (bContext *C, wmOperator *UNUSED(op))
 
void CLIP_OT_rebuild_proxy (wmOperatorType *ot)
 

Typedef Documentation

◆ ProxyJob

typedef struct ProxyBuildJob ProxyJob

◆ ProxyQueue

typedef struct ProxyQueue ProxyQueue

◆ ProxyThread

typedef struct ProxyThread ProxyThread

◆ ViewPanData

typedef struct ViewPanData ViewPanData

◆ ViewZoomData

typedef struct ViewZoomData ViewZoomData

Function Documentation

◆ change_frame_apply()

static void change_frame_apply ( bContext C,
wmOperator op 
)
static

◆ change_frame_exec()

static int change_frame_exec ( bContext C,
wmOperator op 
)
static

Definition at line 1073 of file clip_ops.c.

References C, change_frame_apply(), and OPERATOR_FINISHED.

Referenced by CLIP_OT_change_frame().

◆ change_frame_invoke()

static int change_frame_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ change_frame_modal()

static int change_frame_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ change_frame_poll()

static bool change_frame_poll ( bContext C)
static

Definition at line 1049 of file clip_ops.c.

References C, CTX_wm_space_clip(), G, and NULL.

Referenced by CLIP_OT_change_frame().

◆ clip_filesel()

static void clip_filesel ( bContext C,
wmOperator op,
const char *  path 
)
static

Definition at line 158 of file clip_ops.c.

References C, wmOperator::ptr, RNA_string_set(), and WM_event_add_fileselect().

Referenced by open_invoke().

◆ CLIP_OT_change_frame()

void CLIP_OT_change_frame ( wmOperatorType ot)

◆ CLIP_OT_cursor_set()

void CLIP_OT_cursor_set ( wmOperatorType ot)

◆ CLIP_OT_lock_selection_toggle()

void CLIP_OT_lock_selection_toggle ( wmOperatorType ot)

◆ CLIP_OT_mode_set()

void CLIP_OT_mode_set ( wmOperatorType ot)

◆ CLIP_OT_open()

void CLIP_OT_open ( wmOperatorType ot)

◆ CLIP_OT_prefetch()

void CLIP_OT_prefetch ( wmOperatorType ot)

◆ CLIP_OT_rebuild_proxy()

void CLIP_OT_rebuild_proxy ( wmOperatorType ot)

◆ CLIP_OT_reload()

void CLIP_OT_reload ( wmOperatorType ot)

◆ CLIP_OT_set_scene_frames()

void CLIP_OT_set_scene_frames ( wmOperatorType ot)

◆ CLIP_OT_view_all()

void CLIP_OT_view_all ( wmOperatorType ot)

◆ CLIP_OT_view_center_cursor()

void CLIP_OT_view_center_cursor ( wmOperatorType ot)

◆ CLIP_OT_view_pan()

void CLIP_OT_view_pan ( wmOperatorType ot)

◆ CLIP_OT_view_selected()

void CLIP_OT_view_selected ( wmOperatorType ot)

◆ CLIP_OT_view_zoom()

void CLIP_OT_view_zoom ( wmOperatorType ot)

◆ CLIP_OT_view_zoom_in()

void CLIP_OT_view_zoom_in ( wmOperatorType ot)

◆ CLIP_OT_view_zoom_out()

void CLIP_OT_view_zoom_out ( wmOperatorType ot)

◆ CLIP_OT_view_zoom_ratio()

void CLIP_OT_view_zoom_ratio ( wmOperatorType ot)

◆ clip_prefetch_invoke()

static int clip_prefetch_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSED_event 
)
static

◆ clip_prefetch_modal()

static int clip_prefetch_modal ( bContext C,
wmOperator UNUSEDop,
const wmEvent event 
)
static

◆ clip_rebuild_proxy_exec()

static int clip_rebuild_proxy_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ clip_set_2d_cursor_exec()

static int clip_set_2d_cursor_exec ( bContext C,
wmOperator op 
)
static

◆ clip_set_2d_cursor_invoke()

static int clip_set_2d_cursor_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ clip_set_scene_frames_exec()

static int clip_set_scene_frames_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ do_movie_proxy()

static void do_movie_proxy ( void pjv,
int *  UNUSEDbuild_sizes,
int   UNUSEDbuild_count,
int *  build_undistort_sizes,
int  build_undistort_count,
short *  stop,
short *  do_update,
float progress 
)
static

◆ do_sequence_proxy()

static void do_sequence_proxy ( void pjv,
int *  build_sizes,
int  build_count,
int *  build_undistort_sizes,
int  build_undistort_count,
short *  stop,
short *  do_update,
float progress 
)
static

◆ ED_operatormacros_clip()

void ED_operatormacros_clip ( void  )

◆ frame_from_event()

static int frame_from_event ( bContext C,
const wmEvent event 
)
static

◆ lock_selection_toggle_exec()

static int lock_selection_toggle_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ mode_set_exec()

static int mode_set_exec ( bContext C,
wmOperator op 
)
static

◆ open_cancel()

static void open_cancel ( bContext UNUSEDC,
wmOperator op 
)
static

Definition at line 173 of file clip_ops.c.

References wmOperator::customdata, MEM_freeN, and NULL.

Referenced by CLIP_OT_open().

◆ open_exec()

static int open_exec ( bContext C,
wmOperator op 
)
static

◆ open_init()

static void open_init ( bContext C,
wmOperator op 
)
static

◆ open_invoke()

static int open_invoke ( bContext C,
wmOperator op,
const wmEvent UNUSEDevent 
)
static

◆ proxy_bitflag_to_array()

static int proxy_bitflag_to_array ( int  size_flag,
int  build_sizes[4],
int  undistort 
)
static

◆ proxy_endjob()

static void proxy_endjob ( void pjv)
static

◆ proxy_freejob()

static void proxy_freejob ( void pjv)
static

Definition at line 1179 of file clip_ops.c.

References MEM_freeN.

Referenced by clip_rebuild_proxy_exec().

◆ proxy_startjob()

static void proxy_startjob ( void pjv,
short *  stop,
short *  do_update,
float progress 
)
static

◆ proxy_task_func()

static void proxy_task_func ( TaskPool *__restrict  pool,
void task_data 
)
static

◆ proxy_thread_next_frame()

static uchar* proxy_thread_next_frame ( ProxyQueue queue,
MovieClip clip,
size_t *  r_size,
int *  r_cfra 
)
static

◆ reload_exec()

static int reload_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ sclip_zoom_set()

static void sclip_zoom_set ( const bContext C,
float  zoom,
const float  location[2],
const bool  zoom_to_pos 
)
static

◆ sclip_zoom_set_factor()

static void sclip_zoom_set_factor ( const bContext C,
float  zoomfac,
const float  location[2],
const bool  zoom_to_pos 
)
static

◆ sclip_zoom_set_factor_exec()

static void sclip_zoom_set_factor_exec ( bContext C,
const wmEvent event,
float  factor 
)
static

◆ view_all_exec()

static int view_all_exec ( bContext C,
wmOperator op 
)
static

◆ view_center_cursor_exec()

static int view_center_cursor_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view_pan_cancel()

static void view_pan_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 491 of file clip_ops.c.

References C, and view_pan_exit().

Referenced by CLIP_OT_view_pan().

◆ view_pan_exec()

static int view_pan_exec ( bContext C,
wmOperator op 
)
static

◆ view_pan_exit()

static void view_pan_exit ( bContext C,
wmOperator op,
bool  cancel 
)
static

◆ view_pan_init()

static void view_pan_init ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_pan_invoke()

static int view_pan_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_pan_modal()

static int view_pan_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_selected_exec()

static int view_selected_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ view_zoom_apply()

static void view_zoom_apply ( bContext C,
ViewZoomData vpd,
wmOperator op,
const wmEvent event,
const bool  zoom_to_pos 
)
static

◆ view_zoom_cancel()

static void view_zoom_cancel ( bContext C,
wmOperator op 
)
static

Definition at line 694 of file clip_ops.c.

References C, and view_zoom_exit().

Referenced by CLIP_OT_view_zoom().

◆ view_zoom_exec()

static int view_zoom_exec ( bContext C,
wmOperator op 
)
static

◆ view_zoom_exit()

static void view_zoom_exit ( bContext C,
wmOperator op,
bool  cancel 
)
static

◆ view_zoom_in_exec()

static int view_zoom_in_exec ( bContext C,
wmOperator op 
)
static

◆ view_zoom_in_invoke()

static int view_zoom_in_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_zoom_init()

static void view_zoom_init ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_zoom_invoke()

static int view_zoom_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_zoom_modal()

static int view_zoom_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_zoom_out_exec()

static int view_zoom_out_exec ( bContext C,
wmOperator op 
)
static

◆ view_zoom_out_invoke()

static int view_zoom_out_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ view_zoom_ratio_exec()

static int view_zoom_ratio_exec ( bContext C,
wmOperator op 
)
static