Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-12-17 17:45:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-12-17 17:45:47 +0300
commit51fdfa0de97bd3825161e245338c76711578f4cf (patch)
tree3617598687239995a29e3d614cb2e5bf292a5b8e /source/blender/editors/space_sequencer/sequencer_edit.c
parent68ff5a87ecc7584408a09cec02aa4e6220b4d21e (diff)
sequencer clipboard
note: for inter-scene copying this uses a hack because Colin needs it because half his scene was scrambled by blender.
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 844bf51ae32..8c228e9ca74 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2746,3 +2746,66 @@ void SEQUENCER_OT_rendersize(wmOperatorType *ot)
/* properties */
}
+static void *_copy_scene= NULL; // XXX - FIXME
+static int sequencer_copy_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ Editing *ed= seq_give_editing(scene, FALSE);
+
+ if(ed==NULL)
+ return OPERATOR_CANCELLED;
+
+ seq_free_clipboard(scene);
+ recurs_dupli_seq(scene, ed->seqbasep, &ed->seqbase_clipboard);
+
+ _copy_scene = scene;
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_copy(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Copy";
+ ot->idname= "SEQUENCER_OT_copy";
+ ot->description="";
+
+ /* api callbacks */
+ ot->exec= sequencer_copy_exec;
+ ot->poll= ED_operator_sequencer_active;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+}
+
+static int sequencer_paste_exec(bContext *C, wmOperator *op)
+{
+ int retval = OPERATOR_CANCELLED;
+ Scene *scene= CTX_data_scene(C);
+ Editing *ed= seq_give_editing(scene, TRUE); /* create if needed */
+ Editing *ed_from= seq_give_editing((Scene *)_copy_scene, TRUE); /* create if needed */
+
+
+ addlisttolist(ed->seqbasep, &ed_from->seqbase_clipboard);
+ ed_from->seqbase_clipboard.first= ed_from->seqbase_clipboard.last= NULL; // XXX - could duplicate these to use the clip
+
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_paste(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Paste";
+ ot->idname= "SEQUENCER_OT_paste";
+ ot->description="";
+
+ /* api callbacks */
+ ot->exec= sequencer_paste_exec;
+ ot->poll= ED_operator_sequencer_active;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ /* properties */
+}