Blender V5.3
strip_add.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2003-2009 Blender Authors
3 * SPDX-FileCopyrightText: 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later */
6
10
11#include <algorithm>
12#include <cmath>
13#include <cstdint>
14#include <cstring>
15
16#include "MEM_guardedalloc.h"
17
18#include "DNA_mask_types.h"
19#include "DNA_scene_types.h"
20#include "DNA_sequence_types.h"
21#include "DNA_sound_types.h"
22#include "DNA_userdef_types.h"
23
24#include "BLI_math_base.hh"
25#include "BLI_path_utils.hh"
26#include "BLI_string.hh"
27#include "BLI_string_utf8.hh"
28
29#include "BKE_image.hh"
30#include "BKE_layer.hh"
31#include "BKE_lib_id.hh"
32#include "BKE_main.hh"
33#include "BKE_mask.hh"
34#include "BKE_movieclip.hh"
35#include "BKE_scene.hh"
36#include "BKE_sound.hh"
37
39
41#include "IMB_imbuf.hh"
42#include "IMB_imbuf_types.hh"
43
44#include "MOV_read.hh"
45
46#include "SEQ_add.hh"
47#include "SEQ_edit.hh"
48#include "SEQ_relations.hh"
49#include "SEQ_render.hh"
50#include "SEQ_sequencer.hh"
51#include "SEQ_time.hh"
52#include "SEQ_transform.hh"
53#include "SEQ_utils.hh"
54
56#include "effects/effects.hh"
57#include "multiview.hh"
58#include "proxy.hh"
59#include "strip_time.hh"
60#include "utils.hh"
61
62namespace blender::seq {
63
64int default_strip_length(const double scene_fps)
65{
66 return std::max(1, int(std::round(U.sequencer_default_strip_length * scene_fps)));
67}
68
70 const char *name,
71 const char *path,
72 const int start_frame,
73 const int channel)
74{
75 memset(load_data, 0, sizeof(LoadData));
76 if (name != nullptr) {
77 STRNCPY(load_data->name, name);
78 }
79 if (path != nullptr) {
80 STRNCPY(load_data->path, path);
81 }
82 load_data->start_frame = start_frame;
83 load_data->channel = channel;
84}
85
86static void strip_add_generic_update(Scene *scene, Strip *strip)
87{
88 strip_unique_name_set(scene, &scene->ed->seqbase, strip);
89 /* Set effect time range values before cache invalidation. */
90 strip_time_effect_range_set(scene, strip);
91 relations_invalidate_cache(scene, strip);
94}
95
96static void strip_add_set_name(Scene *scene, Strip *strip, LoadData *load_data)
97{
98 if (load_data->name[0] != '\0') {
99 edit_strip_name_set(scene, strip, load_data->name);
100 }
101 else {
102 if (strip->type == STRIP_TYPE_SCENE) {
103 edit_strip_name_set(scene, strip, load_data->scene->id.name + 2);
104 }
105 else if (strip->type == STRIP_TYPE_MOVIECLIP) {
106 edit_strip_name_set(scene, strip, load_data->clip->id.name + 2);
107 }
108 else if (strip->type == STRIP_TYPE_MASK) {
109 edit_strip_name_set(scene, strip, load_data->mask->id.name + 2);
110 }
111 else if (strip->is_effect()) {
112 edit_strip_name_set(scene, strip, strip_give_name(strip));
113 }
114 else { /* Image, sound and movie. */
115 edit_strip_name_set(scene, strip, load_data->name);
116 }
117 }
118}
119
121{
122 const char *strip_colorspace = strip->data->colorspace_settings.name;
123
125 const char *role_colorspace_byte;
127
128 if (STREQ(strip_colorspace, role_colorspace_byte)) {
131 const char *default_view_transform =
133 STRNCPY_UTF8(scene->view_settings.view_transform, default_view_transform);
134 }
135 }
136}
137
138Strip *add_scene_strip(Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
139{
140 Strip *strip = strip_alloc(
141 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_SCENE);
142 strip->scene = load_data->scene;
143 strip->scene_view_layer_name = BLI_strdup(BKE_view_layer_default_render(strip->scene)->name);
144 strip->content_length_set(load_data->scene->r.efra - load_data->scene->r.sfra + 1);
145 id_us_ensure_real(id_cast<ID *>(load_data->scene));
146 strip_add_set_name(scene, strip, load_data);
147 strip_add_generic_update(scene, strip);
148 return strip;
149}
150
151Strip *add_movieclip_strip(Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
152{
153 Strip *strip = strip_alloc(
154 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_MOVIECLIP);
155 strip->clip = load_data->clip;
156 strip->content_length_set(BKE_movieclip_get_duration(load_data->clip));
157 id_us_ensure_real(id_cast<ID *>(load_data->clip));
158 strip_add_set_name(scene, strip, load_data);
159 strip_add_generic_update(scene, strip);
160 return strip;
161}
162
163Strip *add_mask_strip(Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
164{
165 Strip *strip = strip_alloc(seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_MASK);
166 strip->mask = load_data->mask;
167 strip->content_length_set(BKE_mask_get_duration(load_data->mask));
168 id_us_ensure_real(id_cast<ID *>(load_data->mask));
169 strip_add_set_name(scene, strip, load_data);
170 strip_add_generic_update(scene, strip);
171 return strip;
172}
173
174Strip *add_effect_strip(Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
175{
176 Strip *strip = strip_alloc(
177 seqbase, load_data->start_frame, load_data->channel, load_data->effect.type);
178
179 strip->flag |= SEQ_USE_EFFECT_DEFAULT_FADE;
181
182 const int min_inputs = effect_type_get_min_num_inputs(load_data->effect.type);
183 if (min_inputs != 0 || load_data->effect.type == STRIP_TYPE_COMPOSITOR) {
184 strip->input1 = load_data->effect.input1;
185 strip->input2 = load_data->effect.input2;
186 }
187
188 if (min_inputs == 1) {
189 strip->blend_mode = strip->input1->blend_mode;
190 strip->blend_opacity = strip->input1->blend_opacity;
191 }
192
193 if (strip->input1 == nullptr) {
194 strip->content_length_set(1); /* Effect is generator, set non zero length. */
195 strip->flag |= SEQ_SINGLE_FRAME_CONTENT;
196 strip->right_handle_set(scene, load_data->start_frame + load_data->effect.length);
197 }
198
199 strip_add_set_name(scene, strip, load_data);
200 strip_add_generic_update(scene, strip);
201
202 return strip;
203}
204
205void add_image_set_directory(Strip *strip, const char *dirpath)
206{
207 STRNCPY(strip->data->dirpath, dirpath);
208}
209
210void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const char *filename)
211{
212 StripElem *se = render_give_stripelem(scene, strip, strip->content_start() + strip_frame);
214}
215
216void add_image_init_alpha_mode(Main *bmain, Scene *scene, Strip *strip)
217{
218 if (strip->data && strip->data->stripdata) {
219 char filepath[FILE_MAX];
220 ImBuf *ibuf;
221
223 filepath, sizeof(filepath), strip->data->dirpath, strip->data->stripdata->filename);
224 BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &scene->id));
225
226 /* Initialize input color space. */
227 if (strip->type == STRIP_TYPE_IMAGE) {
229 filepath, ImBufFlags::Test | ImBufFlags::AlphaDetect, &strip->data->colorspace_settings);
230
231 /* Byte images are default to straight alpha, however sequencer
232 * works in pre-multiply space, so mark strip to be pre-multiplied first. */
233 strip->alpha_mode = SEQ_ALPHA_STRAIGHT;
234 if (ibuf) {
235 if (flag_is_set(ibuf->flags, ImBufFlags::AlphaPremul)) {
236 strip->alpha_mode = SEQ_ALPHA_PREMUL;
237 }
238
239 IMB_freeImBuf(ibuf);
240 }
241 }
242 }
243}
244
245Strip *add_image_strip(Main *bmain, Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
246{
247 Strip *strip = strip_alloc(
248 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_IMAGE);
249 strip->content_length_set(load_data->image.count);
250 StripData *data = strip->data;
251 data->stripdata = MEM_new_array<StripElem>(load_data->image.count, "stripelem");
252 data->stripdata_num = load_data->image.count;
253
254 if (strip->content_length() == 1) {
255 strip->flag |= SEQ_SINGLE_FRAME_CONTENT;
256 }
257
258 /* Multiview settings. */
259 if (load_data->use_multiview) {
260 strip->flag |= SEQ_USE_VIEWS;
261 strip->views_format = load_data->views_format;
262 }
263 if (load_data->stereo3d_format) {
264 strip->stereo3d_format = MEM_new<Stereo3dFormat>("strip stereo3d format");
265 *strip->stereo3d_format = *load_data->stereo3d_format;
266 }
267
268 /* Set initial scale based on load_data->fit_method. */
269 char file_path[FILE_MAX];
270 STRNCPY(file_path, load_data->path);
271 BLI_path_abs(file_path, ID_BLEND_PATH(bmain, &scene->id));
272
274 file_path, ImBufFlags::ByteData, &strip->data->colorspace_settings);
275 if (ibuf != nullptr) {
276 /* Set image resolution. Assume that all images in sequence are same size. This fields are only
277 * informative. */
278 StripElem *strip_elem = data->stripdata;
279 for (int i = 0; i < load_data->image.count; i++) {
280 strip_elem->orig_width = ibuf->x;
281 strip_elem->orig_height = ibuf->y;
282 strip_elem++;
283 }
284
285 set_scale_to_fit(strip, ibuf->x, ibuf->y, scene->r.xsch, scene->r.ysch, load_data->fit_method);
286 IMB_freeImBuf(ibuf);
287 }
288
289 /* Adjust starting length of strip from handle to handle.
290 * Note that this differs from the content `strip->len`, which is always 1 for single images. */
292 strip->right_handle_set(scene, load_data->start_frame + load_data->image.length);
293 }
294
296 strip_add_set_name(scene, strip, load_data);
297 strip_add_generic_update(scene, strip);
298
299 return strip;
300}
301
302#ifdef WITH_AUDASPACE
303
304Strip *add_sound_strip(Main *bmain, Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
305{
306 /* Handles relative paths. */
307 bSound *sound = BKE_sound_new_file_exists(bmain, load_data->path, load_data->stream_index);
308 SoundInfo info;
309 bool sound_loaded = BKE_sound_info_get(bmain, sound, &info);
310
311 if (!sound_loaded && !load_data->allow_invalid_file) {
312 BKE_id_free_us(bmain, sound);
313 return nullptr;
314 }
315
316 if (info.specs.channels == SOUND_CHANNELS_INVALID && !load_data->allow_invalid_file) {
317 BKE_id_free_us(bmain, sound);
318 return nullptr;
319 }
320
321 Strip *strip = strip_alloc(
322 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_SOUND);
323 strip->sound = sound;
324 strip->streamindex = load_data->stream_index;
325
326 /* We round the frame duration as the audio sample lengths usually does not
327 * line up with the video frames. Therefore we round this number to the
328 * nearest frame as the audio track usually overshoots or undershoots the
329 * end frame of the video by a little bit.
330 * See #47135 for under shoot example. */
331 strip->content_length_set(
332 std::max(1, int(round((info.length - sound->offset_time) * scene->frames_per_second()))));
333
334 StripData *data = strip->data;
335 /* We only need 1 element to store the filename. */
336 StripElem *se = data->stripdata = MEM_new<StripElem>("stripelem");
337 data->stripdata_num = 1;
339 load_data->path, data->dirpath, sizeof(data->dirpath), se->filename, sizeof(se->filename));
340
341 if (strip->sound != nullptr) {
342 if (load_data->flags & SEQ_LOAD_SOUND_MONO) {
343 strip->sound->flags |= SOUND_FLAGS_MONO;
344 }
345
346 if (load_data->flags & SEQ_LOAD_SOUND_CACHE) {
347 if (strip->sound) {
348 strip->sound->flags |= SOUND_FLAGS_CACHING;
349 }
350 }
351
352 /* Turn on Display Waveform by default. */
353 strip->flag |= SEQ_AUDIO_DRAW_WAVEFORM;
354
355 /* Turn on Preserve Pitch by default. */
356 strip->flag |= SEQ_AUDIO_PITCH_CORRECTION;
357 }
358
359 strip_add_set_name(scene, strip, load_data);
360 strip_add_generic_update(scene, strip);
361
362 return strip;
363}
364
365#else // WITH_AUDASPACE
366
368 Scene * /*scene*/,
369 ListBaseT<Strip> * /*seqbase*/,
370 LoadData * /*load_data*/)
371{
372 return nullptr;
373}
374#endif // WITH_AUDASPACE
375
376Strip *add_meta_strip(Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
377{
378 /* Allocate strip. */
379 Strip *strip_meta = strip_alloc(
380 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_META);
381
382 /* Set name. */
383 strip_add_set_name(scene, strip_meta, load_data);
384
385 /* Set frames start and length. */
386 strip_meta->start = load_data->start_frame;
387 strip_meta->content_length_set(1);
388
389 strip_add_generic_update(scene, strip_meta);
390
391 return strip_meta;
392}
393
394Strip *add_movie_strip(Main *bmain, Scene *scene, ListBaseT<Strip> *seqbase, LoadData *load_data)
395{
396 char filepath[sizeof(load_data->path)];
397 STRNCPY(filepath, load_data->path);
398 BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &scene->id));
399
400 ColorManagedColorspaceSettings colorspace_settings;
401 bool is_multiview_loaded = false;
402 const int totfiles = load_data->use_multiview ?
403 seq_multiview_num_files_get(scene, load_data->views_format) :
404 1;
405 Array<MovieReaderPtr> anim_arr(totfiles);
406
407 int orig_width = 0;
408 int orig_height = 0;
409
410 if (load_data->use_multiview && (load_data->views_format == R_IMF_VIEWS_INDIVIDUAL)) {
411 char prefix[FILE_MAX];
412 const char *ext = nullptr;
413 int64_t j = 0;
414
415 BKE_scene_multiview_view_prefix_get(scene, filepath, prefix, &ext);
416
417 if (prefix[0] != '\0') {
418 for (int i = 0; i < totfiles; i++) {
419 char filepath_view[FILE_MAX];
420
421 seq_multiview_name(scene, i, prefix, ext, filepath_view, sizeof(filepath_view));
422 /* Sequencer takes care of colorspace conversion of the result. The input is the best to be
423 * kept unchanged for the performance reasons. */
424 anim_arr[j].reset(
425 openanim(filepath_view, ImBufFlags::Zero, 0, true, &colorspace_settings));
426
427 if (anim_arr[j]) {
428 seq_anim_add_suffix(scene, anim_arr[j].get(), i);
429 j++;
430 }
431 }
432 is_multiview_loaded = true;
433 }
434 }
435
436 if (is_multiview_loaded == false) {
437 /* Sequencer takes care of colorspace conversion of the result. The input is the best to be
438 * kept unchanged for the performance reasons. */
439 anim_arr[0].reset(
440 openanim(filepath, ImBufFlags::Zero, load_data->stream_index, true, &colorspace_settings));
441 }
442
443 if (anim_arr[0] == nullptr && !load_data->allow_invalid_file) {
444 return nullptr;
445 }
446
447 float video_fps = 0.0f;
448 load_data->video_stream_start = 0.0;
449
450 if (anim_arr[0] != nullptr) {
451 short fps_num;
452 float fps_denom;
453 bool have_fps = MOV_get_fps_num_denom(anim_arr[0].get(), fps_num, fps_denom);
454 if (have_fps) {
455 video_fps = fps_num / fps_denom;
456 }
457
458 /* Adjust scene's frame rate settings to match. */
459 if (have_fps && (load_data->flags & SEQ_LOAD_MOVIE_SYNC_FPS)) {
460 scene->r.frs_sec = fps_num;
461 scene->r.frs_sec_base = fps_denom;
463 }
464
465 load_data->video_stream_start = MOV_get_start_offset_seconds(anim_arr[0].get());
466 }
467
468 Strip *strip = strip_alloc(
469 seqbase, load_data->start_frame, load_data->channel, STRIP_TYPE_MOVIE);
470 strip->streamindex = load_data->stream_index;
471
472 /* Multiview settings. */
473 if (load_data->use_multiview) {
474 strip->flag |= SEQ_USE_VIEWS;
475 strip->views_format = load_data->views_format;
476 }
477 if (load_data->stereo3d_format) {
478 strip->stereo3d_format = MEM_new<Stereo3dFormat>("strip stereo3d format");
479 *strip->stereo3d_format = *load_data->stereo3d_format;
480 }
481
482 if (anim_arr[0] != nullptr) {
483 strip->content_length_set(MOV_get_duration_frames(anim_arr[0].get()));
484
485 movie_metadata_set_from_reader(*strip, *anim_arr[0]);
486
487 /* Set initial scale based on load_data->fit_method. */
488 orig_width = MOV_get_image_width(anim_arr[0].get());
489 orig_height = MOV_get_image_height(anim_arr[0].get());
491 strip, orig_width, orig_height, scene->r.xsch, scene->r.ysch, load_data->fit_method);
492
493 float fps = MOV_get_fps(anim_arr[0].get());
494 if (fps > 0.0f) {
495 strip->media_playback_rate = fps;
496 }
497 }
498
499 strip->content_length_set(std::max(1, strip->content_length()));
500 if (load_data->adjust_playback_rate) {
501 strip->flag |= SEQ_AUTO_PLAYBACK_RATE;
502 }
503
504 strip->data->colorspace_settings = colorspace_settings;
505
506 StripData *data = strip->data;
507 /* We only need 1 element for MOVIE strips. */
508 StripElem *se;
509 data->stripdata = se = MEM_new<StripElem>("stripelem");
510 data->stripdata_num = 1;
511 data->stripdata->orig_width = orig_width;
512 data->stripdata->orig_height = orig_height;
513 data->stripdata->orig_fps = video_fps;
515 load_data->path, data->dirpath, sizeof(data->dirpath), se->filename, sizeof(se->filename));
516
518 strip_add_set_name(scene, strip, load_data);
519 strip_add_generic_update(scene, strip);
520
521 return strip;
522}
523
525 Main *bmain, Scene *scene, Strip *strip, const bool lock_range, const bool source_changed)
526{
527 int prev_start_frame = 0, prev_end_frame = 0;
528 /* NOTE: don't rename the strip, will break animation curves. */
529
530 if (ELEM(strip->type,
537 STRIP_TYPE_MASK) == 0)
538 {
539 return;
540 }
541
542 if (lock_range) {
543 /* keep so we don't have to move the actual start and end points (only the data) */
544 prev_start_frame = strip->left_handle();
545 prev_end_frame = strip->right_handle(scene);
546 }
547
548 switch (strip->type) {
549 case STRIP_TYPE_IMAGE: {
550 int new_len = strip->data->stripdata_num;
551 new_len -= strip->anim_startofs;
552 new_len -= strip->anim_endofs;
553 new_len = std::max(new_len, 0);
554 strip->content_length_set(new_len);
555 break;
556 }
557 case STRIP_TYPE_MOVIE: {
558 if (source_changed) {
559 /* The file may have changed on disk without changing the cache key. */
560 movie_reader_cache_invalidate(*scene, *strip);
562 }
564 if (!reader) {
565 return;
566 }
567
568 if (source_changed) {
569 movie_metadata_set_from_reader(*strip, *reader.reader());
570 }
571
572 int new_len = MOV_get_duration_frames(reader.reader());
573
574 new_len -= strip->anim_startofs;
575 new_len -= strip->anim_endofs;
576 new_len = std::max(new_len, 0);
577 strip->content_length_set(new_len);
578 break;
579 }
581 if (strip->clip == nullptr) {
582 return;
583 }
584
585 int new_len = BKE_movieclip_get_duration(strip->clip);
586
587 new_len -= strip->anim_startofs;
588 new_len -= strip->anim_endofs;
589 new_len = std::max(new_len, 0);
590 strip->content_length_set(new_len);
591 break;
592 }
593 case STRIP_TYPE_MASK: {
594 if (strip->mask == nullptr) {
595 return;
596 }
597 int new_len = BKE_mask_get_duration(strip->mask);
598 new_len -= strip->anim_startofs;
599 new_len -= strip->anim_endofs;
600 new_len = std::max(new_len, 0);
601 strip->content_length_set(new_len);
602 break;
603 }
604 case STRIP_TYPE_SOUND: {
605#ifdef WITH_AUDASPACE
606 if (!strip->sound) {
607 return;
608 }
609 int new_len = ceil(double(BKE_sound_get_length(bmain, strip->sound)) *
610 scene->frames_per_second());
611 new_len -= strip->anim_startofs;
612 new_len -= strip->anim_endofs;
613 new_len = std::max(new_len, 0);
614 strip->content_length_set(new_len);
615#else
616 UNUSED_VARS(bmain);
617 return;
618#endif
619 break;
620 }
621 case STRIP_TYPE_SCENE: {
622 int new_len = (strip->scene) ? strip->scene->r.efra - strip->scene->r.sfra + 1 : 0;
623 new_len -= strip->anim_startofs;
624 new_len -= strip->anim_endofs;
625 new_len = std::max(new_len, 0);
626 strip->content_length_set(new_len);
627 break;
628 }
629 default:
630 break;
631 }
632
633 if (source_changed) {
634 free_strip_proxy(strip);
635 }
636
637 if (lock_range) {
638 strip->handles_set(scene, prev_start_frame, prev_end_frame);
639 }
640
641 relations_invalidate_cache_raw(scene, strip);
642}
643
644void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, const bool lock_range)
645{
646 add_reload_new_file_impl(bmain, scene, strip, lock_range, true);
647}
648
649void add_update_content_length(Main *bmain, Scene *scene, Strip *strip)
650{
651 add_reload_new_file_impl(bmain, scene, strip, false, false);
652}
653
655 Main *bmain, Scene *scene, Strip *strip, bool *r_was_reloaded, bool *r_can_produce_frames)
656{
658 "This function is only implemented for movie strips.");
659
660 if (movie_reader_cache_can_produce_frames(*scene, *strip)) {
661 /* All good! */
662 *r_was_reloaded = false;
663 *r_can_produce_frames = true;
664 return;
665 }
666
667 add_reload_new_file(bmain, scene, strip, true);
668 *r_was_reloaded = true;
669 *r_can_produce_frames = movie_reader_cache_can_produce_frames(*scene, *strip);
670}
671
672} // namespace blender::seq
#define FILE_MAX
#define BLI_path_join(...)
#define STRNCPY_UTF8(dst, src)
#define ID_BLEND_PATH(_bmain, _id)
Definition DNA_ID.h:688
Read Blender memory allocation and freeing.
#define UNUSED_VARS(...)
#define ELEM(...)
#define BLI_assert_msg(a, msg)
#define STREQ(a, b)
const T & data(const Action &owning_action) const
float4 load_data(StoredFloat4 data)
#define round
#define ceil
std::string filename(const std::string_view &str, size_t pos)
Strip * lookup_meta_by_strip(Editing *ed, const Strip *key)
void add_movie_reload_if_needed(Main *bmain, Scene *scene, Strip *strip, bool *r_was_reloaded, bool *r_can_produce_frames)
Definition strip_add.cc:654
void effect_ensure_initialized(Strip *strip)
Definition effects.cc:137
Strip * add_effect_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:174
void relations_invalidate_cache(Scene *scene, Strip *strip)
void seq_multiview_name(const Scene *scene, const int view_id, const char *prefix, const char *ext, char *r_path, size_t r_path_maxncpy)
Definition multiview.cc:43
Strip * add_image_strip(Main *bmain, Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:245
void strip_unique_name_set(Scene *scene, ListBaseT< Strip > *seqbasep, Strip *strip)
static void strip_add_generic_update(Scene *scene, Strip *strip)
Definition strip_add.cc:86
Strip * add_meta_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:376
void edit_strip_name_set(Scene *scene, Strip *strip, const char *new_name)
void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const char *filename)
Definition strip_add.cc:210
void add_image_set_directory(Strip *strip, const char *dirpath)
Definition strip_add.cc:205
MovieReaderAccessor movie_reader_cache_acquire_any(const Scene &scene, const Strip &strip)
const char * strip_give_name(const Strip *strip)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
void movie_reader_cache_invalidate(Scene &scene, const Strip &strip)
static void strip_add_set_view_transform(Scene *scene, Strip *strip, LoadData *load_data)
Definition strip_add.cc:120
bool transform_single_image_check(const Strip *strip)
void movie_metadata_invalidate(Strip &strip)
void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, const bool lock_range)
Definition strip_add.cc:644
void time_update_meta_strip_range(const Scene *scene, Strip *strip_meta)
Strip * add_sound_strip(Main *, Scene *, ListBaseT< Strip > *, LoadData *)
Definition strip_add.cc:367
int seq_multiview_num_files_get(const Scene *scene, eImageFormat_ViewsFormat views_format)
Definition multiview.cc:29
void add_image_init_alpha_mode(Main *bmain, Scene *scene, Strip *strip)
Definition strip_add.cc:216
Strip * strip_alloc(ListBaseT< Strip > *lb, int timeline_frame, int channel, StripType type)
Definition sequencer.cc:131
Strip * add_movieclip_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:151
Strip * add_scene_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:138
void free_strip_proxy(Strip *strip)
Definition proxy.cc:794
void movie_metadata_set_from_reader(Strip &strip, MovieReader &reader)
static void strip_add_set_name(Scene *scene, Strip *strip, LoadData *load_data)
Definition strip_add.cc:96
@ SEQ_LOAD_SOUND_MONO
Definition SEQ_add.hh:38
@ SEQ_LOAD_SET_VIEW_TRANSFORM
Definition SEQ_add.hh:40
@ SEQ_LOAD_SOUND_CACHE
Definition SEQ_add.hh:37
@ SEQ_LOAD_MOVIE_SYNC_FPS
Definition SEQ_add.hh:39
void add_update_content_length(Main *bmain, Scene *scene, Strip *strip)
Definition strip_add.cc:649
static void add_reload_new_file_impl(Main *bmain, Scene *scene, Strip *strip, const bool lock_range, const bool source_changed)
Definition strip_add.cc:524
int effect_type_get_min_num_inputs(StripType type)
Definition effects.cc:347
void seq_anim_add_suffix(Scene *scene, MovieReader *anim, const int view_id)
Definition multiview.cc:23
Strip * add_movie_strip(Main *bmain, Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:394
void strip_lookup_invalidate(const Editing *ed)
bool movie_reader_cache_can_produce_frames(const Scene &scene, const Strip &strip)
Strip * add_mask_strip(Scene *scene, ListBaseT< Strip > *seqbase, LoadData *load_data)
Definition strip_add.cc:163
void add_load_data_init(LoadData *load_data, const char *name, const char *path, const int start_frame, const int channel)
Definition strip_add.cc:69
int default_strip_length(const double scene_fps)
Definition strip_add.cc:64
void set_scale_to_fit(const Strip *strip, const int image_width, const int image_height, const int preview_width, const int preview_height, const eSeqImageFitMethod fit_method)
StripElem * render_give_stripelem(const Scene *scene, const Strip *strip, int timeline_frame)
Definition render.cc:220
void strip_time_effect_range_set(const Scene *scene, Strip *strip)
UserDef U
Definition blender.cc:58
__int64 int64_t
Definition BKE_text.h:90
char * STRNCPY(char(&dst)[N], const char *src)
@ SOUND_CHANNELS_INVALID
Definition BKE_sound.hh:60
@ SOUND_FLAGS_CACHING
void BKE_id_free_us(Main *bmain, void *idv) ATTR_NONNULL()
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
const char * IMB_colormanagement_display_get_default_view_transform_name(const ColorManagedDisplay *display)
int MOV_get_image_height(const MovieReader *anim)
int MOV_get_image_width(const MovieReader *anim)
bool MOV_get_fps_num_denom(const MovieReader *anim, short &r_fps_num, float &r_fps_denom)
bSound * BKE_sound_new_file_exists(Main *bmain, const char *filepath, short stream_index=0)
bool BKE_sound_info_get(Main *main, bSound *sound, SoundInfo *sound_info)
int BKE_mask_get_duration(Mask *mask)
ImBuf * IMB_load_image_from_filepath(const char *filepath, ImBufFlags flags, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
Definition readimage.cc:201
void IMB_freeImBuf(ImBuf *ibuf)
void DEG_id_tag_update(ID *id, unsigned int flags)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
BMesh const char void * data
float BKE_sound_get_length(Main *bmain, bSound *sound)
@ SEQ_USE_EFFECT_DEFAULT_FADE
@ SEQ_AUDIO_PITCH_CORRECTION
MovieReader * openanim(const char *filepath, ImBufFlags ibuf_flags, int streamindex, bool keep_original_colorspace, ColorManagedColorspaceSettings *colorspace_settings)
double MOV_get_start_offset_seconds(const MovieReader *anim)
void id_us_ensure_real(ID *id)
Definition lib_id.cc:388
int BKE_movieclip_get_duration(MovieClip *clip)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
@ ID_RECALC_AUDIO_FPS
Definition DNA_ID.h:1127
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1122
float MOV_get_fps(const MovieReader *anim)
@ R_IMF_VIEWS_INDIVIDUAL
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
int MOV_get_duration_frames(const MovieReader *anim)
ViewLayer * BKE_view_layer_default_render(const Scene *scene)
void BKE_scene_multiview_view_prefix_get(const Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
Definition scene.cc:3417
ocio::Display ColorManagedDisplay
ListBaseT< Strip > seqbase
struct Editing * ed
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
struct RenderData r
struct blender::SoundInfo::@227301210053207103375114031212057322370226174015 specs
float length() const
Definition sky_math.h:294