Blender V5.3
sequencer_clipboard.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 <cstring>
13#include <limits>
14
16#include "BLO_readfile.hh"
17#include "MEM_guardedalloc.h"
18
19#include "ED_outliner.hh"
20#include "ED_sequencer.hh"
21
22#include "DNA_anim_types.h"
23#include "DNA_scene_types.h"
24#include "DNA_sequence_types.h"
25#include "DNA_space_types.h"
27
28#include "BLI_listbase.hh"
29#include "BLI_path_utils.hh"
30
31#include "BKE_anim_data.hh"
32#include "BKE_animsys.hh"
33#include "BKE_appdir.hh"
35#include "BKE_blendfile.hh"
36#include "BKE_context.hh"
37#include "BKE_fcurve.hh"
38#include "BKE_lib_id.hh"
39#include "BKE_lib_query.hh"
40#include "BKE_main.hh"
41#include "BKE_report.hh"
42#include "BKE_scene.hh"
43
44#include "SEQ_animation.hh"
45#include "SEQ_iterator.hh"
46#include "SEQ_relations.hh"
47#include "SEQ_select.hh"
48#include "SEQ_sequencer.hh"
49#include "SEQ_time.hh"
50#include "SEQ_transform.hh"
51#include "SEQ_utils.hh"
52
53#include "DEG_depsgraph.hh"
55
56#include "ANIM_action.hh"
57#include "ANIM_animdata.hh"
58
59#include "UI_view2d.hh"
60#include "WM_api.hh"
61#include "WM_types.hh"
62
63#include "sequencer_intern.hh"
64
65namespace blender::ed::vse {
66
67using namespace bke::blendfile;
68
69/* -------------------------------------------------------------------- */
70/* Copy Operator Helper functions
71 */
72
74 Strip *strip_dst,
75 ListBaseT<FCurve> *clipboard_dst,
76 ListBaseT<FCurve> *fcurve_base_src)
77{
78 /* Add curves for strips inside meta strip. */
79 if (strip_dst->type == STRIP_TYPE_META) {
80 for (Strip &meta_child : strip_dst->seqbase) {
81 sequencer_copy_animation_listbase(scene_src, &meta_child, clipboard_dst, fcurve_base_src);
82 }
83 }
84
86 *fcurve_base_src,
87 [&](const FCurve &fcurve) { return seq::fcurve_matches(*strip_dst, fcurve); });
88
89 for (FCurve *fcu_src : fcurves_src) {
90 BLI_addtail(clipboard_dst, BKE_fcurve_copy(fcu_src));
91 }
92}
93
94/* This is effectively just a copy of `sequencer_copy_animation_listbase()`
95 * above, except that it copies from an action's animation to a vector rather
96 * than between two listbases. */
98 Strip *strip_dst,
99 Vector<FCurve *> &clipboard_dst,
100 bAction &fcurves_src_action,
101 animrig::slot_handle_t fcurves_src_slot_handle)
102{
103 /* Add curves for strips inside meta strip. */
104 if (strip_dst->type == STRIP_TYPE_META) {
105 for (Strip &meta_child : strip_dst->seqbase) {
107 scene_src, &meta_child, clipboard_dst, fcurves_src_action, fcurves_src_slot_handle);
108 }
109 }
110
112 &fcurves_src_action, fcurves_src_slot_handle, [&](const FCurve &fcurve) {
113 return seq::fcurve_matches(*strip_dst, fcurve);
114 });
115
116 for (FCurve *fcu_src : fcurves_src) {
117 FCurve *fcu_copy = BKE_fcurve_copy(fcu_src);
118
119 /* Handling groups properly requires more work, so for now just ignore them. */
120 fcu_copy->grp = nullptr;
121
122 clipboard_dst.append(fcu_copy);
123 }
124}
125
126static void sequencer_copy_animation(Scene *scene_src,
127 Vector<FCurve *> &fcurves_dst,
128 ListBaseT<FCurve> *drivers_dst,
129 Strip *strip_dst)
130{
131 if (seq::animation_keyframes_exist(scene_src)) {
133 scene_src, strip_dst, fcurves_dst, *scene_src->adt->action, scene_src->adt->slot_handle);
134 }
135 if (seq::animation_drivers_exist(scene_src)) {
136 sequencer_copy_animation_listbase(scene_src, strip_dst, drivers_dst, &scene_src->adt->drivers);
137 }
138}
139
140static void sequencer_copybuffer_filepath_get(char filepath[FILE_MAX], size_t filepath_maxncpy)
141{
142 BLI_path_join(filepath, filepath_maxncpy, BKE_tempdir_base(), "copybuffer_vse.blend");
143}
144
146 Scene *scene_src,
147 const char *filepath,
148 ReportList &reports)
149
150{
151 /* NOTE: Setting the same current file path as G_MAIN is necessary for now to get correct
152 * external filepaths when writing the partial write context on disk. otherwise, filepaths from
153 * the scene's sequencer strips (e.g. image ones) would also need to be remapped in this code. */
154 PartialWriteContext copy_buffer{*bmain_src};
155 const char *scene_name = "copybuffer_vse_scene";
156
157 /* Add a dummy empty scene to the temporary Main copy buffer. */
158 Scene *scene_dst = reinterpret_cast<Scene *>(
159 copy_buffer.id_create(ID_SCE,
160 scene_name,
161 nullptr,
162 {(PartialWriteContext::IDAddOperations::SET_FAKE_USER |
163 PartialWriteContext::IDAddOperations::SET_CLIPBOARD_MARK)}));
164
165 /* Create an empty sequence editor data to store all copied strips. */
166 scene_dst->ed = MEM_new<Editing>(__func__);
168 scene_src,
169 scene_dst,
170 &scene_dst->ed->seqbase,
171 scene_src->ed->current_strips(),
173 0);
174
175 BLI_duplicatelist(&scene_dst->ed->channels, &scene_src->ed->channels);
176
177 /* Save current frame and active strip. */
178 scene_dst->r.cfra = scene_src->r.cfra;
179 Strip *active_seq_src = seq::select_active_get(scene_src);
180 if (active_seq_src) {
181 Strip *strip_dst = static_cast<Strip *>(
182 BLI_findstring(&scene_dst->ed->seqbase, active_seq_src->name, offsetof(Strip, name)));
183 if (strip_dst) {
184 seq::select_active_set(scene_dst, strip_dst);
185 }
186 }
187
188 Vector<FCurve *> fcurves_dst = {};
189 ListBaseT<FCurve> drivers_dst = {nullptr, nullptr};
190 for (Strip &strip_dst : scene_dst->ed->seqbase) {
191 /* Copy any fcurves/drivers from `scene_src` that are relevant to `strip_dst`. */
192 sequencer_copy_animation(scene_src, fcurves_dst, &drivers_dst, &strip_dst);
193 }
194
195 BLI_assert(scene_dst->adt == nullptr);
196
197 /* Copy over the fcurves. */
198 if (!fcurves_dst.is_empty()) {
199 scene_dst->adt = BKE_animdata_ensure_id(&scene_dst->id);
200 animrig::Action &action_dst =
201 reinterpret_cast<bAction *>(
202 copy_buffer.id_create(
203 ID_AC, scene_name, nullptr, {PartialWriteContext::IDAddOperations::SET_FAKE_USER}))
204 ->wrap();
205
206 /* If we're copying from a layered action, also ensure a connected slot. */
207 animrig::Slot *slot = animrig::assign_action_ensure_slot_for_keying(action_dst, scene_dst->id);
208 if (slot == nullptr) {
209 return false;
210 }
211
212 for (FCurve *fcurve : fcurves_dst) {
214 scene_dst->adt->slot_handle,
215 *fcurve,
216 fcurve->grp ? std::optional(fcurve->grp->name) : std::nullopt);
217 }
218 }
219
220 /* Copy over the drivers. */
221 if (!BLI_listbase_is_empty(&drivers_dst)) {
222 scene_dst->adt = BKE_animdata_ensure_id(&scene_dst->id);
223 BLI_movelisttolist(&scene_dst->adt->drivers, &drivers_dst);
224 }
225
226 /* Only add to the paste buffer some dependency ID types. For example, scenes are ignored/cleared
227 * (how to copy and paste scene strips is not clear currently).
228 */
229 /* NOTE: since a special Scene root ID needs to be forged for the VSE copy/paste (instead of
230 * directly using the current scene and adding it to the paste buffer), the first level of
231 * dependencies (IDs directly used by the scene) need to be processed manually here.
232 *
233 * All other indirect dependencies will then be handled automatically by the partial write
234 * context code.
235 */
236#define VSE_COPYBUFFER_IDTYPES ID_SO, ID_MC, ID_IM, ID_TXT, ID_VF, ID_AC, ID_NT, ID_MSK
237 auto add_scene_ids_dependencies_cb = [&copy_buffer,
238 scene_dst](LibraryIDLinkCallbackData *cb_data) -> int {
239 ID *id_src = *cb_data->id_pointer;
240
241 /* Embedded or null IDs usages can be ignored here. */
242 if (cb_data->cb_flag & (IDWALK_CB_EMBEDDED | IDWALK_CB_EMBEDDED_NOT_OWNING)) {
243 return IDWALK_RET_NOP;
244 }
245 if (!id_src) {
246 return IDWALK_RET_NOP;
247 }
248
249 /* The Action ID of the destination scene has already been added (created actually) in the copy
250 * buffer. This is necessary to ensure that only the relevant sequencer-related animation data
251 * is copied into the destination paste buffer, and not the whole scene's animation. See the
252 * code around the call to #sequencer_copy_animation above.
253 *
254 * So trying to add it again here would lead to serious issues. */
255 if (scene_dst->adt && scene_dst->adt->action == reinterpret_cast<bAction *>(id_src)) {
256 BLI_assert(GS(id_src->name) == ID_AC);
257 return IDWALK_RET_NOP;
258 }
259
260 ID *id_dst = nullptr;
261 const ID_Type id_type = id_src->id_type();
262 /* Only add (and follow) IDs which usage is marked as 'never null', or are from following
263 * types: #bSound, #MovieClip, #Image, #Text, #VFont, #bAction, #bNodeTree, #Mask. */
264 if (ELEM(id_type, VSE_COPYBUFFER_IDTYPES) || (cb_data->cb_flag & IDWALK_CB_NEVER_NULL)) {
265 /* The partial write context handle dependencies of ID added to it. This callback will tell
266 * it whether a given dependency ID should be skipped/cleared, or also added in the context.
267 */
268 auto partial_write_dependencies_filter_cb = [](LibraryIDLinkCallbackData *cb_deps_data,
271 ID *id_deps_src = *cb_deps_data->id_pointer;
272 const ID_Type id_type = id_deps_src->id_type();
273 if (ELEM(id_type, VSE_COPYBUFFER_IDTYPES) ||
274 (cb_deps_data->cb_flag & IDWALK_CB_NEVER_NULL))
275 {
276 return PartialWriteContext::IDAddOperations::ADD_DEPENDENCIES;
277 }
278 return PartialWriteContext::IDAddOperations::CLEAR_DEPENDENCIES;
279 };
280 id_dst = copy_buffer.id_add(id_src,
281 {PartialWriteContext::IDAddOperations::NOP},
282 partial_write_dependencies_filter_cb);
283 }
284 *cb_data->id_pointer = id_dst;
285 return IDWALK_RET_NOP;
286 };
288 nullptr, &scene_dst->id, add_scene_ids_dependencies_cb, nullptr, IDWALK_NOP);
289#undef VSE_COPYBUFFER_IDTYPES
290
291 BLI_assert(copy_buffer.is_valid());
292
293 const bool retval = copy_buffer.write_as_copypaste_buffer(filepath, reports);
294
295 return retval;
296}
297
299{
300 Main *bmain = CTX_data_main(C);
302 Editing *ed = seq::editing_get(scene);
303
304 VectorSet<Strip *> selected = seq::query_selected_strips(ed->current_strips());
305
306 if (selected.is_empty()) {
307 return OPERATOR_CANCELLED;
308 }
309
310 VectorSet<Strip *> effect_chain;
311 effect_chain.add_multiple(selected);
313
314 VectorSet<Strip *> expanded;
315 for (Strip *strip : effect_chain) {
316 if (!(strip->flag & SEQ_SELECT)) {
317 strip->flag |= SEQ_SELECT;
318 expanded.add(strip);
319 }
320 }
321
322 char filepath[FILE_MAX];
323 sequencer_copybuffer_filepath_get(filepath, sizeof(filepath));
324 bool success = sequencer_write_copy_paste_file(bmain, scene, filepath, *op->reports);
325 if (!success) {
326 BKE_report(op->reports, RPT_ERROR, "Could not create the copy paste file!");
327 for (Strip *strip : expanded) {
328 strip->flag &= ~SEQ_SELECT;
329 }
330 return OPERATOR_CANCELLED;
331 }
332
333 /* We are all done! */
334 if (effect_chain.size() > selected.size()) {
336 RPT_INFO,
337 "Copied the selected Video Sequencer strips and associated effect chain to "
338 "internal clipboard");
339 }
340 else {
342 op->reports, RPT_INFO, "Copied the selected Video Sequencer strips to internal clipboard");
343 }
346 return OPERATOR_FINISHED;
347}
348
349/* -------------------------------------------------------------------- */
350/* Paste Operator Helper functions
351 */
352
353static bool sequencer_paste_animation(Main *bmain_dst, Scene *scene_dst, Scene *scene_src)
354{
355 if (!seq::animation_keyframes_exist(scene_src) && !seq::animation_drivers_exist(scene_src)) {
356 return false;
357 }
358
359 bAction *act_dst = animrig::id_action_ensure(bmain_dst, &scene_dst->id);
360
362 scene_dst->id);
363 BLI_assert(slot != nullptr);
364 if (slot == nullptr) {
365 return false;
366 }
367
368 for (FCurve *fcu : animrig::fcurves_for_assigned_action(scene_src->adt)) {
369 animrig::action_fcurve_attach(act_dst->wrap(),
370 scene_dst->adt->slot_handle,
371 *BKE_fcurve_copy(fcu),
372 fcu->grp ? std::optional(fcu->grp->name) : std::nullopt);
373 }
374 for (FCurve &fcu : scene_src->adt->drivers) {
375 BLI_addtail(&scene_dst->adt->drivers, BKE_fcurve_copy(&fcu));
376 }
377
378 return true;
379}
380
382 wmOperator *op,
383 const wmEvent *event)
384{
385 RNA_int_set(op->ptr, "x", event->mval[0]);
386 RNA_int_set(op->ptr, "y", event->mval[1]);
388}
389
391{
392 Main *bmain_dst = CTX_data_main(C);
393
394 char filepath[FILE_MAX];
395 sequencer_copybuffer_filepath_get(filepath, sizeof(filepath));
396 Main *bmain_src = BKE_copybuffer_read(*bmain_dst, filepath, op->reports, FILTER_ID_SCE);
397 if (!bmain_src) {
398 BKE_report(op->reports, RPT_ERROR, "No data to paste");
399 return OPERATOR_CANCELLED;
400 }
401
402 const int mval[2] = {RNA_int_get(op->ptr, "x"), RNA_int_get(op->ptr, "y")};
403 float2 view_mval;
406 ui::view2d_region_to_view(v2d, mval[0], mval[1], &view_mval[0], &view_mval[1]);
407
408 /* For checking if region type is Preview. */
409 ARegion *region = CTX_wm_region(C);
410
411 Scene *scene_src = nullptr;
412 /* Find the scene we pasted that contains the strips. It should be tagged. */
413 for (Scene &scene_iter : bmain_src->scenes) {
414 if (scene_iter.id.flag & ID_FLAG_CLIPBOARD_MARK) {
415 scene_src = &scene_iter;
416 break;
417 }
418 }
419
420 if (!scene_src || !scene_src->ed) {
421 BKE_report(op->reports, RPT_ERROR, "No clipboard scene to paste Video Sequencer data from");
422 BKE_main_free(bmain_src);
423 return OPERATOR_CANCELLED;
424 }
425
426 const int num_strips_to_paste = scene_src->ed->seqbase.count();
427 if (num_strips_to_paste == 0) {
428 BKE_report(op->reports, RPT_INFO, "No strips to paste");
429 BKE_main_free(bmain_src);
430 return OPERATOR_CANCELLED;
431 }
432
433 Scene *scene_dst = CTX_data_sequencer_scene(C);
434 Editing *ed_dst = seq::editing_ensure(scene_dst); /* Creates "ed" if it's missing. */
435 int ofs;
436
437 deselect_all_strips(scene_dst);
438 if (RNA_boolean_get(op->ptr, "keep_offset") || (region->regiontype == RGN_TYPE_PREVIEW)) {
439 ofs = scene_dst->r.cfra - scene_src->r.cfra;
440 }
441 else {
442 int min_seq_startdisp = std::numeric_limits<int>::max();
443 for (Strip &strip : scene_src->ed->seqbase) {
444 min_seq_startdisp = std::min(strip.left_handle(), min_seq_startdisp);
445 }
446 /* Paste strips relative to the current-frame. */
447 ofs = scene_dst->r.cfra - min_seq_startdisp;
448 }
449
450 Strip *prev_active_seq = seq::select_active_get(scene_src);
451 std::string active_seq_name;
452 if (prev_active_seq) {
453 active_seq_name.assign(prev_active_seq->name);
454 }
455
456 /* Make sure we have all data IDs we need in bmain_dst. Remap the IDs if we already have them.
457 * This has to happen BEFORE we move the strip over to scene_dst. their ID mapping will not be
458 * correct otherwise. */
459 MainMergeReport merge_reports = {};
460 /* We need to ensure that the source 'clipboard marked' main Scene is always merged into
461 * destination Main, even in case there would be a name collision with an existing ID (see also
462 * #158049). */
463 Set<ID *> force_merge_ids = {id_cast<ID *>(scene_src)};
464 /* NOTE: BKE_main_merge will free bmain_src! */
465 BKE_main_merge(bmain_dst, &force_merge_ids, &bmain_src, merge_reports);
466
467 /* Paste animation.
468 * NOTE: Only fcurves and drivers are copied. NLA action strips are not copied.
469 * First backup original curves from scene and move curves from clipboard into scene. This way,
470 * when pasted strips are renamed, pasted fcurves are renamed with them. Finally restore original
471 * curves from backup.
472 */
473 seq::AnimationBackup animation_backup = {};
474 seq::animation_backup_original(scene_dst, &animation_backup);
475 bool has_animation = sequencer_paste_animation(bmain_dst, scene_dst, scene_src);
476
477 ListBaseT<Strip> nseqbase = {nullptr, nullptr};
478 /* NOTE: seq::seqbase_duplicate_recursive() takes care of generating
479 * new UIDs for sequences in the new list. */
481 scene_src,
482 scene_dst,
483 &nseqbase,
484 &scene_src->ed->seqbase,
486 0);
487
488 /* BKE_main_merge will copy the scene_src and its action into bmain_dst. Remove them as
489 * we merge the data from these manually.
490 */
491 if (has_animation && scene_src->adt->action != nullptr) {
492 BKE_id_delete(bmain_dst, scene_src->adt->action);
493 }
494 BKE_id_delete(bmain_dst, scene_src);
495
496 Strip *iseq_first = nseqbase.first();
497 BLI_movelisttolist(ed_dst->current_strips(), &nseqbase);
498 /* Restore "first" pointer as BLI_movelisttolist sets it to nullptr */
499 nseqbase.first_ = iseq_first;
500
501 int2 strip_mean_pos = {0, 0};
502 int image_strip_count = 0;
503 for (Strip &istrip : nseqbase) {
504 if (istrip.name == active_seq_name) {
505 seq::select_active_set(scene_dst, &istrip);
506 }
507 /* Make sure, that pasted strips have unique names. This has to be done after
508 * adding strips to seqbase, for lookup cache to work correctly. */
509 seq::ensure_unique_name(&istrip, scene_dst, {});
510
511 if (region->regiontype == RGN_TYPE_PREVIEW && istrip.type != STRIP_TYPE_SOUND &&
513 {
514 strip_mean_pos += static_cast<int2>(
516 image_strip_count++;
517 }
518 }
519
520 if (image_strip_count > 0) {
521 strip_mean_pos /= image_strip_count;
522 }
523
524 VectorSet<Strip *> pasted_strips;
525 for (Strip &istrip : nseqbase) {
526 /* Place strips that generate an image at the mouse cursor. */
527 if (region->regiontype == RGN_TYPE_PREVIEW && !RNA_boolean_get(op->ptr, "keep_offset") &&
528 istrip.type != STRIP_TYPE_SOUND &&
530 {
531 StripTransform *transform = istrip.data->transform;
532 const float2 mirror = seq::image_transform_mirror_factor_get(&istrip);
533 const float2 origin = seq::image_transform_origin_preview_offset_get(scene, &istrip);
534 transform->xofs = (view_mval[0] - (strip_mean_pos[0] - origin[0])) * mirror[0];
535 transform->yofs = (view_mval[1] - (strip_mean_pos[1] - origin[1])) * mirror[1];
536 seq::relations_invalidate_cache(scene, &istrip);
537 }
538 /* Translate after name has been changed, otherwise this will affect animdata of original
539 * strip. */
540 seq::transform_translate_strip(scene_dst, &istrip, ofs);
541 pasted_strips.add(&istrip);
542 }
543
544 /* Ensure that pasted strips don't overlap. */
545 ScrArea *area = CTX_wm_area(C);
546 const bool use_sync_markers = ((area->spacedata.first_as<SpaceSeq>())->flag &
547 SEQ_MARKER_TRANS) != 0;
549 seq::transform_shuffle_vertical(ed_dst->current_strips(), pasted_strips, scene_dst);
550 }
551 else {
553 scene_dst, ed_dst->current_strips(), pasted_strips, use_sync_markers);
554 }
555
556 seq::animation_restore_original(scene_dst, &animation_backup);
557
559 if (scene_dst->adt && scene_dst->adt->action) {
561 }
562 DEG_relations_tag_update(bmain_dst);
566
567 BKE_reportf(op->reports, RPT_INFO, "%d strips pasted", num_strips_to_paste);
568
569 return OPERATOR_FINISHED;
570}
571} // namespace blender::ed::vse
Functions and classes to work with Actions.
Functions to work with AnimData.
#define FILE_MAX
#define BLI_path_join(...)
external readfile function prototypes.
#define FILTER_ID_SCE
Definition DNA_ID.h:1219
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define ND_SEQUENCER
Definition WM_types.hh:456
#define NC_SCENE
Definition WM_types.hh:391
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define NA_SELECTED
Definition WM_types.hh:639
#define ELEM(...)
bool add(const Key &key)
void add_multiple(Span< Key > keys)
int64_t size() const
void append(const T &value)
bool is_empty() const
ID * id_add(const ID *id, IDAddOptions options, FunctionRef< IDAddOperations(LibraryIDLinkCallbackData *cb_data, IDAddOptions options)> dependencies_filter_cb=nullptr)
bool write_as_copypaste_buffer(const char *write_filepath, ReportList &reports)
ID * id_create(short id_type, StringRefNull id_name, Library *library, IDAddOptions options)
#define offsetof(t, d)
void action_fcurve_attach(Action &action, slot_handle_t action_slot, FCurve &fcurve_to_attach, std::optional< StringRefNull > group_name)
decltype(blender::ActionSlot::handle) slot_handle_t
Vector< FCurve * > fcurves_in_action_slot_filtered(bAction *act, slot_handle_t slot_handle, FunctionRef< bool(const FCurve &fcurve)> predicate)
Slot * assign_action_ensure_slot_for_keying(Action &action, ID &animated_id)
bAction * id_action_ensure(Main *bmain, ID *id)
Definition animdata.cc:195
Vector< FCurve * > fcurves_in_listbase_filtered(ListBaseT< FCurve > fcurves, FunctionRef< bool(const FCurve &fcurve)> predicate)
Span< FCurve * > fcurves_for_assigned_action(AnimData *adt)
Definition animdata.cc:349
static void sequencer_copybuffer_filepath_get(char filepath[FILE_MAX], size_t filepath_maxncpy)
static void sequencer_copy_animation_to_vector(Scene *scene_src, Strip *strip_dst, Vector< FCurve * > &clipboard_dst, bAction &fcurves_src_action, animrig::slot_handle_t fcurves_src_slot_handle)
wmOperatorStatus sequencer_clipboard_copy_exec(bContext *C, wmOperator *op)
static void sequencer_copy_animation_listbase(Scene *scene_src, Strip *strip_dst, ListBaseT< FCurve > *clipboard_dst, ListBaseT< FCurve > *fcurve_base_src)
static void sequencer_copy_animation(Scene *scene_src, Vector< FCurve * > &fcurves_dst, ListBaseT< FCurve > *drivers_dst, Strip *strip_dst)
static bool sequencer_paste_animation(Main *bmain_dst, Scene *scene_dst, Scene *scene_src)
static bool sequencer_write_copy_paste_file(Main *bmain_src, Scene *scene_src, const char *filepath, ReportList &reports)
bool deselect_all_strips(const Scene *scene)
wmOperatorStatus sequencer_clipboard_paste_exec(bContext *C, wmOperator *op)
wmOperatorStatus sequencer_clipboard_paste_invoke(bContext *C, wmOperator *op, const wmEvent *event)
BLI_INLINE Texture * wrap(MTLTexture *texture)
float2 image_transform_mirror_factor_get(const Strip *strip)
void relations_invalidate_cache(Scene *scene, Strip *strip)
void seqbase_duplicate_recursive(Main *bmain, const Scene *scene_src, Scene *scene_dst, ListBaseT< Strip > *seqbase_dst, const ListBaseT< Strip > *seqbase_src, const StripDuplicate dupe_flag, const int copy_flag)
Definition sequencer.cc:861
VectorSet< Strip * > query_selected_strips(ListBaseT< Strip > *seqbase)
Definition iterator.cc:164
void transform_translate_strip(Scene *evil_scene, Strip *strip, int delta)
void transform_handle_overlap(Scene *scene, ListBaseT< Strip > *seqbasep, Span< Strip * > source_strips, bool use_sync_markers, Span< Strip * > time_dependent_strips)
bool must_render_strip(const VectorSet< Strip * > &strip_stack, Strip *target_strip)
Definition iterator.cc:195
bool animation_keyframes_exist(const Scene *scene)
Definition animation.cc:25
Editing * editing_get(const Scene *scene)
Definition sequencer.cc:304
bool animation_drivers_exist(Scene *scene)
Definition animation.cc:31
void expand_strips(Editing *ed, VectorSet< Strip * > &strips, const StripRelation include)
Definition iterator.cc:70
VectorSet< Strip * > query_all_strips(ListBaseT< Strip > *seqbase)
Definition iterator.cc:155
Editing * editing_ensure(Scene *scene)
Definition sequencer.cc:309
Strip * select_active_get(const Scene *scene)
void ensure_unique_name(Strip *strip, Scene *scene, const DriverMap &driver_map)
float2 image_transform_origin_preview_offset_get(const Scene *scene, const Strip *strip)
void animation_backup_original(Scene *scene, AnimationBackup *backup)
Definition animation.cc:91
void select_active_set(Scene *scene, Strip *strip)
void animation_restore_original(Scene *scene, AnimationBackup *backup)
Definition animation.cc:110
bool fcurve_matches(const Strip &strip, const FCurve &fcurve)
Definition animation.cc:36
void transform_shuffle_vertical(ListBaseT< Strip > *seqbasep, Span< Strip * > strips, Scene *scene, const int channel_delta)
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
Definition sequencer.cc:445
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1651
View2D * view2d_fromcontext(const bContext *C)
Definition view2d.cc:1836
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
Main * BKE_copybuffer_read(Main &reference_bmain, const char *libname, ReportList *reports, uint64_t id_types_mask)
Scene * CTX_data_sequencer_scene(const bContext *C)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
void ED_outliner_select_sync_from_sequence_tag(const bContext *C)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
Definition listbase.cc:834
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:615
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
Definition listbase.cc:32
int RNA_int_get(PointerRNA *ptr, const char *name)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
AnimData * BKE_animdata_ensure_id(ID *id)
Definition anim_data.cc:107
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
FCurve * BKE_fcurve_copy(const FCurve *fcu)
void BKE_main_merge(Main *bmain_dst, Set< ID * > *force_merge_src_ids, Main **r_bmain_src, MainMergeReport &reports)
Definition main.cc:362
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1288
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BKE_main_free(Main *bmain)
Definition main.cc:202
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
Main * CTX_data_main(const bContext *C)
@ ID_RECALC_ANIMATION_NO_FLUSH
Definition DNA_ID.h:1178
@ ID_RECALC_SEQUENCER_STRIPS
Definition DNA_ID.h:1122
ID_Type GS(const char *name)
Definition DNA_ID.h:410
void DEG_relations_tag_update(Main *bmain)
@ ID_FLAG_CLIPBOARD_MARK
Definition DNA_ID.h:801
@ IDWALK_CB_EMBEDDED_NOT_OWNING
@ IDWALK_CB_NEVER_NULL
@ IDWALK_CB_EMBEDDED
void BKE_library_foreach_ID_link(Main *bmain, ID *id, FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
Definition lib_query.cc:449
ARegion * CTX_wm_region(const bContext *C)
#define VSE_COPYBUFFER_IDTYPES
eRegion_Type regiontype
ListBaseT< FCurve > drivers
ListBaseT< SeqTimelineChannel > channels
ListBaseT< Strip > seqbase
bActionGroup * grp
char name[258]
Definition DNA_ID.h:433
short flag
Definition DNA_ID.h:439
LibraryForeachIDCallbackFlag cb_flag
ListBaseT< Scene > scenes
Definition BKE_main.hh:386
struct Editing * ed
struct AnimData * adt
struct RenderData r
ListBaseT< SpaceLink > spacedata
struct ReportList * reports