90 else if (strip->
input1 ==
nullptr && strip->
input2 ==
nullptr) {
91 strip->
start += delta;
108 const int orig_channel = test->
channel;
116 bool use_fallback_translation =
false;
122 (test->
channel + channel_delta < 1))
124 use_fallback_translation =
true;
133 if (use_fallback_translation) {
137 if (strip->channel == orig_channel) {
177 bool all_conflicts_resolved =
false;
179 while (!all_conflicts_resolved) {
180 all_conflicts_resolved =
true;
181 for (
Strip *strip : strips_to_shuffle) {
183 if (strips_to_shuffle.contains(strip_other)) {
193 all_conflicts_resolved =
false;
216 const bool use_sync_markers)
220 strips_to_shuffle, empty_set, seqbasep, evil_scene, markers, use_sync_markers);
228 const bool use_sync_markers)
232 int offset = (-offset_l < offset_r) ? offset_l : offset_r;
235 for (
Strip *strip : strips_to_shuffle) {
240 if (!time_dependent_strips.
is_empty()) {
241 for (
Strip *strip : time_dependent_strips) {
249 if (marker->flag &
SELECT) {
250 marker->frame += offset;
256 return offset ?
false :
true;
264 for (
Strip *strip : transformed_strips) {
265 if (!strip->is_effect() || strip->input1 ==
nullptr) {
266 standalone_strips.
add(strip);
269 return standalone_strips;
281 for (
Strip *strip : transformed_strips) {
288 if (!time_dependent_strips.
is_empty() && time_dependent_strips.
contains(strip)) {
291 if (transformed_strips.
contains(strip)) {
296 right_side_strips.
add(strip);
299 return right_side_strips;
308 bool use_sync_markers)
313 scene, seqbasep, transformed_strips, time_dependent_strips);
316 for (
Strip *strip : right_side_strips) {
324 standalone_strips, time_dependent_strips, seqbasep, scene, markers, use_sync_markers);
327 for (
Strip *strip : right_side_strips) {
343 bool does_overlap =
false;
344 for (
Strip *strip_transformed : transformed_strips) {
350 return !does_overlap;
353 return overwrite_targets;
369 const Strip *transformed,
403 const Strip *transformed,
408 Main *bmain =
nullptr;
409 const char *error_msg =
nullptr;
418 if (split_strip ==
nullptr) {
430 &error_msg) ==
nullptr)
442 const Strip *transformed,
450 if (target->is_effect()) {
455 for (
Strip *strip : targets) {
477 for (
Strip *target : targets) {
478 for (
Strip *transformed : transformed_strips) {
479 if (transformed->channel != target->channel) {
490 strips_to_delete.
add(target);
504 for (
Strip *strip : strips_to_delete) {
515 bool use_sync_markers)
522 standalone_strips, time_dependent_strips, seqbasep, scene, markers, use_sync_markers);
528 bool use_sync_markers)
538 bool use_sync_markers)
542 switch (overlap_mode) {
545 scene, seqbasep, transformed_strips, time_dependent_strips, use_sync_markers);
552 scene, seqbasep, transformed_strips, time_dependent_strips, use_sync_markers);
558 for (
Strip *strip : transformed_strips) {
569 const int timeline_frame)
580 if (marker->frame >= timeline_frame) {
581 marker->frame += delta;
601 float2 mirror(1.0f, 1.0f);
614 float2 scene_render_size(scene->
r.xsch, scene->
r.ysch);
634 strip, font,
int2(scene_render_size));
643 return scene_render_size;
656 float2 scene_render_size(scene->
r.xsch, scene->
r.ysch);
658 const float2 scale = text_image_size / scene_render_size;
660 const float2 origin_center(0.5f, 0.5f);
661 const float2 origin_diff = origin_rel - origin_center;
663 const float2 true_origin_relative = origin_center + origin_diff * scale;
664 return true_origin_relative;
673 const float2 origin_pos_pixels = (image_size * origin_relative) - (image_size * 0.5f) +
675 const float2 viewport_pixel_aspect(scene->
r.xasp / scene->
r.yasp, 1.0f);
677 return origin_pos_pixels * mirror * viewport_pixel_aspect;
682 bool apply_rotation =
true)
687 const float2 origin_absolute = image_size * origin_relative;
689 const float rotation = apply_rotation ?
transform->rotation : 0.0f;
691 const float2 pivot = origin_absolute - (image_size / 2);
710 {(image_size[0] / 2) - crop->
right, (image_size[1] / 2) - crop->
top},
711 {(image_size[0] / 2) - crop->
right, (-image_size[1] / 2) + crop->
bottom},
712 {(-image_size[0] / 2) + crop->
left, (-image_size[1] / 2) + crop->
bottom},
713 {(-image_size[0] / 2) + crop->
left, (image_size[1] / 2) - crop->
top},
717 const float2 viewport_pixel_aspect(scene->
r.xasp / scene->
r.yasp, 1.0f);
723 for (
int i = 0;
i < 4;
i++) {
725 quad_transformed[
i] = point * mirror * viewport_pixel_aspect;
727 return quad_transformed;
742 return {co_src.x * scene->
r.xsch, co_src.y * scene->
r.ysch};
747 return {co_src.x / scene->
r.xsch, co_src.y / scene->
r.ysch};
752 return {
float2(std::numeric_limits<float>::max()),
float2(std::numeric_limits<float>::lowest())};
761 for (
Strip *strip : strips) {
void BLF_disable(int fontid, FontFlags flag)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
@ STRIP_IGNORE_CHANNEL_LOCK
@ SEQ_SINGLE_FRAME_CONTENT
BMesh const char void * data
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
void reinitialize(const int64_t new_size)
constexpr bool is_empty() const
constexpr bool contains(const T &value) const
int64_t remove_if(Predicate &&predicate)
blender::gpu::Batch * quad
Bounds< T > merge(const Bounds< T > &a, const Bounds< T > &b)
std::optional< Bounds< T > > min_max(const std::optional< Bounds< T > > &a, const T &b)
T clamp(const T &a, const T &min, const T &max)
MatT from_origin_transform(const MatT &transform, const VectorT origin)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
@ STRIP_OVERLAP_LEFT_SIDE
@ STRIP_OVERLAP_IS_INSIDE
@ STRIP_OVERLAP_RIGHT_SIDE
Strip * lookup_meta_by_strip(Editing *ed, const Strip *key)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
static void strip_transform_handle_overwrite_split(Scene *scene, ListBase *seqbasep, const Strip *transformed, Strip *target)
float2 transform_image_raw_size_get(const Scene *scene, const Strip *strip)
int text_effect_font_init(const RenderData *context, const Strip *strip, FontFlags font_flags)
Array< float2 > image_transform_final_quad_get(const Scene *scene, const Strip *strip)
void relations_invalidate_cache(Scene *scene, Strip *strip)
static void strip_transform_handle_overlap_shuffle(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips, blender::Span< Strip * > time_dependent_strips, bool use_sync_markers)
static void strip_transform_handle_overwrite_trim(Scene *scene, ListBase *seqbasep, const Strip *transformed, Strip *target, const eOvelapDescrition overlap)
SeqTimelineChannel * channel_get_by_index(const ListBase *channels, const int channel_index)
ListBase * channels_displayed_get(const Editing *ed)
void edit_remove_flagged_strips(Scene *scene, ListBase *seqbase)
static blender::VectorSet< Strip * > query_overwrite_targets(const Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips)
Bounds< float2 > image_transform_bounding_box_from_collection(Scene *scene, blender::Span< Strip * > strips, bool apply_rotation)
void edit_flag_for_removal(Scene *scene, ListBase *seqbase, Strip *strip)
float3x3 image_transform_matrix_get(const Scene *scene, const Strip *strip)
void transform_translate_strip(Scene *evil_scene, Strip *strip, int delta)
bool channel_is_locked(const SeqTimelineChannel *channel)
VectorSet< Strip * > query_unselected_strips(ListBase *seqbase)
Array< float2 > image_transform_quad_get(const Scene *scene, const Strip *strip, bool apply_rotation)
void strip_channel_set(Strip *strip, int channel)
TextVarsRuntime * text_effect_calc_runtime(const Strip *strip, int font, const int2 image_size)
static void strip_transform_handle_overwrite(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
static blender::VectorSet< Strip * > extract_standalone_strips(blender::Span< Strip * > transformed_strips)
blender::Span< Strip * > SEQ_lookup_effects_by_strip(Editing *ed, const Strip *key)
static eOvelapDescrition overlap_description_get(const Scene *scene, const Strip *transformed, const Strip *target)
int time_left_handle_frame_get(const Scene *, const Strip *strip)
void offset_animdata(const Scene *scene, Strip *strip, float ofs)
float2 image_transform_mirror_factor_get(const Strip *strip)
void query_strip_effect_chain(const Scene *scene, Strip *reference_strip, ListBase *seqbase, VectorSet< Strip * > &r_strips)
void strip_time_update_effects_strip_range(const Scene *scene, const blender::Span< Strip * > effects)
bool transform_single_image_check(const Strip *strip)
constexpr int MAX_CHANNELS
void time_update_meta_strip_range(const Scene *scene, Strip *strip_meta)
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))
static void strip_transform_handle_expand_to_fit(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips, blender::Span< Strip * > time_dependent_strips, bool use_sync_markers)
void strip_time_translate_handles(const Scene *scene, Strip *strip, const int offset)
bool transform_seqbase_shuffle_ex(ListBase *seqbasep, Strip *test, Scene *evil_scene, int channel_delta)
static bool shuffle_strip_test_overlap(const Scene *scene, const Strip *strip1, const Strip *strip2, const int offset)
void transform_offset_after_frame(Scene *scene, ListBase *seqbase, const int delta, const int timeline_frame)
float2 image_transform_origin_offset_pixelspace_get(const Scene *scene, const Strip *strip)
static Array< float2 > strip_image_transform_quad_get_ex(const Scene *scene, const Strip *strip, bool apply_rotation)
float2 image_transform_origin_get(const Scene *scene, const Strip *strip)
static Bounds< float2 > negative_bounds()
VectorSet< Strip * > query_by_reference(Strip *strip_reference, const Scene *scene, ListBase *seqbase, void strip_query_func(const Scene *scene, Strip *strip_reference, ListBase *seqbase, VectorSet< Strip * > &strips))
bool transform_seqbase_shuffle_time(blender::Span< Strip * > strips_to_shuffle, ListBase *seqbasep, Scene *evil_scene, ListBase *markers, const bool use_sync_markers)
bool transform_is_locked(ListBase *channels, const Strip *strip)
static blender::VectorSet< Strip * > query_right_side_strips(const Scene *scene, ListBase *seqbase, blender::Span< Strip * > transformed_strips, blender::Span< Strip * > time_dependent_strips)
bool relation_is_effect_of_strip(const Strip *effect, const Strip *input)
void time_left_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
static int shuffle_strip_time_offset_get(const Scene *scene, blender::Span< Strip * > strips_to_shuffle, ListBase *seqbasep, char dir)
bool channel_is_muted(const SeqTimelineChannel *channel)
void transform_handle_overlap(Scene *scene, ListBase *seqbasep, blender::Span< Strip * > transformed_strips, bool use_sync_markers)
void time_right_handle_frame_set(const Scene *scene, Strip *strip, int timeline_frame)
bool transform_strip_can_be_translated(const Strip *strip)
Strip * edit_strip_split(Main *bmain, Scene *scene, ListBase *seqbase, Strip *strip, const int timeline_frame, const eSplitMethod method, const bool ignore_connections, const char **r_error)
float2 image_preview_unit_to_px(const Scene *scene, const float2 co_src)
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
static float3x3 seq_image_transform_matrix_get_ex(const Scene *scene, const Strip *strip, bool apply_rotation=true)
float2 image_preview_unit_from_px(const Scene *scene, const float2 co_src)
int effect_get_num_inputs(int strip_type)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
struct ToolSettings * toolsettings
StripTransform * transform