Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/iterator.c
| Show All 25 Lines | |||||
| #include <string.h> | #include <string.h> | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_sequence_types.h" | #include "DNA_sequence_types.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_blenlib.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "SEQ_iterator.h" | #include "SEQ_iterator.h" | ||||
| #include "SEQ_sequencer.h" | |||||
| #include "SEQ_utils.h" | |||||
| /* ************************* iterator ************************** */ | /* ************************* iterator ************************** */ | ||||
| /* *************** (replaces old WHILE_SEQ) ********************* */ | /* *************** (replaces old WHILE_SEQ) ********************* */ | ||||
| /* **************** use now SEQ_ALL_BEGIN () SEQ_ALL_END ***************** */ | /* **************** use now SEQ_ALL_BEGIN () SEQ_ALL_END ***************** */ | ||||
| /* sequence strip iterator: | /* sequence strip iterator: | ||||
| * - builds a full array, recursively into meta strips | * - builds a full array, recursively into meta strips | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | int SEQ_iterator_recursive_apply(Sequence *seq, int (*apply_fn)(Sequence *, void *), void *arg) | ||||
| } | } | ||||
| if (ret && seq->seqbase.first) { | if (ret && seq->seqbase.first) { | ||||
| ret = SEQ_iterator_seqbase_recursive_apply(&seq->seqbase, apply_fn, arg); | ret = SEQ_iterator_seqbase_recursive_apply(&seq->seqbase, apply_fn, arg); | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| int SEQ_iterator_apply_unique_name_fn(Sequence *seq, void *arg_pt) | |||||
| { | |||||
| Scene *scene = (Scene *)arg_pt; | |||||
| char name[sizeof(seq->name) - 2]; | |||||
| BLI_strncpy_utf8(name, seq->name + 2, sizeof(name)); | |||||
| SEQ_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq); | |||||
| SEQ_dupe_animdata(scene, name, seq->name + 2); | |||||
| return 1; | |||||
| } | |||||