62# include <AUD_Special.h>
70using namespace bke::blendfile;
92 for (
FCurve *fcu_src : fcurves_src) {
110 scene_src, meta_child, clipboard_dst, fcurves_src_action, fcurves_src_slot_handle);
115 &fcurves_src_action, fcurves_src_slot_handle, [&](
const FCurve &fcurve) {
119 for (
FCurve *fcu_src : fcurves_src) {
123 fcu_copy->
grp =
nullptr;
125 clipboard_dst.
append(fcu_copy);
150 const char *filepath,
158 const char *scene_name =
"copybuffer_vse_scene";
165 {(PartialWriteContext::IDAddOperations::SET_FAKE_USER |
166 PartialWriteContext::IDAddOperations::SET_CLIPBOARD_MARK)}));
180 if (active_seq_src) {
189 ListBase drivers_dst = {
nullptr,
nullptr};
203 ID_AC, scene_name,
nullptr, {PartialWriteContext::IDAddOperations::SET_FAKE_USER}))
218 if (slot ==
nullptr) {
223 for (
FCurve *fcurve : fcurves_dst) {
227 fcurve->grp ? std::optional(fcurve->grp->name) : std::nullopt);
247#define VSE_COPYBUFFER_IDTYPES ID_SO, ID_MC, ID_IM, ID_TXT, ID_VF, ID_AC
248 auto add_scene_ids_dependencies_cb = [©_buffer,
250 ID *id_src = *cb_data->id_pointer;
271 ID *id_dst =
nullptr;
272 const ID_Type id_type =
GS((id_src)->name);
283 const ID_Type id_type =
GS((id_deps_src)->name);
287 return PartialWriteContext::IDAddOperations::ADD_DEPENDENCIES;
289 return PartialWriteContext::IDAddOperations::CLEAR_DEPENDENCIES;
291 id_dst = copy_buffer.
id_add(id_src,
292 {PartialWriteContext::IDAddOperations::NOP},
293 partial_write_dependencies_filter_cb);
295 *cb_data->id_pointer = id_dst;
299 nullptr, &scene_dst->
id, add_scene_ids_dependencies_cb,
nullptr,
IDWALK_NOP);
300#undef VSE_COPYBUFFER_IDTYPES
304 const bool retval = copy_buffer.
write(filepath,
reports);
326 for (
Strip *strip : effect_chain) {
327 if (!(strip->flag &
SELECT)) {
338 for (
Strip *strip : expanded) {
345 if (effect_chain.
size() > selected.
size()) {
348 "Copied the selected Video Sequencer strips and associated effect chain to "
349 "internal clipboard");
353 op->
reports,
RPT_INFO,
"Copied the selected Video Sequencer strips to internal clipboard");
377 if (slot ==
nullptr) {
386 fcu->grp ? std::optional(fcu->grp->name) : std::nullopt);
403 if (bfd ==
nullptr) {
412 Scene *scene_src =
nullptr;
416 scene_src = scene_iter;
421 if (!scene_src || !scene_src->
ed) {
428 if (num_strips_to_paste == 0) {
443 int min_seq_startdisp = INT_MAX;
449 ofs = scene_dst->
r.
cfra - min_seq_startdisp;
453 std::string active_seq_name;
454 if (prev_active_seq) {
455 active_seq_name.assign(prev_active_seq->
name);
476 ListBase nseqbase = {
nullptr,
nullptr};
484 if (has_animation && scene_src->
adt->
action !=
nullptr) {
492 nseqbase.
first = iseq_first;
495 if (istrip->name == active_seq_name) {
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
Functions to work with AnimData.
AnimData * BKE_animdata_ensure_id(ID *id)
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
BlendFileData * BKE_blendfile_read(const char *filepath, const BlendFileReadParams *params, BlendFileReadReport *reports)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
FCurve * BKE_fcurve_copy(const FCurve *fcu)
void BKE_id_delete(Main *bmain, void *idv) ATTR_NONNULL()
@ IDWALK_CB_EMBEDDED_NOT_OWNING
void BKE_library_foreach_ID_link(Main *bmain, ID *id, blender::FunctionRef< LibraryIDLinkCallback > callback, void *user_data, LibraryForeachIDFlag flag)
void BKE_main_merge(Main *bmain_dst, Main **r_bmain_src, MainMergeReport &reports)
void BKE_main_free(Main *bmain)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
#define BLI_path_join(...)
external readfile function prototypes.
void BLO_blendfiledata_free(BlendFileData *bfd)
external writefile.cc function prototypes.
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_SEQUENCER_STRIPS
@ ID_RECALC_ANIMATION_NO_FLUSH
void ED_outliner_select_sync_from_sequence_tag(const bContext *C)
Read Guarded memory(de)allocation.
void add_multiple(Span< Key > keys)
void append(const T &value)
ID * id_add(const ID *id, IDAddOptions options, blender::FunctionRef< IDAddOperations(LibraryIDLinkCallbackData *cb_data, IDAddOptions options)> dependencies_filter_cb=nullptr)
bool write(const char *write_filepath, int write_flags, int remap_mode, ReportList &reports)
ID * id_create(short id_type, StringRefNull id_name, Library *library, IDAddOptions options)
void * MEM_callocN(size_t len, const char *str)
Vector< FCurve * > fcurves_for_assigned_action(AnimData *adt)
bool action_treat_as_legacy(const bAction &action)
void action_fcurve_attach(Action &action, slot_handle_t action_slot, FCurve &fcurve_to_attach, std::optional< StringRefNull > group_name)
Vector< FCurve * > fcurves_in_listbase_filtered(ListBase fcurves, FunctionRef< bool(const FCurve &fcurve)> predicate)
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)
decltype(::ActionSlot::handle) slot_handle_t
bool assign_action(bAction *action, ID &animated_id)
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 bool sequencer_paste_animation(Main *bmain_dst, Scene *scene_dst, Scene *scene_src)
static void sequencer_copy_animation_listbase(Scene *scene_src, Strip *strip_dst, ListBase *clipboard_dst, ListBase *fcurve_base_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)
static void sequencer_copy_animation(Scene *scene_src, Vector< FCurve * > &fcurves_dst, ListBase *drivers_dst, Strip *strip_dst)
VectorSet< Strip * > query_selected_strips(ListBase *seqbase)
void transform_translate_strip(Scene *evil_scene, Strip *strip, int delta)
bool animation_keyframes_exist(const Scene *scene)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
int time_left_handle_frame_get(const Scene *, const Strip *strip)
bool animation_drivers_exist(Scene *scene)
void query_strip_effect_chain(const Scene *scene, Strip *reference_strip, ListBase *seqbase, VectorSet< Strip * > &r_strips)
Editing * editing_ensure(Scene *scene)
Strip * select_active_get(const Scene *scene)
void iterator_set_expand(const Scene *scene, ListBase *seqbase, VectorSet< Strip * > &strips, void strip_query_func(const Scene *scene, Strip *strip_reference, ListBase *seqbase, VectorSet< Strip * > &strips))
void animation_backup_original(Scene *scene, AnimationBackup *backup)
void select_active_set(Scene *scene, Strip *strip)
void animation_restore_original(Scene *scene, AnimationBackup *backup)
bool fcurve_matches(const Strip &strip, const FCurve &fcurve)
void ensure_unique_name(Strip *strip, Scene *scene)
void seqbase_duplicate_recursive(const Scene *scene_src, Scene *scene_dst, ListBase *nseqbase, const ListBase *seqbase, int dupe_flag, const int flag)
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
float wrap(float value, float max, float min)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
#define VSE_COPYBUFFER_IDTYPES
ListBase * displayed_channels
LibraryForeachIDCallbackFlag cb_flag
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)