- duplicating a scene now duplicates all strips (not just selected ones)
authorCampbell Barton <ideasman42@gmail.com>
Thu, 8 Jul 2010 14:30:43 +0000 (14:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 8 Jul 2010 14:30:43 +0000 (14:30 +0000)
- python change, dont import 'bpy' by default, initially I thaught this would make scripting easier but it ends up being annoying when you want to register a script or if you want to import it. (more trouble then its worth to save 1 line, also not very pythonic).

source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/sequencer.c
source/blender/python/intern/bpy_interface.c

index 3b95c25..002a195 100644 (file)
@@ -234,6 +234,7 @@ typedef struct SeqLoadInfo {
 #define SEQ_DUPE_UNIQUE_NAME   1<<0
 #define SEQ_DUPE_CONTEXT               1<<1
 #define SEQ_DUPE_ANIM                  1<<2
+#define SEQ_DUPE_ALL                   1<<3 /* otherwise only selected are copied */
 
 /* use as an api function */
 typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *);
index af13aae..2896ac6 100644 (file)
@@ -220,7 +220,7 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type)
                if(sce->ed) {
                        scen->ed= MEM_callocN( sizeof(Editing), "addseq");
                        scen->ed->seqbasep= &scen->ed->seqbase;
-                       seqbase_dupli_recursive(sce, &scen->ed->seqbase, &sce->ed->seqbase, 0);
+                       seqbase_dupli_recursive(sce, &scen->ed->seqbase, &sce->ed->seqbase, SEQ_DUPE_ALL);
                }
        }
 
index 82ed85a..36e768e 100644 (file)
@@ -4299,7 +4299,7 @@ void seqbase_dupli_recursive(Scene *scene, ListBase *nseqbase, ListBase *seqbase
 
        for(seq= seqbase->first; seq; seq= seq->next) {
                seq->tmp= NULL;
-               if(seq->flag & SELECT) {
+               if((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) {
                        seqn = seq_dupli(scene, seq, dupe_flag);
                        if (seqn) { /*should never fail */
                                if(dupe_flag & SEQ_DUPE_CONTEXT) {
index 6a1495b..f5b07da 100644 (file)
@@ -166,11 +166,6 @@ static PyObject *CreateGlobalDictionary( bContext *C, const char *filename )
                Py_DECREF(item);
        }
 
-       /* add bpy to global namespace */
-       mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0);
-       PyDict_SetItemString( dict, "bpy", mod );
-       Py_DECREF(mod);
-       
        return dict;
 }