Blender V4.3
clip_ops.cc File Reference
#include <cerrno>
#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_vector.h"
#include "BLI_path_utils.hh"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_task.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_movieclip.h"
#include "BKE_report.hh"
#include "BKE_tracking.h"
#include "WM_api.hh"
#include "WM_types.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"
#include "ED_clip.hh"
#include "ED_screen.hh"
#include "UI_interface.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "RNA_enum_types.hh"
#include "UI_view2d.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "clip_intern.hh"

Go to the source code of this file.

Classes

struct  ViewPanData
 
struct  ViewZoomData
 
struct  ProxyJob
 
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 *dirpath)
 
static void open_init (bContext *C, wmOperator *op)
 
static void open_cancel (bContext *, wmOperator *op)
 
static int open_exec (bContext *C, wmOperator *op)
 
static int open_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void CLIP_OT_open (wmOperatorType *ot)
 
Reload Clip Operator
static int reload_exec (bContext *C, wmOperator *)
 
void CLIP_OT_reload (wmOperatorType *ot)
 
View Pan Operator
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
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)
 
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 *)
 
void CLIP_OT_view_center_cursor (wmOperatorType *ot)
 
Frame Selected Operator
static int view_selected_exec (bContext *C, wmOperator *)
 
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)
 
Rebuild Proxies Operator
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 *, int, const int *build_undistort_sizes, int build_undistort_count, bool *stop, bool *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, bool *stop, bool *do_update, float *progress)
 
static void proxy_startjob (void *pjv, wmJobWorkerStatus *worker_status)
 
static void proxy_endjob (void *pjv)
 
static int clip_rebuild_proxy_exec (bContext *C, wmOperator *)
 
void CLIP_OT_rebuild_proxy (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 *, const wmEvent *event)
 
static int clip_prefetch_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void CLIP_OT_prefetch (wmOperatorType *ot)
 
Set Scene Frames Operator
static int clip_set_scene_frames_exec (bContext *C, wmOperator *)
 
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 *)
 
void CLIP_OT_lock_selection_toggle (wmOperatorType *ot)
 
Macros
void ED_operatormacros_clip ()
 

Function Documentation

◆ change_frame_apply()

◆ change_frame_exec()

static int change_frame_exec ( bContext * C,
wmOperator * op )
static

Definition at line 1078 of file clip_ops.cc.

References change_frame_apply(), and OPERATOR_FINISHED.

Referenced by CLIP_OT_change_frame().

◆ change_frame_invoke()

◆ change_frame_modal()

◆ change_frame_poll()

static bool change_frame_poll ( bContext * C)
static

Definition at line 1054 of file clip_ops.cc.

References CTX_wm_space_clip(), and G.

Referenced by CLIP_OT_change_frame().

◆ clip_filesel()

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

Definition at line 158 of file clip_ops.cc.

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

Referenced by open_invoke().

◆ CLIP_OT_change_frame()

◆ CLIP_OT_cursor_set()

◆ CLIP_OT_lock_selection_toggle()

◆ CLIP_OT_mode_set()

◆ CLIP_OT_open()

◆ CLIP_OT_prefetch()

◆ CLIP_OT_rebuild_proxy()

◆ CLIP_OT_reload()

void CLIP_OT_reload ( wmOperatorType * ot)

◆ CLIP_OT_set_scene_frames()

◆ CLIP_OT_view_all()

◆ CLIP_OT_view_center_cursor()

◆ CLIP_OT_view_pan()

◆ CLIP_OT_view_selected()

◆ CLIP_OT_view_zoom()

◆ CLIP_OT_view_zoom_in()

◆ CLIP_OT_view_zoom_out()

◆ CLIP_OT_view_zoom_ratio()

◆ clip_prefetch_invoke()

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

◆ clip_prefetch_modal()

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

◆ clip_rebuild_proxy_exec()

◆ clip_set_2d_cursor_exec()

◆ 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()

◆ do_movie_proxy()

static void do_movie_proxy ( void * pjv,
int * ,
int ,
const int * build_undistort_sizes,
int build_undistort_count,
bool * stop,
bool * 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,
bool * stop,
bool * do_update,
float * progress )
static

◆ ED_operatormacros_clip()

◆ frame_from_event()

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

◆ lock_selection_toggle_exec()

◆ mode_set_exec()

◆ open_cancel()

static void open_cancel ( bContext * ,
wmOperator * op )
static

Definition at line 173 of file clip_ops.cc.

References wmOperator::customdata.

Referenced by CLIP_OT_open().

◆ open_exec()

◆ open_init()

static void open_init ( bContext * C,
wmOperator * op )
static

◆ open_invoke()

◆ proxy_bitflag_to_array()

◆ proxy_endjob()

◆ proxy_freejob()

static void proxy_freejob ( void * pjv)
static

Definition at line 1184 of file clip_ops.cc.

References MEM_freeN().

Referenced by clip_rebuild_proxy_exec().

◆ proxy_startjob()

◆ 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()

◆ sclip_zoom_set()

◆ 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()

◆ view_center_cursor_exec()

static int view_center_cursor_exec ( bContext * C,
wmOperator *  )
static

◆ view_pan_cancel()

static void view_pan_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 496 of file clip_ops.cc.

References view_pan_exit().

Referenced by CLIP_OT_view_pan().

◆ view_pan_exec()

◆ view_pan_exit()

◆ view_pan_init()

◆ view_pan_invoke()

◆ view_pan_modal()

◆ view_selected_exec()

◆ view_zoom_apply()

◆ view_zoom_cancel()

static void view_zoom_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 699 of file clip_ops.cc.

References 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()

◆ view_zoom_in_exec()

◆ view_zoom_in_invoke()

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

◆ view_zoom_init()

◆ view_zoom_invoke()

◆ view_zoom_modal()

◆ view_zoom_out_exec()

◆ view_zoom_out_invoke()

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

◆ view_zoom_ratio_exec()