diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 13:13:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-04 13:13:00 +0400 |
commit | db4d317f6be28cf5141537f48449b70f0a3a38b2 (patch) | |
tree | c7af9d155646f911f0fa1fdd7f9d31faf69416b9 /source/blender/editors | |
parent | 5553f66eb777ff4ee589b91b42258e5e7a6fbfec (diff) |
'Copy To Selected' (right click menu item) now works for sequence strips, useful for copying blend modes & opacity
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 419de8eb898..20752099814 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -322,6 +322,8 @@ static int copy_to_selected_list(bContext *C, PointerRNA *ptr, ListBase *lb) *lb = CTX_data_collection_get(C, "selected_editable_bones"); else if(RNA_struct_is_a(ptr->type, &RNA_PoseBone)) *lb = CTX_data_collection_get(C, "selected_pose_bones"); + else if(RNA_struct_is_a(ptr->type, &RNA_Sequence)) + *lb = CTX_data_collection_get(C, "selected_editable_sequences"); else return 0; diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 2d5af4aa705..de1312501d4 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -29,6 +29,7 @@ #include "DNA_object_types.h" #include "DNA_armature_types.h" +#include "DNA_sequence_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" @@ -36,6 +37,7 @@ #include "BKE_utildefines.h" #include "BKE_global.h" #include "BKE_action.h" +#include "BKE_sequencer.h" #include "RNA_access.h" @@ -66,7 +68,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult "visible_pose_bones", "selected_pose_bones", "active_bone", "active_pose_bone", "active_base", "active_object", "object", "edit_object", "sculpt_object", "vertex_paint_object", "weight_paint_object", - "texture_paint_object", "particle_edit_object", NULL}; + "texture_paint_object", "particle_edit_object", + "selected_sequences", "selected_editable_sequences", /* sequencer */ + NULL}; CTX_data_dir_set(result, dir); return 1; @@ -317,6 +321,32 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult return 1; } + else if(CTX_data_equals(member, "selected_strips")) { + Editing *ed= seq_give_editing(scene, FALSE); + if(ed) { + Sequence *seq; + for (seq= ed->seqbasep->first; seq; seq= seq->next) { + if (seq->flag & SELECT) { + CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); + } + } + CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); + return 1; + } + } + else if(CTX_data_equals(member, "selected_editable_sequences")) { + Editing *ed= seq_give_editing(scene, FALSE); + if(ed) { + Sequence *seq; + for (seq= ed->seqbasep->first; seq; seq= seq->next) { + if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) { + CTX_data_list_add(result, &scene->id, &RNA_Sequence, seq); + } + } + CTX_data_type_set(result, CTX_DATA_TYPE_COLLECTION); + return 1; + } + } else { return 0; /* not found */ } |