66# include <AUD_Special.h>
74using namespace bke::blendfile;
96 for (
FCurve *fcu_src : fcurves_src) {
114 scene_src, meta_child, clipboard_dst, fcurves_src_action, fcurves_src_slot_handle);
119 &fcurves_src_action, fcurves_src_slot_handle, [&](
const FCurve &fcurve) {
123 for (
FCurve *fcu_src : fcurves_src) {
127 fcu_copy->
grp =
nullptr;
129 clipboard_dst.
append(fcu_copy);
154 const char *filepath,
162 const char *scene_name =
"copybuffer_vse_scene";
169 {(PartialWriteContext::IDAddOperations::SET_FAKE_USER |
170 PartialWriteContext::IDAddOperations::SET_CLIPBOARD_MARK)}));
178 scene_src->
ed->current_strips(),
187 if (active_seq_src) {
196 ListBase drivers_dst = {
nullptr,
nullptr};
210 ID_AC, scene_name,
nullptr, {PartialWriteContext::IDAddOperations::SET_FAKE_USER}))
225 if (slot ==
nullptr) {
230 for (
FCurve *fcurve : fcurves_dst) {
234 fcurve->grp ? std::optional(fcurve->grp->name) : std::nullopt);
254#define VSE_COPYBUFFER_IDTYPES ID_SO, ID_MC, ID_IM, ID_TXT, ID_VF, ID_AC
255 auto add_scene_ids_dependencies_cb = [©_buffer,
257 ID *id_src = *cb_data->id_pointer;
278 ID *id_dst =
nullptr;
294 return PartialWriteContext::IDAddOperations::ADD_DEPENDENCIES;
296 return PartialWriteContext::IDAddOperations::CLEAR_DEPENDENCIES;
298 id_dst = copy_buffer.
id_add(id_src,
299 {PartialWriteContext::IDAddOperations::NOP},
300 partial_write_dependencies_filter_cb);
302 *cb_data->id_pointer = id_dst;
306 nullptr, &scene_dst->
id, add_scene_ids_dependencies_cb,
nullptr,
IDWALK_NOP);
307#undef VSE_COPYBUFFER_IDTYPES
311 const bool retval = copy_buffer.
write(filepath, reports);
334 for (
Strip *strip : effect_chain) {
335 if (!(strip->flag &
SELECT)) {
346 for (
Strip *strip : expanded) {
353 if (effect_chain.
size() > selected.
size()) {
356 "Copied the selected Video Sequencer strips and associated effect chain to "
357 "internal clipboard");
361 op->
reports,
RPT_INFO,
"Copied the selected Video Sequencer strips to internal clipboard");
385 if (slot ==
nullptr) {
394 fcu->grp ? std::optional(fcu->grp->name) : std::nullopt);
428 if (bfd ==
nullptr) {
437 Scene *scene_src =
nullptr;
441 scene_src = scene_iter;
446 if (!scene_src || !scene_src->
ed) {
453 if (num_strips_to_paste == 0) {
468 int min_seq_startdisp = std::numeric_limits<int>::max();
474 ofs = scene_dst->
r.
cfra - min_seq_startdisp;
478 std::string active_seq_name;
479 if (prev_active_seq) {
480 active_seq_name.assign(prev_active_seq->
name);
501 ListBase nseqbase = {
nullptr,
nullptr};
515 if (has_animation && scene_src->
adt->
action !=
nullptr) {
523 nseqbase.
first = iseq_first;
525 int2 strip_mean_pos = {0, 0};
526 int image_strip_count = 0;
528 if (istrip->name == active_seq_name) {
538 strip_mean_pos +=
static_cast<int2>(
544 if (image_strip_count > 0) {
545 strip_mean_pos /= image_strip_count;
557 transform->xofs = (view_mval[0] - (strip_mean_pos[0] - origin[0])) * mirror[0];
558 transform->yofs = (view_mval[1] - (strip_mean_pos[1] - origin[1])) * mirror[1];
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)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
Scene * CTX_data_sequencer_scene(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.
View2D * UI_view2d_fromcontext(const bContext *C)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
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)
wmOperatorStatus sequencer_clipboard_paste_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void sequencer_copy_animation(Scene *scene_src, Vector< FCurve * > &fcurves_dst, ListBase *drivers_dst, Strip *strip_dst)
VectorSet< Strip * > query_all_strips(ListBase *seqbase)
void relations_invalidate_cache(Scene *scene, Strip *strip)
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)
float2 image_transform_mirror_factor_get(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))
float2 image_transform_origin_offset_pixelspace_get(const Scene *scene, const Strip *strip)
void animation_backup_original(Scene *scene, AnimationBackup *backup)
void select_active_set(Scene *scene, Strip *strip)
bool must_render_strip(const VectorSet< Strip * > &strips, 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)
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
void seqbase_duplicate_recursive(Main *bmain, const Scene *scene_src, Scene *scene_dst, ListBase *nseqbase, const ListBase *seqbase, const StripDuplicate dupe_flag, const int flag)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
float wrap(float value, float max, float min)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
#define VSE_COPYBUFFER_IDTYPES
LibraryForeachIDCallbackFlag cb_flag
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)