Blender
V3.3
|
#include "BLI_ghash.h"
Go to the source code of this file.
Classes | |
struct | SeqCollection |
struct | SeqIterator |
Macros | |
#define | _SEQ_ITERATOR_NAME_JOIN(x, y) x##_##y |
#define | _SEQ_ITERATOR_NAME_EVALUATE(x, y) _SEQ_ITERATOR_NAME_JOIN(x, y) |
#define | _SEQ_ITERATOR_NAME(prefix) _SEQ_ITERATOR_NAME_EVALUATE(prefix, __LINE__) |
#define | SEQ_ITERATOR_FOREACH(var, collection) |
#define | SEQ_collection_free_void_p ((GHashValFreeFP)SEQ_collection_free) |
Typedefs | |
typedef struct SeqCollection | SeqCollection |
typedef struct SeqIterator | SeqIterator |
typedef bool(* | SeqForEachFunc) (struct Sequence *seq, void *user_data) |
#define _SEQ_ITERATOR_NAME | ( | prefix | ) | _SEQ_ITERATOR_NAME_EVALUATE(prefix, __LINE__) |
Definition at line 33 of file SEQ_iterator.h.
Definition at line 32 of file SEQ_iterator.h.
#define SEQ_collection_free_void_p ((GHashValFreeFP)SEQ_collection_free) |
Quiet compiler warning for free function.
Definition at line 135 of file SEQ_iterator.h.
#define SEQ_ITERATOR_FOREACH | ( | var, | |
collection | |||
) |
Definition at line 35 of file SEQ_iterator.h.
typedef struct SeqCollection SeqCollection |
Callback format for the for_each function below.
Definition at line 78 of file SEQ_iterator.h.
typedef struct SeqIterator SeqIterator |
bool SEQ_collection_append_strip | ( | struct Sequence * | seq, |
SeqCollection * | collection | ||
) |
Add strip to collection.
seq | strip to be added |
collection | collection to which strip will be added |
Definition at line 117 of file iterator.c.
References BLI_gset_ensure_p_ex(), and SeqCollection::set.
Referenced by extract_standalone_strips(), query_all_strips_recursive(), query_lower_channel_strips(), query_right_side_strips(), query_selected_strips_no_handles(), query_snap_targets(), query_strip_effects_fn(), query_strips_at_frame(), query_time_dependent_strips_strips(), SEQ_collection_duplicate(), seq_collection_extract_effects(), SEQ_collection_merge(), SEQ_edit_move_strip_to_meta(), SEQ_edit_strip_split(), seq_load_apply_generic_options(), seq_load_apply_generic_options_only_test_overlap(), SEQ_query_all_strips(), SEQ_query_all_strips_recursive(), SEQ_query_selected_strips(), SEQ_query_strip_effect_chain(), SEQ_query_unselected_strips(), seq_sequence_lookup_append_effect(), seq_transform_collection_from_transdata(), seq_transform_handle_overwrite(), sequencer_add_movie_multiple_strips(), and sequencer_add_movie_single_strip().
SeqCollection* SEQ_collection_create | ( | const char * | name | ) |
Create new empty strip collection.
Definition at line 87 of file iterator.c.
References BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_gset_new(), MEM_callocN, and SeqCollection::set.
Referenced by extract_standalone_strips(), query_right_side_strips(), query_selected_strips_no_handles(), query_snap_targets(), query_strips_at_frame(), SEQ_collection_duplicate(), SEQ_collection_expand(), seq_collection_extract_effects(), SEQ_edit_move_strip_to_meta(), SEQ_edit_strip_split(), seq_load_apply_generic_options(), SEQ_query_all_strips(), SEQ_query_all_strips_recursive(), SEQ_query_by_reference(), SEQ_query_selected_strips(), SEQ_query_unselected_strips(), seq_sequence_lookup_append_effect(), seq_transform_collection_from_transdata(), seq_transform_handle_overwrite(), sequencer_add_movie_multiple_strips(), sequencer_add_movie_single_strip(), sequencer_add_movie_strip_exec(), and transform_snap_sequencer_to_closest_strip_ex().
SeqCollection* SEQ_collection_duplicate | ( | SeqCollection * | collection | ) |
Duplicate collection
collection | collection to be duplicated |
Definition at line 172 of file iterator.c.
References SEQ_collection_append_strip(), SEQ_collection_create(), and SEQ_ITERATOR_FOREACH.
Referenced by query_snap_targets(), and query_time_dependent_strips_strips().
void SEQ_collection_exclude | ( | SeqCollection * | collection, |
SeqCollection * | exclude_elements | ||
) |
Remove strips from collection that are also in exclude_elements
. Source collection will be freed.
collection | collection from which strips are removed |
exclude_elements | collection of strips to be removed |
Definition at line 142 of file iterator.c.
References SEQ_collection_free(), SEQ_collection_remove_strip(), and SEQ_ITERATOR_FOREACH.
Referenced by query_snap_targets().
void SEQ_collection_expand | ( | const struct Scene * | scene, |
struct ListBase * | seqbase, | ||
SeqCollection * | collection, | ||
void | seq_query_funcconst struct Scene *scene, struct Sequence *seq_reference, struct ListBase *seqbase, SeqCollection *collection | ||
) |
Expand collection by running SEQ_query() for each strip, which will be used as reference. Results of these queries will be merged into provided collection.
seqbase | ListBase in which strips are queried |
collection | SeqCollection to be expanded |
seq_query_func | query function callback |
void SEQ_collection_free | ( | SeqCollection * | collection | ) |
Free strip collection.
collection | collection to be freed |
Definition at line 81 of file iterator.c.
References BLI_gset_free(), MEM_freeN, NULL, and SeqCollection::set.
Referenced by createTransSeqImageData(), flushTransSeq(), free_transform_custom_data(), freeSeqData(), gizmo2d_calc_bounds(), gizmo2d_calc_rotation(), gizmo2d_calc_transform_orientation(), gizmo2d_calc_transform_pivot(), query_snap_targets(), query_time_dependent_strips_strips(), seq_box_select_seq_from_preview(), SEQ_collection_exclude(), SEQ_collection_merge(), SEQ_edit_move_strip_to_meta(), SEQ_edit_strip_split(), seq_frame_apply_snap(), SEQ_get_meta_by_seqbase(), seq_get_shown_sequences(), seq_get_strip_pivot_median(), seq_load_apply_generic_options(), seq_prefetch_must_skip_frame(), seq_select_seq_from_preview(), seq_transform_handle_expand_to_fit(), seq_transform_handle_overlap_shuffle(), seq_transform_handle_overwrite(), seq_transform_handle_overwrite_trim(), sequencer_add_movie_multiple_strips(), sequencer_add_movie_single_strip(), sequencer_add_movie_strip_exec(), sequencer_de_select_all_exec(), sequencer_delete_exec(), sequencer_draw_preview(), sequencer_drop_copy(), sequencer_select_grouped_exec(), sequencer_select_inverse_exec(), transform_snap_sequencer_data_alloc(), and transform_snap_sequencer_to_closest_strip_ex().
bool SEQ_collection_has_strip | ( | const struct Sequence * | seq, |
const SeqCollection * | collection | ||
) |
Check if seq is in collection.
uint SEQ_collection_len | ( | const SeqCollection * | collection | ) |
Return number of items in collection.
Definition at line 95 of file iterator.c.
References BLI_gset_len(), and SeqCollection::set.
Referenced by createTransSeqImageData(), gizmo2d_calc_bounds(), gizmo2d_calc_rotation(), gizmo2d_calc_transform_orientation(), gizmo2d_calc_transform_pivot(), select_grouped_effect_link(), seq_get_snap_source_points_len(), seq_get_snap_target_points_count(), seq_get_strip_pivot_median(), seq_transform_handle_overwrite(), sequencer_add_movie_strip_exec(), sequencer_view_selected_exec(), and transform_snap_sequencer_data_alloc().
void SEQ_collection_merge | ( | SeqCollection * | collection_dst, |
SeqCollection * | collection_src | ||
) |
Move strips from collection_src to collection_dst. Source collection will be freed.
collection_dst | destination collection |
collection_src | source collection |
Definition at line 133 of file iterator.c.
References SEQ_collection_append_strip(), SEQ_collection_free(), and SEQ_ITERATOR_FOREACH.
Referenced by SEQ_collection_expand().
bool SEQ_collection_remove_strip | ( | struct Sequence * | seq, |
SeqCollection * | collection | ||
) |
Remove strip from collection.
seq | strip to be removed |
collection | collection from which strip will be removed |
Definition at line 128 of file iterator.c.
References BLI_gset_remove(), NULL, and SeqCollection::set.
Referenced by collection_filter_channel_up_to_incl(), collection_filter_rendered_strips(), query_overwrite_targets(), query_scene_strips(), query_time_dependent_strips_strips(), SEQ_collection_exclude(), and SEQ_filter_selected_strips().
void SEQ_filter_selected_strips | ( | SeqCollection * | collection | ) |
Definition at line 366 of file iterator.c.
References Sequence::flag, SELECT, SEQ_collection_remove_strip(), and SEQ_ITERATOR_FOREACH.
Referenced by createTransSeqImageData(), gizmo2d_calc_bounds(), gizmo2d_calc_rotation(), gizmo2d_calc_transform_orientation(), gizmo2d_calc_transform_pivot(), select_grouped_effect_link(), selected_strips_from_context(), and seq_get_strip_pivot_median().
void SEQ_for_each_callback | ( | struct ListBase * | seqbase, |
SeqForEachFunc | callback, | ||
void * | user_data | ||
) |
Utility function to recursively iterate through all sequence strips in a seqbase
list. Uses callback to do operations on each sequence element. The callback can stop the iteration if needed.
seqbase | ListBase of sequences to be iterated over. |
callback | query function callback, returns false if iteration should stop. |
user_data | pointer to user data that can be used in the callback function. |
Definition at line 76 of file iterator.c.
References callback, seq_for_each_recursive(), and user_data.
Referenced by blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_300(), blo_do_versions_pre250(), blender::deg::DepsgraphNodeBuilder::build_scene_sequencer(), blender::deg::DepsgraphRelationBuilder::build_scene_sequencer(), do_versions_after_linking_300(), do_versions_ipos_to_animato(), IMB_colormanagement_check_file_config(), blender::deg::SequencerBackup::init_from_scene(), lib_link_clipboard_restore(), blender::deg::SequencerBackup::restore_to_scene(), scene_foreach_id(), scene_foreach_path(), SEQ_blend_read(), SEQ_blend_read_expand(), SEQ_blend_read_lib(), SEQ_blend_write(), SEQ_eval_sequences(), SEQ_relations_check_uuids_unique_and_report(), SEQ_sequence_base_unique_name_recursive(), seq_update_seq_cb(), sequencer_export_subtitles_exec(), and sound_update_animation_flags().
bool SEQ_iterator_ensure | ( | SeqCollection * | collection, |
SeqIterator * | iterator, | ||
Sequence ** | r_seq | ||
) |
Utility function for SEQ_ITERATOR_FOREACH macro. Ensure, that iterator is initialized. During initialization return pointer to collection element and step gset iterator. When this function is called after iterator has been initialized, it will do nothing and return true.
collection | collection to iterate |
iterator | iterator to be initialized |
r_seq | pointer to Sequence pointer |
\Iterator API
Definition at line 32 of file iterator.c.
References BLI_gset_len(), BLI_gsetIterator_getKey(), BLI_gsetIterator_init(), BLI_gsetIterator_step(), SeqIterator::collection, SeqIterator::gsi, SeqIterator::iterator_initialized, and SeqCollection::set.
struct Sequence* SEQ_iterator_yield | ( | SeqIterator * | iterator | ) |
Utility function for SEQ_ITERATOR_FOREACH macro. Yield collection element
iterator | iterator to be initialized |
Definition at line 52 of file iterator.c.
References BLI_gsetIterator_done(), BLI_gsetIterator_getKey(), BLI_gsetIterator_step(), SeqIterator::gsi, and NULL.
SeqCollection* SEQ_query_all_strips | ( | ListBase * | seqbase | ) |
Query all strips in seqbase. This does not include strips nested in meta strips.
seqbase | ListBase in which strips are queried |
Definition at line 206 of file iterator.c.
References LISTBASE_FOREACH, SEQ_collection_append_strip(), and SEQ_collection_create().
Referenced by all_strips_from_context(), seq_frame_apply_snap(), and seq_time_gap_info_get().
SeqCollection* SEQ_query_all_strips_recursive | ( | ListBase * | seqbase | ) |
Query all strips in seqbase and nested meta strips.
seqbase | ListBase in which strips are queried |
Definition at line 194 of file iterator.c.
References LISTBASE_FOREACH, query_all_strips_recursive(), SEQ_collection_append_strip(), SEQ_collection_create(), and SEQ_TYPE_META.
Referenced by query_scene_strips(), and SEQ_get_meta_by_seqbase().
SeqCollection* SEQ_query_by_reference | ( | struct Sequence * | seq_reference, |
const struct Scene * | scene, | ||
struct ListBase * | seqbase, | ||
void | seq_query_funcconst struct Scene *scene, struct Sequence *seq_reference, struct ListBase *seqbase, SeqCollection *collection | ||
) |
Query strips from seqbase. seq_reference is used by query function as filter condition.
seq_reference | reference strip for query function |
seqbase | ListBase in which strips are queried |
seq_query_func | query function callback |
SeqCollection* SEQ_query_rendered_strips | ( | const struct Scene * | scene, |
ListBase * | channels, | ||
ListBase * | seqbase, | ||
int | timeline_frame, | ||
int | displayed_channel | ||
) |
Query strips that are rendered at timeline_frame when displayed channel is viewed
seqbase | ListBase in which strips are queried |
timeline_frame | viewed frame |
displayed_channel | viewed channel. when set to 0, no channel filter is applied |
SeqCollection* SEQ_query_selected_strips | ( | struct ListBase * | seqbase | ) |
Query all selected strips in seqbase.
seqbase | ListBase in which strips are queried |
Definition at line 215 of file iterator.c.
References LISTBASE_FOREACH, SELECT, SEQ_collection_append_strip(), and SEQ_collection_create().
Referenced by query_time_dependent_strips_strips(), selected_strips_from_context(), and transform_snap_sequencer_data_alloc().
void SEQ_query_strip_effect_chain | ( | const struct Scene * | scene, |
struct Sequence * | seq_reference, | ||
struct ListBase * | seqbase, | ||
SeqCollection * | collection | ||
) |
Query all effect strips that are directly or indirectly connected to seq_reference. This includes all effects of seq_reference, strips used by another inputs and their effects, so that whole chain is fully independent of other strips.
seq_reference | reference strip |
seqbase | ListBase in which strips are queried |
collection | collection to be filled |
SeqCollection* SEQ_query_unselected_strips | ( | struct ListBase * | seqbase | ) |
Query all unselected strips in seqbase.
seqbase | ListBase in which strips are queried |
Definition at line 323 of file iterator.c.
References LISTBASE_FOREACH, SELECT, SEQ_collection_append_strip(), and SEQ_collection_create().
Referenced by query_overwrite_targets().