48static StripElem *rna_Strip_elem_from_frame(
ID *
id,
Strip *self,
int timeline_frame)
50 Scene *scene = id_cast<Scene *>(
id);
54static void rna_Strip_swap_internal(
ID *
id,
59 const char *error_msg;
60 Scene *scene = id_cast<Scene *>(
id);
67static void rna_Strips_move_strip_to_meta(
70 Scene *scene = id_cast<Scene *>(
id);
71 const char *error_msg;
87static Strip *rna_Strip_split(
ID *
id,
93 bool ignore_connections)
95 Scene *scene = id_cast<Scene *>(
id);
98 const char *error_msg =
nullptr;
107 if (error_msg !=
nullptr) {
120static Strip *rna_Strip_parent_meta(
ID *
id,
Strip *strip_self)
122 Scene *scene = id_cast<Scene *>(
id);
126static Strip *rna_Strips_new_clip(
ID *
id,
127 ListBaseT<Strip> *seqbase,
134 Scene *scene = id_cast<Scene *>(
id);
147static Strip *rna_Strips_editing_new_clip(
ID *
id,
155 return rna_Strips_new_clip(
id, &
ed->seqbase, bmain, name, clip, channel, frame_start);
158static Strip *rna_Strips_meta_new_clip(
ID *
id,
166 return rna_Strips_new_clip(
id, &strip->seqbase, bmain, name, clip, channel, frame_start);
169static Strip *rna_Strips_new_mask(
ID *
id,
170 ListBaseT<Strip> *seqbase,
177 Scene *scene = id_cast<Scene *>(
id);
189static Strip *rna_Strips_editing_new_mask(
192 return rna_Strips_new_mask(
id, &
ed->seqbase, bmain, name,
mask, channel, frame_start);
195static Strip *rna_Strips_meta_new_mask(
196 ID *
id,
Strip *strip,
Main *bmain,
const char *name,
Mask *
mask,
int channel,
int frame_start)
198 return rna_Strips_new_mask(
id, &strip->seqbase, bmain, name,
mask, channel, frame_start);
201static Strip *rna_Strips_new_scene(
ID *
id,
202 ListBaseT<Strip> *seqbase,
209 Scene *scene = id_cast<Scene *>(
id);
222static Strip *rna_Strips_editing_new_scene(
ID *
id,
230 return rna_Strips_new_scene(
id, &
ed->seqbase, bmain, name, sce_strip, channel, frame_start);
233static Strip *rna_Strips_meta_new_scene(
ID *
id,
241 return rna_Strips_new_scene(
id, &strip->seqbase, bmain, name, sce_strip, channel, frame_start);
244static Strip *rna_Strips_new_image(
ID *
id,
245 ListBaseT<Strip> *seqbase,
254 Scene *scene = id_cast<Scene *>(
id);
262 STRNCPY_UTF8(vt_old, scene->view_settings.view_transform);
266 if (!
STREQ(vt_old, scene->view_settings.view_transform)) {
269 "View transform set to %s (converted from %s)",
270 scene->view_settings.view_transform,
287static Strip *rna_Strips_editing_new_image(
ID *
id,
297 return rna_Strips_new_image(
298 id, &
ed->seqbase, bmain, reports, name, file, channel, frame_start, fit_method);
301static Strip *rna_Strips_meta_new_image(
ID *
id,
311 return rna_Strips_new_image(
312 id, &strip->seqbase, bmain, reports, name, file, channel, frame_start, fit_method);
315static Strip *rna_Strips_new_movie(
ID *
id,
316 ListBaseT<Strip> *seqbase,
326 Scene *scene = id_cast<Scene *>(
id);
334 STRNCPY_UTF8(vt_old, scene->view_settings.view_transform);
335 float fps_old = scene->r.frs_sec / scene->r.frs_sec_base;
339 if (!
STREQ(vt_old, scene->view_settings.view_transform)) {
342 "View transform set to %s (converted from %s)",
343 scene->view_settings.view_transform,
347 if (fps_old != scene->r.frs_sec / scene->r.frs_sec_base) {
350 "Scene frame rate set to %.4g (converted from %.4g)",
351 scene->r.frs_sec / scene->r.frs_sec_base,
362static Strip *rna_Strips_editing_new_movie(
ID *
id,
373 return rna_Strips_new_movie(
374 id, &
ed->seqbase, bmain, reports, name, file, channel, frame_start, fit_method, stream);
377static Strip *rna_Strips_meta_new_movie(
ID *
id,
388 return rna_Strips_new_movie(
389 id, &strip->seqbase, bmain, reports, name, file, channel, frame_start, fit_method, stream);
392# ifdef WITH_AUDASPACE
393static Strip *rna_Strips_new_sound(
ID *
id,
394 ListBaseT<Strip> *seqbase,
410 if (strip ==
nullptr) {
422static Strip *rna_Strips_new_sound(
ID * ,
437static Strip *rna_Strips_editing_new_sound(
ID *
id,
447 return rna_Strips_new_sound(
448 id, &
ed->seqbase, bmain, reports, name, file, channel, frame_start, stream);
451static Strip *rna_Strips_meta_new_sound(
ID *
id,
461 return rna_Strips_new_sound(
462 id, &strip->seqbase, bmain, reports, name, file, channel, frame_start, stream);
468static Strip *rna_Strips_new_meta(
469 ID *
id, ListBaseT<Strip> *seqbase,
const char *name,
int channel,
int frame_start)
471 Scene *scene = id_cast<Scene *>(
id);
479static Strip *rna_Strips_editing_new_meta(
480 ID *
id,
Editing *
ed,
const char *name,
int channel,
int frame_start)
482 return rna_Strips_new_meta(
id, &
ed->seqbase, name, channel, frame_start);
485static Strip *rna_Strips_meta_new_meta(
486 ID *
id,
Strip *strip,
const char *name,
int channel,
int frame_start)
488 return rna_Strips_new_meta(
id, &strip->seqbase, name, channel, frame_start);
491static Strip *rna_Strips_new_effect(
ID *
id,
492 ListBaseT<Strip> *seqbase,
504 switch (min_inputs) {
506 if (
length <= 0 && !compositor_with_inputs) {
512 if (input1 ==
nullptr) {
518 if (input1 ==
nullptr || input2 ==
nullptr) {
526 "Effect expects more than 2 inputs (%d, should never happen!)",
536 Scene *scene = id_cast<Scene *>(
id);
541 colvars->
width = scene->r.xsch;
542 colvars->height = scene->r.ysch;
551static Strip *rna_Strips_editing_new_effect(
ID *
id,
562 return rna_Strips_new_effect(
563 id, &
ed->seqbase, reports, name, type, channel, frame_start,
length, input1, input2);
566static Strip *rna_Strips_meta_new_effect(
ID *
id,
577 return rna_Strips_new_effect(
578 id, &strip->seqbase, reports, name, type, channel, frame_start,
length, input1, input2);
581static void rna_Strips_remove(
584 Strip *strip =
static_cast<Strip *
>(strip_ptr->data);
585 Scene *scene = id_cast<Scene *>(
id);
589 reports,
RPT_ERROR,
"Strip '%s' not in scene '%s'", strip->name + 2, scene->id.
name + 2);
595 strip_ptr->invalidate();
602static void rna_Strips_editing_remove(
605 rna_Strips_remove(
id, &
ed->seqbase, bmain, reports, strip_ptr);
608static void rna_Strips_meta_remove(
611 rna_Strips_remove(
id, &strip->seqbase, bmain, reports, strip_ptr);
616 Scene *scene = id_cast<Scene *>(
id);
619 const int old_len = strip->data->stripdata_num;
620 strip->data->stripdata = se =
static_cast<StripElem *
>(
624 strip->data->stripdata_num = old_len + 1;
625 strip->content_length_set(strip->content_length() + 1);
636 Scene *scene = id_cast<Scene *>(
id);
642 const int old_len = strip->data->stripdata_num;
658 const bool is_visible =
index >= strip->anim_startofs &&
659 index < strip->anim_startofs + strip->content_length();
660 if (is_visible && strip->content_length() == 1) {
667 if (index < strip->anim_startofs) {
668 strip->anim_startofs--;
670 else if (!is_visible) {
671 strip->anim_endofs--;
674 strip->content_length_set(strip->content_length() - 1);
675 if (strip->content_length() == 1) {
680 new_se = MEM_new_array<StripElem>(old_len - 1,
"StripElements_pop");
682 se = strip->data->stripdata;
687 if (
index < old_len - 1) {
691 MEM_delete(strip->data->stripdata);
692 strip->data->stripdata = new_se;
693 strip->data->stripdata_num = old_len - 1;
698static void rna_Strip_invalidate_cache_rnafunc(
ID *
id,
Strip *self,
int type)
715 Scene *scene = id_cast<Scene *>(
id);
718 scene, reports, strip, timeline_frame);
725static void rna_Strip_retiming_keys_reset(
ID *
id,
Strip *strip)
727 Scene *scene = id_cast<Scene *>(
id);
749 {0,
nullptr, 0,
nullptr,
nullptr},
755 {0,
nullptr, 0,
nullptr,
nullptr},
758 func =
RNA_def_function(srna,
"strip_elem_from_frame",
"rna_Strip_elem_from_frame");
767 "The frame to get the strip element from",
773 RNA_def_pointer(func,
"elem",
"StripElement",
"",
"strip element of the current frame"));
779 parm =
RNA_def_pointer(func,
"other",
"Strip",
"Other",
"Other strip to swap with");
782 func =
RNA_def_function(srna,
"move_to_meta",
"rna_Strips_move_strip_to_meta");
786 func,
"meta_sequence",
"Strip",
"Destination Meta Strip",
"Meta to move the strip into");
793 parm =
RNA_def_pointer(func,
"sequence",
"Strip",
"",
"Parent meta strip");
796 func =
RNA_def_function(srna,
"invalidate_cache",
"rna_Strip_invalidate_cache_rnafunc");
799 "Invalidate cached images for strip and all dependent strips");
800 parm =
RNA_def_enum(func,
"type", strip_cache_type_items, 0,
"Type",
"Cache Type");
807 func,
"frame", 0, INT_MIN,
INT_MAX,
"",
"Frame where to split the strip", INT_MIN,
INT_MAX);
811 strip_split_method_items,
814 "The type of split operation to perform on strips");
817 func,
"ignore_connections",
false,
"",
"Don't propagate split to connected strips");
820 parm =
RNA_def_pointer(func,
"sequence",
"Strip",
"",
"Right side Strip");
838 parm =
RNA_def_string(func,
"filename",
"File", 0,
"",
"Filepath to image");
841 parm =
RNA_def_pointer(func,
"elem",
"StripElement",
"",
"New StripElement");
849 func,
"index", -1, INT_MIN,
INT_MAX,
"",
"Index of image to remove", INT_MIN,
INT_MAX);
867 "Where to add the retiming key in the timeline",
886 {
STRIP_TYPE_CROSS,
"CROSS", 0,
"Crossfade",
"Fade out of one video, fading into another"},
887 {
STRIP_TYPE_ADD,
"ADD", 0,
"Add",
"Add together color channels from two videos"},
888 {
STRIP_TYPE_SUB,
"SUBTRACT", 0,
"Subtract",
"Subtract one strip's color from another"},
895 "Crossfade with color correction"},
897 {
STRIP_TYPE_MUL,
"MULTIPLY", 0,
"Multiply",
"Multiply color channels from two videos"},
898 {
STRIP_TYPE_WIPE,
"WIPE", 0,
"Wipe",
"Sweep a transition line across the frame"},
899 {
STRIP_TYPE_GLOW,
"GLOW", 0,
"Glow",
"Add blur and brightness to light areas"},
901 {
STRIP_TYPE_SPEED,
"SPEED", 0,
"Speed",
"Timewarp video strips, modifying playback speed"},
907 {0,
nullptr, 0,
nullptr,
nullptr},
910 const char *new_clip_func_name =
"rna_Strips_editing_new_clip";
911 const char *new_mask_func_name =
"rna_Strips_editing_new_mask";
912 const char *new_scene_func_name =
"rna_Strips_editing_new_scene";
913 const char *new_image_func_name =
"rna_Strips_editing_new_image";
914 const char *new_movie_func_name =
"rna_Strips_editing_new_movie";
915 const char *new_sound_func_name =
"rna_Strips_editing_new_sound";
916 const char *new_meta_func_name =
"rna_Strips_editing_new_meta";
917 const char *new_effect_func_name =
"rna_Strips_editing_new_effect";
918 const char *remove_func_name =
"rna_Strips_editing_remove";
921 new_clip_func_name =
"rna_Strips_meta_new_clip";
922 new_mask_func_name =
"rna_Strips_meta_new_mask";
923 new_scene_func_name =
"rna_Strips_meta_new_scene";
924 new_image_func_name =
"rna_Strips_meta_new_image";
925 new_movie_func_name =
"rna_Strips_meta_new_movie";
926 new_sound_func_name =
"rna_Strips_meta_new_sound";
927 new_meta_func_name =
"rna_Strips_meta_new_meta";
928 new_effect_func_name =
"rna_Strips_meta_new_effect";
929 remove_func_name =
"rna_Strips_meta_remove";
935 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
937 parm =
RNA_def_pointer(func,
"clip",
"MovieClip",
"",
"Movie clip to add");
945 "The channel for the new strip",
955 "The start frame for the new strip",
967 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
977 "The channel for the new strip",
987 "The start frame for the new strip",
999 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1009 "The channel for the new strip",
1019 "The start frame for the new strip",
1031 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1033 parm =
RNA_def_string(func,
"filepath",
"File", 0,
"",
"Filepath to image");
1041 "The channel for the new strip",
1051 "The start frame for the new strip",
1060 "Mode for fitting the image to the canvas");
1069 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1071 parm =
RNA_def_string(func,
"filepath",
"File", 0,
"",
"Filepath to movie");
1079 "The channel for the new strip",
1089 "The start frame for the new strip",
1098 "Mode for fitting the image to the canvas");
1100 func,
"stream", 0, 0,
SHRT_MAX,
"Stream",
"Stream index for multi-stream files", 0, 20);
1109 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1111 parm =
RNA_def_string(func,
"filepath",
"File", 0,
"",
"Filepath to movie");
1119 "The channel for the new strip",
1129 "The start frame for the new strip",
1134 func,
"stream", 0, 0,
SHRT_MAX,
"Stream",
"Stream index for multi-stream files", 0, 20);
1143 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1151 "The channel for the new strip",
1161 "The start frame for the new strip",
1173 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"Name for the new strip");
1175 parm =
RNA_def_enum(func,
"type", strip_effect_items, 0,
"Type",
"type for the new strip");
1183 "The channel for the new strip",
1194 "The start frame for the new strip",
1204 "Length of the strip in frames, or the length of each strip if multiple are added",
1207 RNA_def_pointer(func,
"input1",
"Strip",
"",
"First input strip for effect");
1208 RNA_def_pointer(func,
"input2",
"Strip",
"",
"Second input strip for effect");
1217 parm =
RNA_def_pointer(func,
"sequence",
"Strip",
"",
"Strip to remove");
#define STRNCPY_UTF8(dst, src)
#define MEM_realloc_uninitialized(vmemh, len)
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
float4 load_data(StoredFloat4 data)
std::string filename(const std::string_view &str, size_t pos)
SeqRetimingKey * retiming_key_add_new_for_strip(const Scene *scene, ReportList *reports, Strip *strip, const int frame)
Strip * lookup_meta_by_strip(Editing *ed, const Strip *key)
Strip * add_effect_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
void relations_invalidate_cache(Scene *scene, Strip *strip)
Strip * add_image_strip(Main *bmain, Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
ListBaseT< Strip > * get_seqbase_by_strip(const Scene *scene, Strip *strip)
Strip * add_meta_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Editing * editing_get(const Scene *scene)
void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const char *filename)
void edit_remove_flagged_strips(Scene *scene, ListBaseT< Strip > *seqbase)
void add_image_set_directory(Strip *strip, const char *dirpath)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
void retiming_data_clear(Strip *strip)
constexpr int MAX_CHANNELS
Strip * add_sound_strip(Main *, Scene *, ListBaseT< Strip > *, LoadData *)
bool edit_move_strip_to_meta(Scene *scene, Strip *src_strip, Strip *dst_stripm, const char **r_error_str)
void add_image_init_alpha_mode(Main *bmain, Scene *scene, Strip *strip)
void edit_flag_for_removal(Scene *scene, Strip *strip)
Strip * add_movieclip_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Strip * add_scene_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Strip * edit_strip_split(Main *bmain, Scene *scene, ListBaseT< Strip > *seqbase, Strip *strip, const int timeline_frame, const eSplitMethod method, const bool ignore_connections, const char **r_error)
bool edit_strip_swap(Scene *scene, Strip *strip_a, Strip *strip_b, const char **r_error_str)
int effect_type_get_min_num_inputs(StripType type)
Strip * add_movie_strip(Main *bmain, Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
void strip_lookup_invalidate(const Editing *ed)
Strip * add_mask_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
void add_load_data_init(LoadData *load_data, const char *name, const char *path, const int start_frame, const int channel)
StripElem * render_give_stripelem(const Scene *scene, const Strip *strip, int timeline_frame)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
char * STRNCPY(char(&dst)[N], const char *src)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_api_strip_retiming_keys(BlenderRNA *brna)
@ STRIP_TYPE_GAUSSIAN_BLUR
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_api_strips(StructRNA *srna, bool metastrip)
@ SEQ_SINGLE_FRAME_CONTENT
void RNA_api_strip(StructRNA *srna)
const EnumPropertyItem rna_enum_strip_scale_method_items[]
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ ID_RECALC_SEQUENCER_STRIPS
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
@ SEQ_CACHE_STORE_FINAL_OUT
void DEG_relations_tag_update(Main *bmain)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_api_strip_elements(BlenderRNA *brna, PropertyRNA *cprop)