Merging r47572 through r47580 form trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2012 18:08:57 +0000 (18:08 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 7 Jun 2012 18:08:57 +0000 (18:08 +0000)
43 files changed:
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/ArmatureExporter.cpp
source/blender/collada/ArmatureExporter.h
source/blender/collada/DocumentExporter.cpp
source/blender/collada/ExportSettings.h
source/blender/collada/GeometryExporter.cpp
source/blender/collada/GeometryExporter.h
source/blender/collada/SceneExporter.cpp
source/blender/collada/collada.cpp
source/blender/collada/collada.h
source/blender/collada/collada_utils.cpp
source/blender/collada/collada_utils.h
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/include/ED_clip.h
source/blender/editors/include/ED_gpencil.h
source/blender/editors/mask/mask_add.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesdna/DNA_sequence_types.h
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_sequencer_api.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_operators.c

index 9737888e0b2b62e4f1a71ca31f50b594352fbef3..bbc1874c2ae0cca15e2d6981e1387c42b8cad0fd 100644 (file)
@@ -1924,14 +1924,14 @@ void do_versions_ipos_to_animato(Main *main)
                                 * (semi-hack (tm) )
                                 */
                                switch (seq->type) {
-                                       case SEQ_IMAGE:
-                                       case SEQ_META:
-                                       case SEQ_SCENE:
-                                       case SEQ_MOVIE:
-                                       case SEQ_COLOR:
+                                       case SEQ_TYPE_IMAGE:
+                                       case SEQ_TYPE_META:
+                                       case SEQ_TYPE_SCENE:
+                                       case SEQ_TYPE_MOVIE:
+                                       case SEQ_TYPE_COLOR:
                                                adrcode = SEQ_FAC_OPACITY;
                                                break;
-                                       case SEQ_SPEED:
+                                       case SEQ_TYPE_SPEED:
                                                adrcode = SEQ_FAC_SPEED;
                                                break;
                                }
index 8d67d3bd02dd074bd9bcb20335f77c76f58f4ff7..84d6141b470316d532afda712bcf7e5ba2dee4ec 100644 (file)
@@ -916,7 +916,17 @@ int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
 
 void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, int *height)
 {
+#if 0
+       /* originally was needed to support image sequences with different image dimensions,
+        * which might be useful for such things as reconstruction of unordered image sequence,
+        * or painting/rotoscoping of non-equal-sized images, but this ended up in unneeded
+        * cache lookups and even unwanted non-proxied files loading when doing mask parenting,
+        * so let's disable this for now and assume image sequence consists of images with
+        * equal sizes (sergey)
+        */
        if (user->framenr == clip->lastframe) {
+#endif
+       if (clip->lastsize[0] != 0 && clip->lastsize[1] != 0) {
                *width = clip->lastsize[0];
                *height = clip->lastsize[1];
        }
index 4b6c362cd8525a0997b6441a6a9a73168ba6f77a..5e41c009fd3bd9086ecdcdca9116f00c6f8cce35 100644 (file)
@@ -2987,12 +2987,12 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
        rval.copy = NULL;
 
        switch (sequence_type) {
-               case SEQ_CROSS:
+               case SEQ_TYPE_CROSS:
                        rval.execute = do_cross_effect;
                        rval.early_out = early_out_fade;
                        rval.get_default_fac = get_default_fac_fade;
                        break;
-               case SEQ_GAMCROSS:
+               case SEQ_TYPE_GAMCROSS:
                        rval.init = init_gammacross;
                        rval.load = load_gammacross;
                        rval.free = free_gammacross;
@@ -3000,30 +3000,30 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
                        rval.get_default_fac = get_default_fac_fade;
                        rval.execute = do_gammacross_effect;
                        break;
-               case SEQ_ADD:
+               case SEQ_TYPE_ADD:
                        rval.execute = do_add_effect;
                        rval.early_out = early_out_mul_input2;
                        break;
-               case SEQ_SUB:
+               case SEQ_TYPE_SUB:
                        rval.execute = do_sub_effect;
                        rval.early_out = early_out_mul_input2;
                        break;
-               case SEQ_MUL:
+               case SEQ_TYPE_MUL:
                        rval.execute = do_mul_effect;
                        rval.early_out = early_out_mul_input2;
                        break;
-               case SEQ_ALPHAOVER:
+               case SEQ_TYPE_ALPHAOVER:
                        rval.init = init_alpha_over_or_under;
                        rval.execute = do_alphaover_effect;
                        break;
-               case SEQ_OVERDROP:
+               case SEQ_TYPE_OVERDROP:
                        rval.execute = do_overdrop_effect;
                        break;
-               case SEQ_ALPHAUNDER:
+               case SEQ_TYPE_ALPHAUNDER:
                        rval.init = init_alpha_over_or_under;
                        rval.execute = do_alphaunder_effect;
                        break;
-               case SEQ_WIPE:
+               case SEQ_TYPE_WIPE:
                        rval.init = init_wipe_effect;
                        rval.num_inputs = num_inputs_wipe;
                        rval.free = free_wipe_effect;
@@ -3032,21 +3032,21 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
                        rval.get_default_fac = get_default_fac_fade;
                        rval.execute = do_wipe_effect;
                        break;
-               case SEQ_GLOW:
+               case SEQ_TYPE_GLOW:
                        rval.init = init_glow_effect;
                        rval.num_inputs = num_inputs_glow;
                        rval.free = free_glow_effect;
                        rval.copy = copy_glow_effect;
                        rval.execute = do_glow_effect;
                        break;
-               case SEQ_TRANSFORM:
+               case SEQ_TYPE_TRANSFORM:
                        rval.init = init_transform_effect;
                        rval.num_inputs = num_inputs_transform;
                        rval.free = free_transform_effect;
                        rval.copy = copy_transform_effect;
                        rval.execute = do_transform_effect;
                        break;
-               case SEQ_SPEED:
+               case SEQ_TYPE_SPEED:
                        rval.init = init_speed_effect;
                        rval.num_inputs = num_inputs_speed;
                        rval.load = load_speed_effect;
@@ -3056,7 +3056,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
                        rval.early_out = early_out_speed;
                        rval.store_icu_yrange = store_icu_yrange_speed;
                        break;
-               case SEQ_COLOR:
+               case SEQ_TYPE_COLOR:
                        rval.init = init_solid_color;
                        rval.num_inputs = num_inputs_color;
                        rval.early_out = early_out_color;
@@ -3064,12 +3064,12 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
                        rval.copy = copy_solid_color;
                        rval.execute = do_solid_color;
                        break;
-               case SEQ_MULTICAM:
+               case SEQ_TYPE_MULTICAM:
                        rval.num_inputs = num_inputs_multicam;
                        rval.early_out = early_out_multicam;
                        rval.execute = do_multicam;
                        break;
-               case SEQ_ADJUSTMENT:
+               case SEQ_TYPE_ADJUSTMENT:
                        rval.num_inputs = num_inputs_adjustment;
                        rval.early_out = early_out_adjustment;
                        rval.execute = do_adjustment;
@@ -3084,7 +3084,7 @@ struct SeqEffectHandle get_sequence_effect(Sequence *seq)
 {
        struct SeqEffectHandle rval = {NULL};
 
-       if (seq->type & SEQ_EFFECT) {
+       if (seq->type & SEQ_TYPE_EFFECT) {
                rval = get_sequence_effect_impl(seq->type);
                if ((seq->flag & SEQ_EFFECT_NOT_LOADED) != 0) {
                        rval.load(seq);
index 5318c5514ca00575aeca50d66021dafe397a8387..699e0b1cd97f8fe346f35d8591229a96a3cf17a8 100644 (file)
@@ -178,7 +178,7 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
 
        if (seq->anim) IMB_free_anim(seq->anim);
 
-       if (seq->type & SEQ_EFFECT) {
+       if (seq->type & SEQ_TYPE_EFFECT) {
                struct SeqEffectHandle sh = get_sequence_effect(seq);
 
                sh.free(seq);
@@ -195,7 +195,7 @@ void seq_free_sequence(Scene *scene, Sequence *seq)
                if (ed->act_seq == seq)
                        ed->act_seq = NULL;
 
-               if (seq->scene_sound && ELEM(seq->type, SEQ_SOUND, SEQ_SCENE))
+               if (seq->scene_sound && ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE))
                        sound_remove_scene_sound(scene, seq->scene_sound);
 
                seq_free_animdata(scene, seq);
@@ -543,10 +543,10 @@ static void seq_update_sound_bounds_recursive_rec(Scene *scene, Sequence *metase
        /* for sound we go over full meta tree to update bounds of the sound strips,
         * since sound is played outside of evaluating the imbufs, */
        for (seq = metaseq->seqbase.first; seq; seq = seq->next) {
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        seq_update_sound_bounds_recursive_rec(scene, seq, MAX2(start, metaseq_start(seq)), MIN2(end, metaseq_end(seq)));
                }
-               else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+               else if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE)) {
                        if (seq->scene_sound) {
                                int startofs = seq->startofs;
                                int endofs = seq->endofs;
@@ -582,10 +582,10 @@ void calc_sequence_disp(Scene *scene, Sequence *seq)
                seq->handsize = (float)((seq->enddisp - seq->startdisp) / 25);
        }
 
-       if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+       if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE)) {
                seq_update_sound_bounds(scene, seq);
        }
-       else if (seq->type == SEQ_META)
+       else if (seq->type == SEQ_TYPE_META)
                seq_update_sound_bounds_recursive(scene, seq);
 }
 
@@ -603,7 +603,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
 
        /* effects and meta: automatic start and end */
 
-       if (seq->type & SEQ_EFFECT) {
+       if (seq->type & SEQ_TYPE_EFFECT) {
                /* pointers */
                if (seq->seq2 == NULL) seq->seq2 = seq->seq1;
                if (seq->seq3 == NULL) seq->seq3 = seq->seq1;
@@ -641,7 +641,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
                }
        }
        else {
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        seqm = seq->seqbase.first;
                        if (seqm) {
                                min =  MAXFRAME * 2;
@@ -669,7 +669,10 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
        int prev_startdisp = 0, prev_enddisp = 0;
        /* note: don't rename the strip, will break animation curves */
 
-       if (ELEM6(seq->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_SOUND, SEQ_SCENE, SEQ_META, SEQ_MOVIECLIP) == 0) {
+       if (ELEM6(seq->type,
+                 SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM,
+                 SEQ_TYPE_SCENE, SEQ_TYPE_META, SEQ_TYPE_MOVIECLIP) == 0)
+       {
                return;
        }
 
@@ -681,7 +684,7 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
        }
 
        switch (seq->type) {
-               case SEQ_IMAGE:
+               case SEQ_TYPE_IMAGE:
                {
                        /* Hack? */
                        size_t olen = MEM_allocN_len(seq->strip->stripdata) / sizeof(struct StripElem);
@@ -694,7 +697,7 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
                        }
                        break;
                }
-               case SEQ_MOVIE:
+               case SEQ_TYPE_MOVIE:
                        BLI_join_dirfile(str, sizeof(str), seq->strip->dir,
                                         seq->strip->stripdata->name);
                        BLI_path_abs(str, G.main->name);
@@ -719,7 +722,7 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
                                seq->len = 0;
                        }
                        break;
-               case SEQ_MOVIECLIP:
+               case SEQ_TYPE_MOVIECLIP:
                        seq->len = BKE_movieclip_get_duration(seq->clip);
 
                        seq->len -= seq->anim_startofs;
@@ -728,7 +731,7 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
                                seq->len = 0;
                        }
                        break;
-               case SEQ_SOUND:
+               case SEQ_TYPE_SOUND_RAM:
 #ifdef WITH_AUDASPACE
                        if (!seq->sound)
                                return;
@@ -742,7 +745,7 @@ void reload_sequence_new_file(Scene *scene, Sequence *seq, int lock_range)
                        return;
 #endif
                        break;
-               case SEQ_SCENE:
+               case SEQ_TYPE_SCENE:
                {
                        seq->len = (seq->scene) ? seq->scene->r.efra - seq->scene->r.sfra + 1 : 0;
                        seq->len -= seq->anim_startofs;
@@ -781,7 +784,7 @@ void BKE_sequencer_sort(Scene *scene)
        while ( (seq = ed->seqbasep->first) ) {
                BLI_remlink(ed->seqbasep, seq);
 
-               if (seq->type & SEQ_EFFECT) {
+               if (seq->type & SEQ_TYPE_EFFECT) {
                        seqt = effbase.first;
                        while (seqt) {
                                if (seqt->machine >= seq->machine) {
@@ -895,27 +898,27 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
 static const char *give_seqname_by_type(int type)
 {
        switch (type) {
-               case SEQ_META:       return "Meta";
-               case SEQ_IMAGE:      return "Image";
-               case SEQ_SCENE:      return "Scene";
-               case SEQ_MOVIE:      return "Movie";
-               case SEQ_MOVIECLIP:  return "Clip";
-               case SEQ_SOUND:      return "Audio";
-               case SEQ_CROSS:      return "Cross";
-               case SEQ_GAMCROSS:   return "Gamma Cross";
-               case SEQ_ADD:        return "Add";
-               case SEQ_SUB:        return "Sub";
-               case SEQ_MUL:        return "Mul";
-               case SEQ_ALPHAOVER:  return "Alpha Over";
-               case SEQ_ALPHAUNDER: return "Alpha Under";
-               case SEQ_OVERDROP:   return "Over Drop";
-               case SEQ_WIPE:       return "Wipe";
-               case SEQ_GLOW:       return "Glow";
-               case SEQ_TRANSFORM:  return "Transform";
-               case SEQ_COLOR:      return "Color";
-               case SEQ_MULTICAM:   return "Multicam";
-               case SEQ_ADJUSTMENT: return "Adjustment";
-               case SEQ_SPEED:      return "Speed";
+               case SEQ_TYPE_META:       return "Meta";
+               case SEQ_TYPE_IMAGE:      return "Image";
+               case SEQ_TYPE_SCENE:      return "Scene";
+               case SEQ_TYPE_MOVIE:      return "Movie";
+               case SEQ_TYPE_MOVIECLIP:  return "Clip";
+               case SEQ_TYPE_SOUND_RAM:      return "Audio";
+               case SEQ_TYPE_CROSS:      return "Cross";
+               case SEQ_TYPE_GAMCROSS:   return "Gamma Cross";
+               case SEQ_TYPE_ADD:        return "Add";
+               case SEQ_TYPE_SUB:        return "Sub";
+               case SEQ_TYPE_MUL:        return "Mul";
+               case SEQ_TYPE_ALPHAOVER:  return "Alpha Over";
+               case SEQ_TYPE_ALPHAUNDER: return "Alpha Under";
+               case SEQ_TYPE_OVERDROP:   return "Over Drop";
+               case SEQ_TYPE_WIPE:       return "Wipe";
+               case SEQ_TYPE_GLOW:       return "Glow";
+               case SEQ_TYPE_TRANSFORM:  return "Transform";
+               case SEQ_TYPE_COLOR:      return "Color";
+               case SEQ_TYPE_MULTICAM:   return "Multicam";
+               case SEQ_TYPE_ADJUSTMENT: return "Adjustment";
+               case SEQ_TYPE_SPEED:      return "Speed";
                default:
                        return NULL;
        }
@@ -926,7 +929,7 @@ const char *give_seqname(Sequence *seq)
        const char *name = give_seqname_by_type(seq->type);
 
        if (!name) {
-               if (seq->type < SEQ_EFFECT) {
+               if (seq->type < SEQ_TYPE_EFFECT) {
                        return seq->strip->dir;
                }
                else {
@@ -1008,7 +1011,7 @@ static float give_stripelem_index(Sequence *seq, float cfra)
        int sta = seq->start;
        int end = seq->start + seq->len - 1;
 
-       if (seq->type & SEQ_EFFECT) {
+       if (seq->type & SEQ_TYPE_EFFECT) {
                end = seq->enddisp;
        } 
 
@@ -1041,7 +1044,7 @@ StripElem *give_stripelem(Sequence *seq, int cfra)
 {
        StripElem *se = seq->strip->stripdata;
 
-       if (seq->type == SEQ_IMAGE) { /* only
+       if (seq->type == SEQ_TYPE_IMAGE) { /* only
                                           * IMAGE strips use the whole array,
                                           * MOVIE strips use only
                                           * the first element, all other strips
@@ -1085,7 +1088,7 @@ int evaluate_seq_frame(Scene *scene, int cfra)
 
 static int video_seq_is_rendered(Sequence *seq)
 {
-       return (seq && !(seq->flag & SEQ_MUTE) && seq->type != SEQ_SOUND);
+       return (seq && !(seq->flag & SEQ_MUTE) && seq->type != SEQ_TYPE_SOUND_RAM);
 }
 
 static int get_shown_sequences(ListBase *seqbasep, int cfra, int chanshown, Sequence **seq_arr_out)
@@ -1231,7 +1234,7 @@ static int seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char *n
        if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR | SEQ_USE_PROXY_CUSTOM_FILE)) {
                BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
        }
-       else if (seq->type == SEQ_IMAGE) {
+       else if (seq->type == SEQ_TYPE_IMAGE) {
                BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
        }
        else {
@@ -1248,7 +1251,7 @@ static int seq_proxy_get_fname(Sequence *seq, int cfra, int render_size, char *n
 
        /* generate a separate proxy directory for each preview size */
 
-       if (seq->type == SEQ_IMAGE) {
+       if (seq->type == SEQ_TYPE_IMAGE) {
                BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
                             render_size,
                             give_stripelem(seq, cfra)->name);
@@ -1393,7 +1396,7 @@ struct SeqIndexBuildContext *seq_proxy_rebuild_context(Main *bmain, Scene *scene
        context->orig_seq = seq;
        context->seq = nseq;
 
-       if (nseq->type == SEQ_MOVIE) {
+       if (nseq->type == SEQ_TYPE_MOVIE) {
                seq_open_anim_file(nseq);
 
                if (nseq->anim) {
@@ -1412,7 +1415,7 @@ void seq_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_upd
        Scene *scene = context->scene;
        int cfra;
 
-       if (seq->type == SEQ_MOVIE) {
+       if (seq->type == SEQ_TYPE_MOVIE) {
                if (context->index_context) {
                        IMB_anim_index_rebuild(context->index_context, stop, do_update, progress);
                }
@@ -1642,7 +1645,7 @@ static void color_balance(Sequence *seq, ImBuf *ibuf, float mul)
 }
 
 /*
- *  input preprocessing for SEQ_IMAGE, SEQ_MOVIE, SEQ_MOVIECLIP and SEQ_SCENE
+ *  input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE
  *
  *  Do all the things you can't really do afterwards using sequence effects
  *  (read: before rescaling to render resolution has been done)
@@ -1696,7 +1699,7 @@ static ImBuf *input_preprocess(
        ibuf = IMB_makeSingleUser(ibuf);
 
        if ((seq->flag & SEQ_FILTERY) &&
-           !ELEM(seq->type, SEQ_MOVIE, SEQ_MOVIECLIP))
+           !ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP))
        {
                IMB_filtery(ibuf);
        }
@@ -2126,7 +2129,8 @@ static ImBuf *seq_render_scene_strip(
        
        if (sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (scene == context.scene || have_seq == 0) && camera) {
                char err_out[256] = "unknown";
-               /* for old scened this can be uninitialized, should probably be added to do_versions at some point if the functionality stays */
+               /* for old scened this can be uninitialized,
+                * should probably be added to do_versions at some point if the functionality stays */
                if (context.scene->r.seq_prev_type == 0)
                        context.scene->r.seq_prev_type = 3 /* ==OB_SOLID */; 
 
@@ -2204,8 +2208,8 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
        int is_proxy_image = FALSE;
        float nr = give_stripelem_index(seq, cfra);
        /* all effects are handled similarly with the exception of speed effect */
-       int type = (seq->type & SEQ_EFFECT && seq->type != SEQ_SPEED) ? SEQ_EFFECT : seq->type;
-       int is_preprocessed = !ELEM3(type, SEQ_IMAGE, SEQ_MOVIE, SEQ_SCENE);
+       int type = (seq->type & SEQ_TYPE_EFFECT && seq->type != SEQ_TYPE_SPEED) ? SEQ_TYPE_EFFECT : seq->type;
+       int is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE);
 
        ibuf = seq_stripelem_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF);
 
@@ -2218,13 +2222,13 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
                ibuf = copy_from_ibuf_still(context, seq, nr);
        
        /* MOVIECLIPs have their own proxy management */
-       if (ibuf == NULL && seq->type != SEQ_MOVIECLIP) {
+       if (ibuf == NULL && seq->type != SEQ_TYPE_MOVIECLIP) {
                ibuf = seq_proxy_fetch(context, seq, cfra);
                is_proxy_image = (ibuf != NULL);
        }
 
        if (ibuf == NULL) switch (type) {
-                       case SEQ_META:
+                       case SEQ_TYPE_META:
                        {
                                ImBuf *meta_ibuf = NULL;
 
@@ -2246,7 +2250,7 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
 
                                break;
                        }
-                       case SEQ_SPEED:
+                       case SEQ_TYPE_SPEED:
                        {
                                ImBuf *child_ibuf = NULL;
 
@@ -2272,13 +2276,13 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
                                }
                                break;
                        }
-                       case SEQ_EFFECT:
+                       case SEQ_TYPE_EFFECT:
                        {
                                ibuf = seq_render_effect_strip_impl(
                                        context, seq, seq->start + nr);
                                break;
                        }
-                       case SEQ_IMAGE:
+                       case SEQ_TYPE_IMAGE:
                        {
                                StripElem *s_elem = give_stripelem(seq, cfra);
 
@@ -2303,7 +2307,7 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
                                }
                                break;
                        }
-                       case SEQ_MOVIE:
+                       case SEQ_TYPE_MOVIE:
                        {
                                seq_open_anim_file(seq);
 
@@ -2330,7 +2334,7 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
                                copy_to_ibuf_still(context, seq, nr, ibuf);
                                break;
                        }
-                       case SEQ_SCENE:
+                       case SEQ_TYPE_SCENE:
                        { // scene can be NULL after deletions
                                ibuf = seq_render_scene_strip(context, seq, nr);
 
@@ -2340,7 +2344,7 @@ static ImBuf *seq_render_strip(SeqRenderData context, Sequence *seq, float cfra)
                                copy_to_ibuf_still(context, seq, nr, ibuf);
                                break;
                        }
-                       case SEQ_MOVIECLIP:
+                       case SEQ_TYPE_MOVIECLIP:
                        {
                                ibuf = seq_render_movieclip_strip(context, seq, nr);
 
@@ -2383,7 +2387,7 @@ static int seq_must_swap_input_in_blend_mode(Sequence *seq)
        /* bad hack, to fix crazy input ordering of 
         * those two effects */
 
-       if (ELEM3(seq->blend_mode, SEQ_ALPHAOVER, SEQ_ALPHAUNDER, SEQ_OVERDROP)) {
+       if (ELEM3(seq->blend_mode, SEQ_TYPE_ALPHAOVER, SEQ_TYPE_ALPHAUNDER, SEQ_TYPE_OVERDROP)) {
                swap_input = TRUE;
        }
        
@@ -2567,7 +2571,7 @@ ImBuf *give_ibuf_seq_direct(SeqRenderData context, float cfra, Sequence *seq)
 /* check used when we need to change seq->blend_mode but not to effect or audio strips */
 static int seq_can_blend(Sequence *seq)
 {
-       if (ELEM4(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE)) {
+       if (ELEM4(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_META, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIE)) {
                return 1;
        }
        else {
@@ -2949,16 +2953,16 @@ void free_imbuf_seq(Scene *scene, ListBase *seqbase, int check_mem_usage,
        
        for (seq = seqbase->first; seq; seq = seq->next) {
                if (seq->strip) {
-                       if (seq->type == SEQ_MOVIE && !keep_file_handles)
+                       if (seq->type == SEQ_TYPE_MOVIE && !keep_file_handles)
                                free_anim_seq(seq);
-                       if (seq->type == SEQ_SPEED) {
+                       if (seq->type == SEQ_TYPE_SPEED) {
                                sequence_effect_speed_rebuild_map(scene, seq, 1);
                        }
                }
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        free_imbuf_seq(scene, &seq->seqbase, FALSE, keep_file_handles);
                }
-               if (seq->type == SEQ_SCENE) {
+               if (seq->type == SEQ_TYPE_SCENE) {
                        /* FIXME: recurs downwards, 
                         * but do recurs protection somehow! */
                }
@@ -2995,9 +2999,9 @@ static int update_changed_seq_recurs(Scene *scene, Sequence *seq, Sequence *chan
        
        if (free_imbuf) {
                if (ibuf_change) {
-                       if (seq->type == SEQ_MOVIE)
+                       if (seq->type == SEQ_TYPE_MOVIE)
                                free_anim_seq(seq);
-                       if (seq->type == SEQ_SPEED) {
+                       if (seq->type == SEQ_TYPE_SPEED) {
                                sequence_effect_speed_rebuild_map(scene, seq, 1);
                        }
                }
@@ -3086,8 +3090,8 @@ void seq_tx_set_final_right(Sequence *seq, int val)
 int seq_single_check(Sequence *seq)
 {
        return ((seq->len == 1) &&
-               (seq->type == SEQ_IMAGE ||
-                ((seq->type & SEQ_EFFECT) &&
+               (seq->type == SEQ_TYPE_IMAGE ||
+                ((seq->type & SEQ_TYPE_EFFECT) &&
                  get_sequence_effect_num_inputs(seq->type) == 0)));
 }
 
@@ -3110,7 +3114,7 @@ int seqbase_isolated_sel_check(ListBase *seqbase)
 
        /* test relationships */
        for (seq = seqbase->first; seq; seq = seq->next) {
-               if ((seq->type & SEQ_EFFECT) == 0)
+               if ((seq->type & SEQ_TYPE_EFFECT) == 0)
                        continue;
 
                if (seq->flag & SELECT) {
@@ -3173,7 +3177,7 @@ void seq_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag)
        }
 
        /* sounds cannot be extended past their endpoints */
-       if (seq->type == SEQ_SOUND) {
+       if (seq->type == SEQ_TYPE_SOUND_RAM) {
                seq->startstill = 0;
                seq->endstill = 0;
        }
@@ -3199,7 +3203,7 @@ void seq_single_fix(Sequence *seq)
 
 int seq_tx_test(Sequence *seq)
 {
-       return (seq->type < SEQ_EFFECT) || (get_sequence_effect_num_inputs(seq->type) == 0);
+       return (seq->type < SEQ_TYPE_EFFECT) || (get_sequence_effect_num_inputs(seq->type) == 0);
 }
 
 static int seq_overlap(Sequence *seq1, Sequence *seq2)
@@ -3228,7 +3232,7 @@ void seq_translate(Scene *evil_scene, Sequence *seq, int delta)
        seq_offset_animdata(evil_scene, seq, delta);
        seq->start += delta;
 
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                Sequence *seq_child;
                for (seq_child = seq->seqbase.first; seq_child; seq_child = seq_child->next) {
                        seq_translate(evil_scene, seq_child, delta);
@@ -3240,7 +3244,7 @@ void seq_translate(Scene *evil_scene, Sequence *seq, int delta)
 
 void seq_sound_init(Scene *scene, Sequence *seq)
 {
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                Sequence *seq_child;
                for (seq_child = seq->seqbase.first; seq_child; seq_child = seq_child->next) {
                        seq_sound_init(scene, seq_child);
@@ -3268,7 +3272,7 @@ Sequence *seq_foreground_frame_get(Scene *scene, int frame)
                if (seq->flag & SEQ_MUTE || seq->startdisp > frame || seq->enddisp <= frame)
                        continue;
                /* only use elements you can see - not */
-               if (ELEM5(seq->type, SEQ_IMAGE, SEQ_META, SEQ_SCENE, SEQ_MOVIE, SEQ_COLOR)) {
+               if (ELEM5(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_META, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIE, SEQ_TYPE_COLOR)) {
                        if (seq->machine > best_machine) {
                                best_seq = seq;
                                best_machine = seq->machine;
@@ -3394,10 +3398,10 @@ void seq_update_sound_bounds_all(Scene *scene)
                Sequence *seq;
 
                for (seq = ed->seqbase.first; seq; seq = seq->next) {
-                       if (seq->type == SEQ_META) {
+                       if (seq->type == SEQ_TYPE_META) {
                                seq_update_sound_bounds_recursive(scene, seq);
                        }
-                       else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+                       else if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE)) {
                                seq_update_sound_bounds(scene, seq);
                        }
                }
@@ -3420,7 +3424,7 @@ static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, i
        for (seq = seqbasep->first; seq; seq = seq->next) {
                seqmute = (mute || (seq->flag & SEQ_MUTE));
 
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        /* if this is the current meta sequence, unmute because
                         * all sequences above this were set to mute */
                        if (seq == metaseq)
@@ -3428,7 +3432,7 @@ static void seq_update_muting_recursive(ListBase *seqbasep, Sequence *metaseq, i
 
                        seq_update_muting_recursive(&seq->seqbase, metaseq, seqmute);
                }
-               else if (ELEM(seq->type, SEQ_SOUND, SEQ_SCENE)) {
+               else if (ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SCENE)) {
                        if (seq->scene_sound) {
                                sound_mute_scene_sound(seq->scene_sound, seqmute);
                        }
@@ -3454,10 +3458,10 @@ static void seq_update_sound_recursive(Scene *scene, ListBase *seqbasep, bSound
        Sequence *seq;
 
        for (seq = seqbasep->first; seq; seq = seq->next) {
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        seq_update_sound_recursive(scene, &seq->seqbase, sound);
                }
-               else if (seq->type == SEQ_SOUND) {
+               else if (seq->type == SEQ_TYPE_SOUND_RAM) {
                        if (seq->scene_sound && sound == seq->sound) {
                                sound_update_scene_sound(seq->scene_sound, sound);
                        }
@@ -3521,18 +3525,18 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
 
        /* type checking, could be more advanced but disalow sound vs non-sound copy */
        if (seq_a->type != seq_b->type) {
-               if (seq_a->type == SEQ_SOUND || seq_b->type == SEQ_SOUND) {
+               if (seq_a->type == SEQ_TYPE_SOUND_RAM || seq_b->type == SEQ_TYPE_SOUND_RAM) {
                        *error_str = "Strips were not compatible";
                        return 0;
                }
 
                /* disallow effects to swap with non-effects strips */
-               if ((seq_a->type & SEQ_EFFECT) != (seq_b->type & SEQ_EFFECT)) {
+               if ((seq_a->type & SEQ_TYPE_EFFECT) != (seq_b->type & SEQ_TYPE_EFFECT)) {
                        *error_str = "Strips were not compatible";
                        return 0;
                }
 
-               if ((seq_a->type & SEQ_EFFECT) && (seq_b->type & SEQ_EFFECT)) {
+               if ((seq_a->type & SEQ_TYPE_EFFECT) && (seq_b->type & SEQ_TYPE_EFFECT)) {
                        if (get_sequence_effect_num_inputs(seq_a->type) != get_sequence_effect_num_inputs(seq_b->type)) {
                                *error_str = "Strips must have the same number of inputs";
                                return 0;
@@ -3769,8 +3773,8 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
        Strip *strip;
 
        seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
-       seq->type = SEQ_IMAGE;
-       seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+       seq->type = SEQ_TYPE_IMAGE;
+       seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
        
        /* basic defaults */
        seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
@@ -3818,7 +3822,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
 
        seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
 
-       seq->type = SEQ_SOUND;
+       seq->type = SEQ_TYPE_SOUND_RAM;
        seq->sound = sound;
        BLI_strncpy(seq->name + 2, "Sound", SEQ_NAME_MAXSTR - 2);
        seqbase_unique_name_recursive(&scene->ed->seqbase, seq);
@@ -3874,8 +3878,8 @@ Sequence *sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo
                return NULL;
 
        seq = alloc_sequence(seqbasep, seq_load->start_frame, seq_load->channel);
-       seq->type = SEQ_MOVIE;
-       seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+       seq->type = SEQ_TYPE_MOVIE;
+       seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
 
        seq->anim = an;
        seq->anim_preseek = IMB_anim_get_preseek(an);
@@ -3942,24 +3946,24 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence
                seqn->strip->color_balance = MEM_dupallocN(seq->strip->color_balance);
        }
 
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                seqn->strip->stripdata = NULL;
 
                seqn->seqbase.first = seqn->seqbase.last = NULL;
                /* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */
                /* - seq_dupli_recursive(&seq->seqbase,&seqn->seqbase);*/
        }
-       else if (seq->type == SEQ_SCENE) {
+       else if (seq->type == SEQ_TYPE_SCENE) {
                seqn->strip->stripdata = NULL;
                if (seq->scene_sound)
                        seqn->scene_sound = sound_scene_add_scene_sound_defaults(sce_audio, seqn);
        }
-       else if (seq->type == SEQ_MOVIE) {
+       else if (seq->type == SEQ_TYPE_MOVIE) {
                seqn->strip->stripdata =
                        MEM_dupallocN(seq->strip->stripdata);
                seqn->anim = NULL;
        }
-       else if (seq->type == SEQ_SOUND) {
+       else if (seq->type == SEQ_TYPE_SOUND_RAM) {
                seqn->strip->stripdata =
                        MEM_dupallocN(seq->strip->stripdata);
                if (seq->scene_sound)
@@ -3967,16 +3971,16 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence
 
                seqn->sound->id.us++;
        }
-       else if (seq->type == SEQ_IMAGE) {
+       else if (seq->type == SEQ_TYPE_IMAGE) {
                seqn->strip->stripdata =
                        MEM_dupallocN(seq->strip->stripdata);
        }
-       else if (seq->type >= SEQ_EFFECT) {
+       else if (seq->type >= SEQ_TYPE_EFFECT) {
                if (seq->seq1 && seq->seq1->tmp) seqn->seq1 = seq->seq1->tmp;
                if (seq->seq2 && seq->seq2->tmp) seqn->seq2 = seq->seq2->tmp;
                if (seq->seq3 && seq->seq3->tmp) seqn->seq3 = seq->seq3->tmp;
 
-               if (seq->type & SEQ_EFFECT) {
+               if (seq->type & SEQ_TYPE_EFFECT) {
                        struct SeqEffectHandle sh;
                        sh = get_sequence_effect(seq);
                        if (sh.copy)
@@ -4004,7 +4008,7 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence
 Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, Sequence *seq, int dupe_flag)
 {
        Sequence *seqn = seq_dupli(scene, scene_to, seq, dupe_flag);
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                Sequence *s;
                for (s = seq->seqbase.first; s; s = s->next) {
                        Sequence *n = seq_dupli_recursive(scene, scene_to, s, dupe_flag);
@@ -4033,7 +4037,7 @@ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase,
                                }
 
                                BLI_addtail(nseqbase, seqn);
-                               if (seq->type == SEQ_META)
+                               if (seq->type == SEQ_TYPE_META)
                                        seqbase_dupli_recursive(scene, scene_to, &seqn->seqbase, &seq->seqbase, dupe_flag);
 
                                if (dupe_flag & SEQ_DUPE_CONTEXT) {
index e6c51ca0786d6aa0fd64933d9d98673b8925cee0..f458c158fb23a14599f1b497f8ca4595341916be 100644 (file)
@@ -508,11 +508,11 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
                                SEQ_BEGIN(scene->ed, seq)
                                {
                                        if (SEQ_HAS_PATH(seq)) {
-                                               if (ELEM(seq->type, SEQ_MOVIE, SEQ_SOUND)) {
+                                               if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM)) {
                                                        rewrite_path_fixed_dirfile(seq->strip->dir, seq->strip->stripdata->name,
                                                                                   visit_cb, absbase, bpath_user_data);
                                                }
-                                               else if (seq->type == SEQ_IMAGE) {
+                                               else if (seq->type == SEQ_TYPE_IMAGE) {
                                                        /* might want an option not to loop over all strips */
                                                        StripElem *se = seq->strip->stripdata;
                                                        int len = MEM_allocN_len(se) / sizeof(*se);
index cc5abce64f3c886735b81ce65c60c64a79f0081e..b1a3150ff249d1da564e54c3b62080abf8e02059 100644 (file)
@@ -4831,8 +4831,8 @@ static void lib_link_scene(FileData *fd, Main *main)
                                if (seq->scene_camera) seq->scene_camera = newlibadr(fd, sce->id.lib, seq->scene_camera);
                                if (seq->sound) {
                                        seq->scene_sound = NULL;
-                                       if (seq->type == SEQ_HD_SOUND)
-                                               seq->type = SEQ_SOUND;
+                                       if (seq->type == SEQ_TYPE_SOUND_HD)
+                                               seq->type = SEQ_TYPE_SOUND_RAM;
                                        else
                                                seq->sound = newlibadr(fd, sce->id.lib, seq->sound);
                                        if (seq->sound) {
@@ -4957,10 +4957,10 @@ static void direct_link_scene(FileData *fd, Scene *sce)
                        
                        seq->effectdata = newdataadr(fd, seq->effectdata);
                        
-                       if (seq->type & SEQ_EFFECT)
+                       if (seq->type & SEQ_TYPE_EFFECT)
                                seq->flag |= SEQ_EFFECT_NOT_LOADED;
                        
-                       if (seq->type == SEQ_SPEED) {
+                       if (seq->type == SEQ_TYPE_SPEED) {
                                SpeedControlVars *s = seq->effectdata;
                                s->frameMap = NULL;
                        }
@@ -4969,7 +4969,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
                        if (seq->strip && seq->strip->done==0) {
                                seq->strip->done = TRUE;
                                
-                               if (ELEM4(seq->type, SEQ_IMAGE, SEQ_MOVIE, SEQ_RAM_SOUND, SEQ_HD_SOUND)) {
+                               if (ELEM4(seq->type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD)) {
                                        seq->strip->stripdata = newdataadr(fd, seq->strip->stripdata);
                                }
                                else {
index 620d15993a1fff4b7f0a55be15e95e50f6fa4de7..5ed39ad5307786084b9e74f8768cf2a94a763f04 100644 (file)
@@ -744,7 +744,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
                        if (scene->ed && scene->ed->seqbasep) {
                                SEQ_BEGIN (scene->ed, seq)
                                {
-                                       if (seq->type == SEQ_HD_SOUND) {
+                                       if (seq->type == SEQ_TYPE_SOUND_HD) {
                                                char str[FILE_MAX];
                                                BLI_join_dirfile(str, sizeof(str), seq->strip->dir, seq->strip->stripdata->name);
                                                BLI_path_abs(str, main->name);
index 7b314c31488cd4150f74549ee98502f275c690d1..46ef2716ade1234e388ebd056906b8cb1933fc60 100644 (file)
@@ -1842,7 +1842,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
                        if (ed) {
                                SEQ_BEGIN (sce->ed, seq)
                                {
-                                       if (seq->type == SEQ_IMAGE || seq->type == SEQ_MOVIE)
+                                       if (seq->type == SEQ_TYPE_IMAGE || seq->type == SEQ_TYPE_MOVIE)
                                                seq->flag |= SEQ_MAKE_PREMUL;
                                }
                                SEQ_END
index 74287f0e6935e697c53e29097600aea98e474bd4..e54ae41286da0b2b0f767742b1c0e678d4abadcb 100644 (file)
@@ -2153,19 +2153,19 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
                                        
                                        if (seq->effectdata) {
                                                switch (seq->type) {
-                                               case SEQ_COLOR:
+                                               case SEQ_TYPE_COLOR:
                                                        writestruct(wd, DATA, "SolidColorVars", 1, seq->effectdata);
                                                        break;
-                                               case SEQ_SPEED:
+                                               case SEQ_TYPE_SPEED:
                                                        writestruct(wd, DATA, "SpeedControlVars", 1, seq->effectdata);
                                                        break;
-                                               case SEQ_WIPE:
+                                               case SEQ_TYPE_WIPE:
                                                        writestruct(wd, DATA, "WipeVars", 1, seq->effectdata);
                                                        break;
-                                               case SEQ_GLOW:
+                                               case SEQ_TYPE_GLOW:
                                                        writestruct(wd, DATA, "GlowVars", 1, seq->effectdata);
                                                        break;
-                                               case SEQ_TRANSFORM:
+                                               case SEQ_TYPE_TRANSFORM:
                                                        writestruct(wd, DATA, "TransformVars", 1, seq->effectdata);
                                                        break;
                                                }
@@ -2185,9 +2185,9 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
                                        if (seq->flag & SEQ_USE_COLOR_BALANCE && strip->color_balance) {
                                                writestruct(wd, DATA, "StripColorBalance", 1, strip->color_balance);
                                        }
-                                       if (seq->type==SEQ_IMAGE)
+                                       if (seq->type==SEQ_TYPE_IMAGE)
                                                writestruct(wd, DATA, "StripElem", MEM_allocN_len(strip->stripdata) / sizeof(struct StripElem), strip->stripdata);
-                                       else if (seq->type==SEQ_MOVIE || seq->type==SEQ_RAM_SOUND || seq->type == SEQ_HD_SOUND)
+                                       else if (seq->type==SEQ_TYPE_MOVIE || seq->type==SEQ_TYPE_SOUND_RAM || seq->type == SEQ_TYPE_SOUND_HD)
                                                writestruct(wd, DATA, "StripElem", 1, strip->stripdata);
                                        
                                        strip->done = TRUE;
index 9d59be39f33d817dd4a0441cd69c33ee51b03737..107a3fc5796752f63572543be19ca0d96510c756 100644 (file)
 
 #include "BKE_action.h"
 #include "BKE_armature.h"
+
+extern "C" {
+#include "BKE_main.h"
+#include "BKE_mesh.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+}
+
 #include "ED_armature.h"
 
 #include "BLI_listbase.h"
@@ -45,6 +53,8 @@
 #include "ArmatureExporter.h"
 #include "SceneExporter.h"
 
+#include "collada_utils.h"
+
 // XXX exporter writes wrong data for shared armatures.  A separate
 // controller should be written for each armature-mesh binding how do
 // we make controller ids then?
@@ -66,12 +76,12 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene* sce,
 
 bool ArmatureExporter::is_skinned_mesh(Object *ob)
 {
-       return get_assigned_armature(ob) != NULL;
+       return bc_get_assigned_armature(ob) != NULL;
 }
 
-void ArmatureExporter::add_instance_controller(Object *ob)
+bool ArmatureExporter::add_instance_controller(Object *ob)
 {
-       Object *ob_arm = get_assigned_armature(ob);
+       Object *ob_arm = bc_get_assigned_armature(ob);
        bArmature *arm = (bArmature*)ob_arm->data;
 
        const std::string& controller_id = get_controller_id(ob_arm, ob);
@@ -79,6 +89,9 @@ void ArmatureExporter::add_instance_controller(Object *ob)
        COLLADASW::InstanceController ins(mSW);
        ins.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, controller_id));
 
+       Mesh *me = (Mesh *)ob->data;
+       if (!me->dvert) return false;
+
        // write root bone URLs
        Bone *bone;
        for (bone = (Bone*)arm->bonebase.first; bone; bone = bone->next) {
@@ -89,6 +102,7 @@ void ArmatureExporter::add_instance_controller(Object *ob)
        InstanceWriter::add_material_bindings(ins.getBindMaterial(), ob);
                
        ins.add();
+       return true;
 }
 
 void ArmatureExporter::export_controllers(Scene *sce)
@@ -105,7 +119,7 @@ void ArmatureExporter::export_controllers(Scene *sce)
 
 void ArmatureExporter::operator()(Object *ob)
 {
-       Object *ob_arm = get_assigned_armature(ob);
+       Object *ob_arm = bc_get_assigned_armature(ob);
 
        if (ob_arm /*&& !already_written(ob_arm)*/)
                export_controller(ob, ob_arm);
@@ -139,27 +153,6 @@ void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<O
 }
 #endif
 
-Object *ArmatureExporter::get_assigned_armature(Object *ob)
-{
-       Object *ob_arm = NULL;
-
-       if (ob->parent && ob->partype == PARSKEL && ob->parent->type == OB_ARMATURE) {
-               ob_arm = ob->parent;
-       }
-       else {
-               ModifierData *mod = (ModifierData*)ob->modifiers.first;
-               while (mod) {
-                       if (mod->type == eModifierType_Armature) {
-                               ob_arm = ((ArmatureModifierData*)mod)->object;
-                       }
-
-                       mod = mod->next;
-               }
-       }
-
-       return ob_arm;
-}
-
 std::string ArmatureExporter::get_joint_sid(Bone *bone, Object *ob_arm)
 {
        return get_joint_id(bone, ob_arm);
@@ -325,7 +318,16 @@ void ArmatureExporter::export_controller(Object* ob, Object *ob_arm)
        */
 
        bool use_instantiation = this->export_settings->use_object_instantiation;
-       Mesh *me = (Mesh*)ob->data;
+       Mesh *me;
+
+       if ( this->export_settings->apply_modifiers ) {
+               me = bc_to_mesh_apply_modifiers(scene, ob);
+       } 
+       else {
+               me = (Mesh*)ob->data;
+       }
+       BKE_mesh_tessface_ensure(me);
+
        if (!me->dvert) return;
 
        std::string controller_name = id_name(ob_arm);
@@ -393,6 +395,10 @@ void ArmatureExporter::export_controller(Object* ob, Object *ob_arm)
        add_joints_element(&ob->defbase, joints_source_id, inv_bind_mat_source_id);
        add_vertex_weights_element(weights_source_id, joints_source_id, vcounts, joints);
 
+       if (this->export_settings->apply_modifiers)
+       {
+               BKE_libblock_free_us(&(G.main->mesh), me);
+       }
        closeSkin();
        closeController();
 }
index e9ee38d36cf118a6467100b6ab091fc77917f0d3..beef77af767b3c1daa20853517652cfed9094575 100644 (file)
@@ -64,7 +64,7 @@ public:
 
        bool is_skinned_mesh(Object *ob);
 
-       void add_instance_controller(Object *ob);
+       bool add_instance_controller(Object *ob);
 
        void export_controllers(Scene *sce);
 
@@ -85,8 +85,6 @@ private:
        void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
 #endif
 
-       Object *get_assigned_armature(Object *ob);
-
        std::string get_joint_sid(Bone *bone, Object *ob_arm);
 
        // Scene, SceneExporter and the list of child_objects
index 19fc30a2790378da5923135dc6430ef4759b74cb..69f302eaec7a93ace09bdff29da669a4fa4f77c5 100644 (file)
@@ -262,8 +262,10 @@ void DocumentExporter::exportCurrentScene(Scene *sce)
 
        // <library_controllers>
        ArmatureExporter arm_exporter(&sw, this->export_settings);
-       if (has_object_type(sce, OB_ARMATURE)) {
-               arm_exporter.export_controllers(sce);
+       if (this->export_settings->include_armatures) {
+               if (has_object_type(sce, OB_ARMATURE)) {
+                       arm_exporter.export_controllers(sce);
+               }
        }
 
        // <library_visual_scenes>
index f0d3f8108310d62b6746f165aee0dc6ac326c1ba..a6ae29bf2b2796e118046acd1d6cd4cace266eb0 100644 (file)
@@ -32,6 +32,7 @@ struct ExportSettings
  public:
  bool selected;
  bool apply_modifiers;
+ bool include_armatures;
  bool include_bone_children;
  bool use_object_instantiation;
  bool second_life;
index 6df16165e4b1212e2a7981dceeef07e0a2d3cb63..53d7f1e64497d2d153f078f042fa126165875d48 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
 #include "BKE_material.h"
 #include "BKE_mesh.h"
 #include "collada_internal.h"
+#include "collada_utils.h"
 
 // TODO: optimize UV sets by making indexed list with duplicates removed
 GeometryExporter::GeometryExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryGeometries(sw), export_settings(export_settings) {}
@@ -65,25 +66,6 @@ void GeometryExporter::exportGeom(Scene *sce)
        closeLibrary();
 }
 
-Mesh * GeometryExporter::get_mesh(Object *ob, int apply_modifiers)
-{
-       Mesh *tmpmesh;
-       if (!apply_modifiers)
-       {
-               tmpmesh = (Mesh*)ob->data;
-       }
-       else
-       {
-               CustomDataMask mask = CD_MASK_MESH;
-               DerivedMesh *dm     = mesh_create_derived_view(mScene, ob, mask);
-               tmpmesh             = BKE_mesh_add("ColladaMesh"); // name is not important here
-               DM_to_mesh(dm, tmpmesh, ob);
-               dm->release(dm);
-       }
-       BKE_mesh_tessface_ensure(tmpmesh);
-       return tmpmesh;
-}
-
 void GeometryExporter::operator()(Object *ob)
 {
        // XXX don't use DerivedMesh, Mesh instead?
@@ -93,7 +75,14 @@ void GeometryExporter::operator()(Object *ob)
 #endif
 
        bool use_instantiation = this->export_settings->use_object_instantiation;
-       Mesh *me = get_mesh(ob, this->export_settings->apply_modifiers);
+       Mesh *me;
+       if ( this->export_settings->apply_modifiers ) {
+               me = bc_to_mesh_apply_modifiers(mScene, ob);
+       } 
+       else {
+               me = (Mesh*)ob->data;
+       }
+       BKE_mesh_tessface_ensure(me);
 
        std::string geom_id = get_geometry_id(ob, use_instantiation);
        std::vector<Normal> nor;
index aae095e819e8528eb964e01fa42ed8a01f8f3d17..23cdcc0a5ba1db5306dedea95f1639c519e7dd2a 100644 (file)
@@ -105,7 +105,7 @@ private:
        
        const ExportSettings *export_settings;
 
-       Mesh * get_mesh(Object *ob, int apply_modifiers);
+       Mesh * get_mesh(Scene *sce, Object *ob, int apply_modifiers);
 };
 
 struct GeometryFunctor {
index d258f4ef5e189e27fe43aa060f3decb3b0af342a..510107272cda1ec1245d0495027bef1c04b8df45 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "SceneExporter.h"
+#include "collada_utils.h"
 
 SceneExporter::SceneExporter(COLLADASW::StreamWriter *sw, ArmatureExporter *arm, const ExportSettings *export_settings)
        : COLLADASW::LibraryVisualScenes(sw), arm_exporter(arm), export_settings(export_settings)
@@ -40,19 +41,36 @@ void SceneExporter::exportScene(Scene *sce)
        closeLibrary();
 }
 
+// Returns true if the parent chain does not contain any selected object
+// Otherwise return false (ob has selected predecessor)
+bool is_exported_base_node(Object *ob, bool selection_only) {
+
+       if (selection_only && ob->flag & SELECT) {
+               // Move up towards root object,
+               // stop at first selected predecessor's child,
+               // or at root, if no parent was selected
+               while (ob->parent && (ob->parent->type==OB_ARMATURE || !(ob->parent->flag & SELECT)))
+               {
+                       ob = ob->parent;
+               }
+       }
+
+       return !ob->parent;
+}
+
 void SceneExporter::exportHierarchy(Scene *sce)
 {
        Base *base= (Base*) sce->base.first;
        while (base) {
                Object *ob = base->object;
 
-               if (!ob->parent) {
+               bool is_export_base_node = is_exported_base_node(ob, this->export_settings->selected);
+               if (is_export_base_node) {
                        if (sce->lay & ob->lay) {
                                switch (ob->type) {
                                        case OB_MESH:
                                        case OB_CAMERA:
                                        case OB_LAMP:
-                                       case OB_ARMATURE:
                                        case OB_EMPTY:
                                                if (this->export_settings->selected && !(ob->flag & SELECT)) {
                                                        break;
@@ -70,6 +88,14 @@ void SceneExporter::exportHierarchy(Scene *sce)
 
 void SceneExporter::writeNodes(Object *ob, Scene *sce)
 {
+
+       // Add associated armature first if available
+       if (this->export_settings->include_armatures) {
+               Object *ob_arm = bc_get_assigned_armature(ob);
+               if(ob_arm != NULL)
+                       writeNodes(ob_arm, sce);
+       }
+
        COLLADASW::Node node(mSW);
        node.setNodeId(translate_id(id_name(ob)));
        node.setNodeName(translate_id(id_name(ob)));
@@ -80,8 +106,19 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
        bool is_skinned_mesh = arm_exporter->is_skinned_mesh(ob);
        std::list<Object*> child_objects;
 
+       // XXX Not sure about this.
+       // For me this looks more like a very special case for a very special purpose.
+       // Wouldn't it be better to have only one option here ?
+       //
+       // - include children
+       //
+       // Instead of "include_bone_children" ?
+       // then we could just ask:
+       // if (this->export_settings->include_children)
+       //    ...
+       if (this->export_settings->include_armatures
+               && this->export_settings->include_bone_children) {
 
-       if (this->export_settings->include_bone_children) {
                // list child objects
                Base *b = (Base*) sce->base.first;
                while (b) {
@@ -105,7 +142,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
        }
 
 
-       if (ob->type == OB_MESH && is_skinned_mesh)
+       if (ob->type == OB_MESH && this->export_settings->include_armatures && is_skinned_mesh)
                // for skinned mesh we write obmat in <bind_shape_matrix>
                TransformWriter::add_node_transform_identity(node);
        else
@@ -113,10 +150,11 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce)
 
        // <instance_geometry>
        if (ob->type == OB_MESH) {
-               if (is_skinned_mesh) {
-                       arm_exporter->add_instance_controller(ob);
+               bool instance_controller_created = false;
+               if (this->export_settings->include_armatures && is_skinned_mesh) {
+                       instance_controller_created = arm_exporter->add_instance_controller(ob);
                }
-               else {
+               if (!instance_controller_created){
                        COLLADASW::InstanceGeometry instGeom(mSW);
                        instGeom.setUrl(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob, this->export_settings->use_object_instantiation)));
 
index 951fecec0493a172734f039ed9a3acc0bc3ea5a9..e880082c9ecaeace8982f95c257de6d3749c0bba 100644 (file)
@@ -54,14 +54,18 @@ extern "C"
                const char *filepath,
                int selected,
                int apply_modifiers,
+
+               int include_armatures,
                int include_bone_children,
+
                int use_object_instantiation,
-               int second_life)
+               int second_life )
        {
                ExportSettings export_settings;
                
                export_settings.selected                 = selected != 0;
                export_settings.apply_modifiers          = apply_modifiers != 0;
+               export_settings.include_armatures        = include_armatures != 0;
                export_settings.include_bone_children    = include_bone_children != 0;
                export_settings.second_life              = second_life != 0;
                export_settings.use_object_instantiation = use_object_instantiation != 0;
index 67aaf1ff6c7c27189e57e3f0031cffba04c68313..646c8469e6b48d0ce6c8c77dd1bcb11d8a5d14b3 100644 (file)
@@ -38,13 +38,17 @@ extern "C" {
         */
        int collada_import(bContext *C, const char *filepath);
        int collada_export(
-               Scene *sce,
+               Scene *sce, 
                const char *filepath,
                int selected,
                int apply_modifiers,
+
+               int include_armatures,
                int include_bone_children,
+
                int use_object_instantiation,
                int second_life);
+
 #ifdef __cplusplus
 }
 #endif
index 8b7a28e5fbeec9c32718830adfc5c729d84a9816..8693441d7c850a6d1f13aaa1f5d4700cf13be1f1 100644 (file)
 #include "COLLADAFWMeshPrimitive.h"
 #include "COLLADAFWMeshVertexData.h"
 
+#include "DNA_modifier_types.h"
 #include "DNA_customdata_types.h"
 #include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_scene_types.h"
 
 #include "BLI_math.h"
 #include "BKE_customdata.h"
 #include "BKE_depsgraph.h"
 #include "BKE_object.h"
+#include "BKE_mesh.h"
 #include "BKE_scene.h"
 
+extern "C" {
+#include "BKE_DerivedMesh.h"
+}
+
 #include "WM_api.h" // XXX hrm, see if we can do without this
 #include "WM_types.h"
 
@@ -125,3 +132,35 @@ Object *bc_add_object(Scene *scene, int type, const char *name)
        return ob;
 }
 
+Mesh *bc_to_mesh_apply_modifiers(Scene *scene, Object *ob)
+{
+       Mesh *tmpmesh;
+       CustomDataMask mask = CD_MASK_MESH;
+       DerivedMesh *dm     = mesh_create_derived_view(scene, ob, mask);
+       tmpmesh             = BKE_mesh_add("ColladaMesh"); // name is not important here
+       DM_to_mesh(dm, tmpmesh, ob);
+       dm->release(dm);
+       return tmpmesh;
+}
+
+Object *bc_get_assigned_armature(Object *ob)
+{
+       Object *ob_arm = NULL;
+
+       if (ob->parent && ob->partype == PARSKEL && ob->parent->type == OB_ARMATURE) {
+               ob_arm = ob->parent;
+       }
+       else {
+               ModifierData *mod = (ModifierData*)ob->modifiers.first;
+               while (mod) {
+                       if (mod->type == eModifierType_Armature) {
+                               ob_arm = ((ArmatureModifierData*)mod)->object;
+                       }
+
+                       mod = mod->next;
+               }
+       }
+
+       return ob_arm;
+}
+
index 1f5d2b1d8da41fb0fd85bbecf93c59d2e1e94392..9882b44d94cb363a7c347b6312691ee72a35a115 100644 (file)
@@ -36,6 +36,7 @@
 #include <map>
 
 #include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
 #include "DNA_customdata_types.h"
 #include "DNA_texture_types.h"
 #include "BKE_context.h"
@@ -50,5 +51,7 @@ extern int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_sp
 extern char *bc_CustomData_get_layer_name(const CustomData *data, int type, int n);
 extern char *bc_CustomData_get_active_layer_name(const CustomData *data, int type);
 extern Object *bc_add_object(Scene *scene, int type, const char *name);
+extern Mesh *bc_to_mesh_apply_modifiers(Scene *scene, Object *ob);
+extern Object *bc_get_assigned_armature(Object *ob);
 
 #endif
index 8d771f0dc58e5b2781a1d8eed399ee86aab04716..1823bbce3a12ffe944732e59d0001b6e10b8f719 100644 (file)
@@ -669,7 +669,7 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy,
 // ............................
 
 /* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */
-void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
+void draw_gpencil_2dimage(bContext *C /* , ImBuf *ibuf */)
 {
        ScrArea *sa = CTX_wm_area(C);
        ARegion *ar = CTX_wm_region(C);
@@ -678,8 +678,6 @@ void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
        int offsx, offsy, sizex, sizey;
        int dflag = GP_DRAWDATA_NOSTATUS;
        
-       /* check that we have grease-pencil stuff to draw */
-       if (ELEM(NULL, sa, ibuf)) return;
        gpd = gpencil_data_get_active(C); // XXX
        if (gpd == NULL) return;
        
@@ -706,7 +704,10 @@ void draw_gpencil_2dimage(bContext *C, ImBuf *ibuf)
                {
                        SpaceSeq *sseq = (SpaceSeq *)sa->spacedata.first;
                        float zoom, zoomx, zoomy;
-                       
+
+                       /* check that we have grease-pencil stuff to draw */
+                       if (ELEM(NULL, sa, ibuf)) return;
+
                        /* calculate accessory values */
                        zoom = (float)(SEQ_ZOOM_FAC(sseq->zoom));
                        if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
index 6b1028525a7ec1638889b0d0df6db5b5e2dd2e5b..1d42954a416778f699f6d0402cc05f589a0570fc 100644 (file)
@@ -47,8 +47,6 @@ int ED_space_clip_poll(struct bContext *C);
 int ED_space_clip_view_clip_poll(struct bContext *C);
 
 int ED_space_clip_tracking_poll(struct bContext *C);
-int ED_space_clip_tracking_size_poll(struct bContext *C);
-int ED_space_clip_tracking_frame_poll(struct bContext *C);
 int ED_space_clip_maskedit_poll(struct bContext *C);
 int ED_space_clip_maskedit_mask_poll(bContext *C);
 
index bd3e4371a79fb73a7c91992b28014a99048f08a8..2040d4b9c32a9d693aa808c075e9cbe20cb2b795 100644 (file)
@@ -76,7 +76,7 @@ void ED_operatortypes_gpencil(void);
 /* ------------ Grease-Pencil Drawing API ------------------ */
 /* drawgpencil.c */
 
-void draw_gpencil_2dimage(struct bContext *C, struct ImBuf *ibuf);
+void draw_gpencil_2dimage(struct bContext *C /* , struct ImBuf *ibuf */);
 void draw_gpencil_view2d(struct bContext *C, short onlyv2d);
 void draw_gpencil_view3d(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, short only3d);
 
index 7ffff2b06e58f3a9d85f53bd61c0e15ab234d66b..f81496c377a511e5fe133665406d47655ff3ca98 100644 (file)
@@ -54,7 +54,8 @@
 
 static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_co[2], int threshold, int feather,
                                    MaskLayer **masklay_r, MaskSpline **spline_r, MaskSplinePoint **point_r,
-                                   float *u_r, float tangent[2])
+                                   float *u_r, float tangent[2],
+                                   const short use_deform)
 {
        MaskLayer *masklay, *point_masklay;
        MaskSpline *point_spline;
@@ -80,9 +81,12 @@ static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_c
 
                for (spline = masklay->splines.first; spline; spline = spline->next) {
                        int i;
+                       MaskSplinePoint *cur_point;
 
-                       for (i = 0; i < spline->tot_point; i++) {
-                               MaskSplinePoint *cur_point = &spline->points[i];
+                       for (i = 0, cur_point = use_deform ? spline->points_deform : spline->points;
+                            i < spline->tot_point;
+                            i++, cur_point++)
+                       {
                                float *diff_points;
                                int tot_diff_point;
 
@@ -123,7 +127,7 @@ static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_c
 
                                                        point_masklay = masklay;
                                                        point_spline = spline;
-                                                       point = cur_point;
+                                                       point = use_deform ? &spline->points[(cur_point - spline->points_deform)] : cur_point;
                                                        dist = cur_dist;
                                                        u = (float)i / tot_point;
 
@@ -370,7 +374,7 @@ static int add_vertex_subdivide(bContext *C, Mask *mask, const float co[2])
        float tangent[2];
        float u;
 
-       if (find_nearest_diff_point(C, mask, co, threshold, FALSE, &masklay, &spline, &point, &u, tangent)) {
+       if (find_nearest_diff_point(C, mask, co, threshold, FALSE, &masklay, &spline, &point, &u, tangent, TRUE)) {
                MaskSplinePoint *new_point;
                int point_index = point - spline->points;
 
@@ -651,7 +655,7 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op)
        if (point)
                return OPERATOR_FINISHED;
 
-       if (find_nearest_diff_point(C, mask, co, threshold, TRUE, &masklay, &spline, &point, &u, NULL)) {
+       if (find_nearest_diff_point(C, mask, co, threshold, TRUE, &masklay, &spline, &point, &u, NULL, TRUE)) {
                Scene *scene = CTX_data_scene(C);
                float w = BKE_mask_point_weight(spline, point, u);
                float weight_scalar = BKE_mask_point_weight_scalar(spline, point, u);
index af7f3bd4aedc9eea2812d6d62d5245bf23c7a867..9827ffdc32422f7d7b65fdd1cc74b769d89298bc 100644 (file)
@@ -676,7 +676,7 @@ static int sound_poll(bContext *C)
 {
        Editing *ed = CTX_data_scene(C)->ed;
 
-       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_TYPE_SOUND_RAM)
                return 0;
 
        return 1;
@@ -689,7 +689,7 @@ static int sound_pack_exec(bContext *C, wmOperator *op)
        Editing *ed = CTX_data_scene(C)->ed;
        bSound *sound;
 
-       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_TYPE_SOUND_RAM)
                return OPERATOR_CANCELLED;
 
        sound = ed->act_seq->sound;
@@ -751,7 +751,7 @@ static int sound_unpack_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
        if (RNA_struct_property_is_set(op->ptr, "id"))
                return sound_unpack_exec(C, op);
 
-       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND)
+       if (!ed || !ed->act_seq || ed->act_seq->type != SEQ_TYPE_SOUND_RAM)
                return OPERATOR_CANCELLED;
 
        sound = ed->act_seq->sound;
index 3f3bacfabdf18db0ba6a7a79307dc0a86c57f733..9332413b33bca7910918ca7af3dcfc8f25d053fd 100644 (file)
@@ -1451,7 +1451,6 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
-       ImBuf *ibuf;
 
        if (!clip)
                return;
@@ -1460,28 +1459,23 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
                /* if manual calibration is used then grease pencil data is already
                 * drawed in draw_distortion */
                if ((sc->flag & SC_MANUAL_CALIBRATION) == 0 || sc->mode != SC_MODE_DISTORTION) {
-                       ibuf = ED_space_clip_get_buffer(sc);
-
-                       if (ibuf) {
-                               glPushMatrix();
-                               glMultMatrixf(sc->unistabmat);
+                       glPushMatrix();
+                       glMultMatrixf(sc->unistabmat);
 
-                               if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
-                                       MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking);
+                       if (sc->gpencil_src == SC_GPENCIL_SRC_TRACK) {
+                               MovieTrackingTrack *track = BKE_tracking_active_track(&sc->clip->tracking);
 
-                                       if (track) {
-                                               int framenr = sc->user.framenr;
-                                               MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
+                               if (track) {
+                                       int framenr = sc->user.framenr;
+                                       MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
 
-                                               glTranslatef(marker->pos[0], marker->pos[1], 0.0f);
-                                       }
+                                       glTranslatef(marker->pos[0], marker->pos[1], 0.0f);
                                }
+                       }
 
-                               draw_gpencil_2dimage(C, ibuf);
+                       draw_gpencil_2dimage(C);
 
-                               IMB_freeImBuf(ibuf);
-                               glPopMatrix();
-                       }
+                       glPopMatrix();
                }
        }
        else {
index ab100b46f70b3aae8bc8a5e3d58902683db85fb2..bcda1d59555c8fd8680c6748f8f5d137a29d9ff0 100644 (file)
@@ -96,39 +96,6 @@ int ED_space_clip_tracking_poll(bContext *C)
        return FALSE;
 }
 
-int ED_space_clip_tracking_size_poll(bContext *C)
-{
-       if (ED_space_clip_tracking_poll(C)) {
-               MovieClip *clip = CTX_data_edit_movieclip(C);
-
-               if (clip) {
-                       SpaceClip *sc = CTX_wm_space_clip(C);
-                       int width, height;
-
-                       BKE_movieclip_get_size(clip, &sc->user, &width, &height);
-
-                       return width > 0 && height > 0;
-               }
-       }
-
-       return FALSE;
-}
-
-int ED_space_clip_tracking_frame_poll(bContext *C)
-{
-       if (ED_space_clip_tracking_poll(C)) {
-               MovieClip *clip = CTX_data_edit_movieclip(C);
-
-               if (clip) {
-                       SpaceClip *sc = CTX_wm_space_clip(C);
-
-                       return BKE_movieclip_has_frame(clip, &sc->user);
-               }
-       }
-
-       return FALSE;
-}
-
 int ED_space_clip_maskedit_poll(bContext *C)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
index 298dfca8bc71e5a2e1694d68e20fcfd150cb5d59..4884171364e2bed13eb055d3d24a4a1dd9f52f59 100644 (file)
@@ -109,6 +109,7 @@ static int add_marker_exec(bContext *C, wmOperator *op)
        int width, height;
 
        ED_space_clip_size(sc, &width, &height);
+
        if (!width || !height)
                return OPERATOR_CANCELLED;
 
@@ -146,7 +147,7 @@ void CLIP_OT_add_marker(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke = add_marker_invoke;
        ot->exec = add_marker_exec;
-       ot->poll = ED_space_clip_tracking_size_poll;
+       ot->poll = ED_space_clip_tracking_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -797,7 +798,7 @@ void CLIP_OT_slide_marker(wmOperatorType *ot)
        ot->idname = "CLIP_OT_slide_marker";
 
        /* api callbacks */
-       ot->poll = ED_space_clip_tracking_size_poll;
+       ot->poll = ED_space_clip_tracking_poll;
        ot->invoke = slide_marker_invoke;
        ot->modal = slide_marker_modal;
 
@@ -1493,7 +1494,7 @@ void CLIP_OT_select_grouped(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec = select_groped_exec;
-       ot->poll = ED_space_clip_tracking_size_poll;
+       ot->poll = ED_space_clip_tracking_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -1878,7 +1879,7 @@ void CLIP_OT_track_markers(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = track_markers_exec;
        ot->invoke = track_markers_invoke;
-       ot->poll = ED_space_clip_tracking_frame_poll;
+       ot->poll = ED_space_clip_tracking_poll;
        ot->modal = track_markers_modal;
 
        /* flags */
@@ -2319,19 +2320,17 @@ static Object *get_orientation_object(bContext *C)
 
 static int set_orientation_poll(bContext *C)
 {
-       if (ED_space_clip_tracking_size_poll(C)) {
-               Scene *scene = CTX_data_scene(C);
-               SpaceClip *sc = CTX_wm_space_clip(C);
-               MovieClip *clip = ED_space_clip(sc);
-               MovieTracking *tracking = &clip->tracking;
-               MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
+       Scene *scene = CTX_data_scene(C);
+       SpaceClip *sc = CTX_wm_space_clip(C);
+       MovieClip *clip = ED_space_clip(sc);
+       MovieTracking *tracking = &clip->tracking;
+       MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
 
-               if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
-                       return TRUE;
-               }
-               else {
-                       return OBACT != NULL;
-               }
+       if (tracking_object->flag & TRACKING_OBJECT_CAMERA) {
+               return TRUE;
+       }
+       else {
+               return OBACT != NULL;
        }
 
        return FALSE;
@@ -2929,16 +2928,12 @@ void CLIP_OT_set_scale(wmOperatorType *ot)
 
 static int set_solution_scale_poll(bContext *C)
 {
-       if (ED_space_clip_tracking_size_poll(C)) {
-               SpaceClip *sc = CTX_wm_space_clip(C);
-               MovieClip *clip = ED_space_clip(sc);
-               MovieTracking *tracking = &clip->tracking;
-               MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
-
-               return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
-       }
+       SpaceClip *sc = CTX_wm_space_clip(C);
+       MovieClip *clip = ED_space_clip(sc);
+       MovieTracking *tracking = &clip->tracking;
+       MovieTrackingObject *tracking_object = BKE_tracking_active_object(tracking);
 
-       return 0;
+       return (tracking_object->flag & TRACKING_OBJECT_CAMERA) == 0;
 }
 
 static int set_solution_scale_exec(bContext *C, wmOperator *op)
@@ -3148,6 +3143,11 @@ static int detect_features_exec(bContext *C, wmOperator *op)
        int framenr = ED_space_clip_clip_framenr(sc);
        bGPDlayer *layer = NULL;
 
+       if (!ibuf) {
+               BKE_report(op->reports, RPT_ERROR, "Feature detection requires valid clip frame");
+               return OPERATOR_CANCELLED;
+       }
+
        if (placement != 0) {
                layer = detect_get_layer(clip);
                place_outside_layer = placement == 2;
@@ -3188,7 +3188,7 @@ void CLIP_OT_detect_features(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec = detect_features_exec;
-       ot->poll = ED_space_clip_tracking_frame_poll;
+       ot->poll = ED_space_clip_tracking_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -3341,7 +3341,7 @@ void CLIP_OT_join_tracks(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec = join_tracks_exec;
-       ot->poll = ED_space_clip_tracking_size_poll;
+       ot->poll = ED_space_clip_tracking_poll;
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
index aab628180c880c870d049d37f3164ba933b746ed..0440aff3f659ce94a790c3b5e04faaeafe0227b5 100644 (file)
@@ -564,16 +564,9 @@ void draw_image_grease_pencil(bContext *C, short onlyv2d)
 {
        /* draw in View2D space? */
        if (onlyv2d) {
-               /* assume that UI_view2d_ortho(C) has been called... */
-               SpaceImage *sima = (SpaceImage *)CTX_wm_space_data(C);
-               void *lock;
-               ImBuf *ibuf = ED_space_image_acquire_buffer(sima, &lock);
-               
                /* draw grease-pencil ('image' strokes) */
                //if (sima->flag & SI_DISPGP)
-               draw_gpencil_2dimage(C, ibuf);
-
-               ED_space_image_release_buffer(sima, lock);
+               draw_gpencil_2dimage(C);
        }
        else {
                /* assume that UI_view2d_restore(C) has been called... */
index 483016b7e005e9eb7bd3b24dc4f7d1ddd485a693..f0ecaf3ab2c74eed3398e85006c0cbdd79291199 100644 (file)
@@ -1057,15 +1057,15 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
                        case TSE_POSEGRP_BASE:
                                UI_icon_draw(x, y, ICON_GROUP_BONE); break;
                        case TSE_SEQUENCE:
-                               if (te->idcode == SEQ_MOVIE)
+                               if (te->idcode == SEQ_TYPE_MOVIE)
                                        UI_icon_draw(x, y, ICON_SEQUENCE);
-                               else if (te->idcode == SEQ_META)
+                               else if (te->idcode == SEQ_TYPE_META)
                                        UI_icon_draw(x, y, ICON_DOT);
-                               else if (te->idcode == SEQ_SCENE)
+                               else if (te->idcode == SEQ_TYPE_SCENE)
                                        UI_icon_draw(x, y, ICON_SCENE);
-                               else if (te->idcode == SEQ_SOUND)
+                               else if (te->idcode == SEQ_TYPE_SOUND_RAM)
                                        UI_icon_draw(x, y, ICON_SOUND);
-                               else if (te->idcode == SEQ_IMAGE)
+                               else if (te->idcode == SEQ_TYPE_IMAGE)
                                        UI_icon_draw(x, y, ICON_IMAGE_COL);
                                else
                                        UI_icon_draw(x, y, ICON_PARTICLES);
index ff3648fc2b86d9e1b81cabcf37af8f4e3186ea97..63907f530eb0dce85a4263cfa7d2ef711a19df93 100644 (file)
@@ -899,14 +899,14 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                te->directdata = seq;
                te->name = seq->name + 2;
 
-               if (seq->type < SEQ_EFFECT) {
+               if (seq->type < SEQ_TYPE_EFFECT) {
                        /*
                         * This work like the sequence.
                         * If the sequence have a name (not default name)
                         * show it, in other case put the filename.
                         */
 
-                       if (seq->type == SEQ_META) {
+                       if (seq->type == SEQ_TYPE_META) {
                                p = seq->seqbase.first;
                                while (p) {
                                        outliner_add_element(soops, &te->subtree, (void *)p, te, TSE_SEQUENCE, index);
index 9eb4c62789e5ec528c76989bb4a246a63881cb1a..9301f13c8c0e6612a6c9661a04ba492d8974805a 100644 (file)
@@ -228,8 +228,8 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
        }
        
        seq = alloc_sequence(ed->seqbasep, start_frame, channel);
-       seq->type = SEQ_SCENE;
-       seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+       seq->type = SEQ_TYPE_SCENE;
+       seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
 
        seq->scene = sce_seq;
        
@@ -327,8 +327,8 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
        }
        
        seq = alloc_sequence(ed->seqbasep, start_frame, channel);
-       seq->type = SEQ_MOVIECLIP;
-       seq->blend_mode = SEQ_CROSS;
+       seq->type = SEQ_TYPE_MOVIECLIP;
+       seq->blend_mode = SEQ_TYPE_CROSS;
        seq->clip = clip;
 
        if (seq->clip->id.us == 0)
@@ -740,14 +740,14 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
        seq->strip = strip = MEM_callocN(sizeof(Strip), "strip");
        strip->us = 1;
 
-       if (seq->type == SEQ_COLOR) {
+       if (seq->type == SEQ_TYPE_COLOR) {
                SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
                RNA_float_get_array(op->ptr, "color", colvars->col);
-               seq->blend_mode = SEQ_CROSS; /* so alpha adjustment fade to the strip below */
+               seq->blend_mode = SEQ_TYPE_CROSS; /* so alpha adjustment fade to the strip below */
 
        }
-       else if (seq->type == SEQ_ADJUSTMENT) {
-               seq->blend_mode = SEQ_CROSS;
+       else if (seq->type == SEQ_TYPE_ADJUSTMENT) {
+               seq->blend_mode = SEQ_TYPE_CROSS;
        }
 
        /* an unset channel is a special case where we automatically go above
@@ -832,6 +832,6 @@ void SEQUENCER_OT_effect_strip_add(struct wmOperatorType *ot)
        
        WM_operator_properties_filesel(ot, 0, FILE_SPECIAL, FILE_OPENFILE, WM_FILESEL_FILEPATH | WM_FILESEL_RELPATH, FILE_DEFAULTDISPLAY);
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME);
-       RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
+       RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_TYPE_CROSS, "Type", "Sequencer effect type");
        RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);
 }
index 236baea01be0716bc8fc9f35304cfff5ba8d5914..cb15eed6a37c58a35e2101202189b15aeec39538 100644 (file)
@@ -82,23 +82,23 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
        SolidColorVars *colvars = (SolidColorVars *)seq->effectdata;
 
        switch (seq->type) {
-               case SEQ_IMAGE:
+               case SEQ_TYPE_IMAGE:
                        UI_GetThemeColor3ubv(TH_SEQ_IMAGE, col);
                        break;
 
-               case SEQ_META:
+               case SEQ_TYPE_META:
                        UI_GetThemeColor3ubv(TH_SEQ_META, col);
                        break;
 
-               case SEQ_MOVIE:
+               case SEQ_TYPE_MOVIE:
                        UI_GetThemeColor3ubv(TH_SEQ_MOVIE, col);
                        break;
 
-               case SEQ_MOVIECLIP:
+               case SEQ_TYPE_MOVIECLIP:
                        UI_GetThemeColor3ubv(TH_SEQ_MOVIECLIP, col);
                        break;
                
-               case SEQ_SCENE:
+               case SEQ_TYPE_SCENE:
                        UI_GetThemeColor3ubv(TH_SEQ_SCENE, col);
                
                        if (seq->scene == curscene) {
@@ -107,45 +107,45 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
                        break;
                
                /* transitions */
-               case SEQ_CROSS:
-               case SEQ_GAMCROSS:
-               case SEQ_WIPE:
+               case SEQ_TYPE_CROSS:
+               case SEQ_TYPE_GAMCROSS:
+               case SEQ_TYPE_WIPE:
                        UI_GetThemeColor3ubv(TH_SEQ_TRANSITION, col);
 
                        /* slightly offset hue to distinguish different effects */
-                       if (seq->type == SEQ_CROSS)    rgb_byte_set_hue_float_offset(col, 0.04);
-                       if (seq->type == SEQ_GAMCROSS) rgb_byte_set_hue_float_offset(col, 0.08);
-                       if (seq->type == SEQ_WIPE)     rgb_byte_set_hue_float_offset(col, 0.12);
+                       if (seq->type == SEQ_TYPE_CROSS)    rgb_byte_set_hue_float_offset(col, 0.04);
+                       if (seq->type == SEQ_TYPE_GAMCROSS) rgb_byte_set_hue_float_offset(col, 0.08);
+                       if (seq->type == SEQ_TYPE_WIPE)     rgb_byte_set_hue_float_offset(col, 0.12);
                        break;
 
                /* effects */
-               case SEQ_TRANSFORM:
-               case SEQ_SPEED:
-               case SEQ_ADD:
-               case SEQ_SUB:
-               case SEQ_MUL:
-               case SEQ_ALPHAOVER:
-               case SEQ_ALPHAUNDER:
-               case SEQ_OVERDROP:
-               case SEQ_GLOW:
-               case SEQ_MULTICAM:
-               case SEQ_ADJUSTMENT:
+               case SEQ_TYPE_TRANSFORM:
+               case SEQ_TYPE_SPEED:
+               case SEQ_TYPE_ADD:
+               case SEQ_TYPE_SUB:
+               case SEQ_TYPE_MUL:
+               case SEQ_TYPE_ALPHAOVER:
+               case SEQ_TYPE_ALPHAUNDER:
+               case SEQ_TYPE_OVERDROP:
+               case SEQ_TYPE_GLOW:
+               case SEQ_TYPE_MULTICAM:
+               case SEQ_TYPE_ADJUSTMENT:
                        UI_GetThemeColor3ubv(TH_SEQ_EFFECT, col);
 
                        /* slightly offset hue to distinguish different effects */
-                       if      (seq->type == SEQ_ADD)        rgb_byte_set_hue_float_offset(col, 0.04);
-                       else if (seq->type == SEQ_SUB)        rgb_byte_set_hue_float_offset(col, 0.08);
-                       else if (seq->type == SEQ_MUL)        rgb_byte_set_hue_float_offset(col, 0.12);
-                       else if (seq->type == SEQ_ALPHAOVER)  rgb_byte_set_hue_float_offset(col, 0.16);
-                       else if (seq->type == SEQ_ALPHAUNDER) rgb_byte_set_hue_float_offset(col, 0.20);
-                       else if (seq->type == SEQ_OVERDROP)   rgb_byte_set_hue_float_offset(col, 0.24);
-                       else if (seq->type == SEQ_GLOW)       rgb_byte_set_hue_float_offset(col, 0.28);
-                       else if (seq->type == SEQ_TRANSFORM)  rgb_byte_set_hue_float_offset(col, 0.36);
-                       else if (seq->type == SEQ_MULTICAM)   rgb_byte_set_hue_float_offset(col, 0.32);
-                       else if (seq->type == SEQ_ADJUSTMENT) rgb_byte_set_hue_float_offset(col, 0.40);
+                       if      (seq->type == SEQ_TYPE_ADD)        rgb_byte_set_hue_float_offset(col, 0.04);
+                       else if (seq->type == SEQ_TYPE_SUB)        rgb_byte_set_hue_float_offset(col, 0.08);
+                       else if (seq->type == SEQ_TYPE_MUL)        rgb_byte_set_hue_float_offset(col, 0.12);
+                       else if (seq->type == SEQ_TYPE_ALPHAOVER)  rgb_byte_set_hue_float_offset(col, 0.16);
+                       else if (seq->type == SEQ_TYPE_ALPHAUNDER) rgb_byte_set_hue_float_offset(col, 0.20);
+                       else if (seq->type == SEQ_TYPE_OVERDROP)   rgb_byte_set_hue_float_offset(col, 0.24);
+                       else if (seq->type == SEQ_TYPE_GLOW)       rgb_byte_set_hue_float_offset(col, 0.28);
+                       else if (seq->type == SEQ_TYPE_TRANSFORM)  rgb_byte_set_hue_float_offset(col, 0.36);
+                       else if (seq->type == SEQ_TYPE_MULTICAM)   rgb_byte_set_hue_float_offset(col, 0.32);
+                       else if (seq->type == SEQ_TYPE_ADJUSTMENT) rgb_byte_set_hue_float_offset(col, 0.40);
                        break;
 
-               case SEQ_COLOR:
+               case SEQ_TYPE_COLOR:
                        if (colvars->col) {
                                rgb_float_to_uchar(col, colvars->col);
                        }
@@ -154,7 +154,7 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
                        }
                        break;
 
-               case SEQ_SOUND:
+               case SEQ_TYPE_SOUND_RAM:
                        UI_GetThemeColor3ubv(TH_SEQ_AUDIO, col);
                        blendcol[0] = blendcol[1] = blendcol[2] = 128;
                        if (seq->flag & SEQ_MUTE) UI_GetColorPtrBlendShade3ubv(col, blendcol, col, 0.5, 20);
@@ -362,7 +362,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire
        }
        
        /* draw! */
-       if (seq->type < SEQ_EFFECT || 
+       if (seq->type < SEQ_TYPE_EFFECT || 
            get_sequence_effect_num_inputs(seq->type) == 0)
        {
                glEnable(GL_BLEND);
@@ -409,7 +409,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
        unsigned char col[3], blendcol[3];
        View2D *v2d = &ar->v2d;
        
-       if (seq->type >= SEQ_EFFECT) return;
+       if (seq->type >= SEQ_TYPE_EFFECT) return;
 
        x1 = seq->startdisp;
        x2 = seq->enddisp;
@@ -521,10 +521,10 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
        if (name[0] == '\0')
                name = give_seqname(seq);
 
-       if (seq->type == SEQ_META || seq->type == SEQ_ADJUSTMENT) {
+       if (seq->type == SEQ_TYPE_META || seq->type == SEQ_TYPE_ADJUSTMENT) {
                BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name);
        }
-       else if (seq->type == SEQ_SCENE) {
+       else if (seq->type == SEQ_TYPE_SCENE) {
                if (seq->scene) {
                        if (seq->scene_camera) {
                                BLI_snprintf(str, sizeof(str), "%d | %s: %s (%s)",
@@ -540,7 +540,7 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
                                     seq->len, name);
                }
        }
-       else if (seq->type == SEQ_MOVIECLIP) {
+       else if (seq->type == SEQ_TYPE_MOVIECLIP) {
                if (seq->clip && strcmp(name, seq->clip->id.name + 2) != 0) {
                        BLI_snprintf(str, sizeof(str), "%d | %s: %s",
                                     seq->len, name, seq->clip->id.name + 2);
@@ -550,19 +550,19 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
                                     seq->len, name);
                }
        }
-       else if (seq->type == SEQ_MULTICAM) {
+       else if (seq->type == SEQ_TYPE_MULTICAM) {
                BLI_snprintf(str, sizeof(str), "Cam | %s: %d",
                             name, seq->multicam_source);
        }
-       else if (seq->type == SEQ_IMAGE) {
+       else if (seq->type == SEQ_TYPE_IMAGE) {
                BLI_snprintf(str, sizeof(str), "%d | %s: %s%s",
                             seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
        }
-       else if (seq->type & SEQ_EFFECT) {
+       else if (seq->type & SEQ_TYPE_EFFECT) {
                BLI_snprintf(str, sizeof(str), "%d | %s",
                                     seq->len, name);
        }
-       else if (seq->type == SEQ_SOUND) {
+       else if (seq->type == SEQ_TYPE_SOUND_RAM) {
                if (seq->sound)
                        BLI_snprintf(str, sizeof(str), "%d | %s: %s",
                                     seq->len, name, seq->sound->name);
@@ -570,7 +570,7 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float
                        BLI_snprintf(str, sizeof(str), "%d | %s",
                                     seq->len, name);
        }
-       else if (seq->type == SEQ_MOVIE) {
+       else if (seq->type == SEQ_TYPE_MOVIE) {
                BLI_snprintf(str, sizeof(str), "%d | %s: %s%s",
                             seq->len, name, seq->strip->dir, seq->strip->stripdata->name);
        }
@@ -696,7 +696,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
        x2 = seq->enddisp;
        
        /* draw sound wave */
-       if (seq->type == SEQ_SOUND) {
+       if (seq->type == SEQ_TYPE_SOUND_RAM) {
                drawseqwave(scene, seq, x1, y1, x2, y2, (ar->v2d.cur.xmax - ar->v2d.cur.xmin) / ar->winx);
        }
 
@@ -743,7 +743,7 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
                glDisable(GL_LINE_STIPPLE);
        }
        
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                drawmeta_contents(scene, seq, x1, y1, x2, y2);
        }
        
index 072cfa0062233c552e0188633ea16941efe777b9..c686f8440a95b8b15c341ce95040e0b3702ba7cf 100644 (file)
 /* XXX */
 /* RNA Enums, used in multiple files */
 EnumPropertyItem sequencer_prop_effect_types[] = {
-       {SEQ_CROSS, "CROSS", 0, "Crossfade", "Crossfade effect strip type"},
-       {SEQ_ADD, "ADD", 0, "Add", "Add effect strip type"},
-       {SEQ_SUB, "SUBTRACT", 0, "Subtract", "Subtract effect strip type"},
-       {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", "Alpha Over effect strip type"},
-       {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", "Alpha Under effect strip type"},
-       {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", "Gamma Cross effect strip type"},
-       {SEQ_MUL, "MULTIPLY", 0, "Multiply", "Multiply effect strip type"},
-       {SEQ_OVERDROP, "OVER_DROP", 0, "Alpha Over Drop", "Alpha Over Drop effect strip type"},
-       {SEQ_WIPE, "WIPE", 0, "Wipe", "Wipe effect strip type"},
-       {SEQ_GLOW, "GLOW", 0, "Glow", "Glow effect strip type"},
-       {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", "Transform effect strip type"},
-       {SEQ_COLOR, "COLOR", 0, "Color", "Color effect strip type"},
-       {SEQ_SPEED, "SPEED", 0, "Speed", "Color effect strip type"},
-       {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
-       {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
+       {SEQ_TYPE_CROSS, "CROSS", 0, "Crossfade", "Crossfade effect strip type"},
+       {SEQ_TYPE_ADD, "ADD", 0, "Add", "Add effect strip type"},
+       {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", "Subtract effect strip type"},
+       {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", "Alpha Over effect strip type"},
+       {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", "Alpha Under effect strip type"},
+       {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", "Gamma Cross effect strip type"},
+       {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", "Multiply effect strip type"},
+       {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Alpha Over Drop", "Alpha Over Drop effect strip type"},
+       {SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", "Wipe effect strip type"},
+       {SEQ_TYPE_GLOW, "GLOW", 0, "Glow", "Glow effect strip type"},
+       {SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", "Transform effect strip type"},
+       {SEQ_TYPE_COLOR, "COLOR", 0, "Color", "Color effect strip type"},
+       {SEQ_TYPE_SPEED, "SPEED", 0, "Speed", "Color effect strip type"},
+       {SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
+       {SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
@@ -478,7 +478,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
 
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
                if (seq->flag & SELECT) {
-                       if (seq->type == SEQ_SOUND && get_sequence_effect_num_inputs(type) != 0) {
+                       if (seq->type == SEQ_TYPE_SOUND_RAM && get_sequence_effect_num_inputs(type) != 0) {
                                *error_str = "Can't apply effects to audio sequence strips";
                                return 0;
                        }
@@ -543,7 +543,7 @@ static Sequence *del_seq_find_replace_recurs(Scene *scene, Sequence *seq)
 
        if (!seq)
                return NULL;
-       else if (!(seq->type & SEQ_EFFECT))
+       else if (!(seq->type & SEQ_TYPE_EFFECT))
                return ((seq->flag & SELECT) ? NULL : seq);
        else if (!(seq->flag & SELECT)) {
                /* try to find replacement for effect inputs */
@@ -584,7 +584,7 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
                if ((seq->flag & flag) || deleteall) {
                        BLI_remlink(lb, seq);
                        if (seq == last_seq) BKE_sequencer_active_set(scene, NULL);
-                       if (seq->type == SEQ_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
+                       if (seq->type == SEQ_TYPE_META) recurs_del_seq_flag(scene, &seq->seqbase, flag, 1);
                        seq_free_sequence(scene, seq);
                }
                seq = seqn;
@@ -616,7 +616,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
        
        if ((seq->startstill) && (cutframe < seq->start)) {
                /* don't do funny things with METAs ... */
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        skip_dup = TRUE;
                        seq->startstill = seq->start - cutframe;
                }
@@ -637,7 +637,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
        else if (((seq->start + seq->len) < cutframe) && (seq->endstill)) {
                seq->endstill -= seq->enddisp - cutframe;
                /* don't do funny things with METAs ... */
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        skip_dup = TRUE;
                }
        }
@@ -712,7 +712,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
        
        if ((seq->startstill) && (cutframe < seq->start)) {
                /* don't do funny things with METAs ... */
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        skip_dup = TRUE;
                        seq->startstill = seq->start - cutframe;
                }
@@ -731,7 +731,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
        else if (((seq->start + seq->len) < cutframe) && (seq->endstill)) {
                seq->endstill -= seq->enddisp - cutframe;
                /* don't do funny things with METAs ... */
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        skip_dup = TRUE;
                }
        }
@@ -855,7 +855,7 @@ static void UNUSED_FUNCTION(touch_seq_files) (Scene * scene)
        SEQP_BEGIN (ed, seq)
        {
                if (seq->flag & SELECT) {
-                       if (seq->type == SEQ_MOVIE) {
+                       if (seq->type == SEQ_TYPE_MOVIE) {
                                if (seq->strip && seq->strip->stripdata) {
                                        BLI_make_file_string(G.main->name, str, seq->strip->dir, seq->strip->stripdata->name);
                                        BLI_file_touch(seq->name);
@@ -883,7 +883,7 @@ static void set_filter_seq(Scene *scene)
        SEQP_BEGIN (ed, seq)
        {
                if (seq->flag & SELECT) {
-                       if (seq->type == SEQ_MOVIE) {
+                       if (seq->type == SEQ_TYPE_MOVIE) {
                                seq->flag |= SEQ_FILTERY;
                                reload_sequence_new_file(scene, seq, FALSE);
                                calc_sequence(scene, seq);
@@ -1052,7 +1052,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
                                shuffle_seq(ed->seqbasep, seq, scene);
                        }
                }
-               else if (seq->type & SEQ_EFFECT) {
+               else if (seq->type & SEQ_TYPE_EFFECT) {
                        if (seq->seq1 && (seq->seq1->flag & SELECT)) 
                                calc_sequence(scene, seq);
                        else if (seq->seq2 && (seq->seq2->flag & SELECT)) 
@@ -1368,7 +1368,7 @@ static int sequencer_effect_poll(bContext *C)
 
        if (ed) {
                Sequence *last_seq = BKE_sequencer_active_get(scene);
-               if (last_seq && (last_seq->type & SEQ_EFFECT)) {
+               if (last_seq && (last_seq->type & SEQ_TYPE_EFFECT)) {
                        return 1;
                }
        }
@@ -1626,7 +1626,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* for effects, try to find a replacement input */
        for (seq = ed->seqbasep->first; seq; seq = seq->next)
-               if ((seq->type & SEQ_EFFECT) && !(seq->flag & SELECT))
+               if ((seq->type & SEQ_TYPE_EFFECT) && !(seq->flag & SELECT))
                        del_seq_find_replace_recurs(scene, seq);
 
        /* delete all selected strips */
@@ -1679,7 +1679,7 @@ static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* for effects, try to find a replacement input */
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
-               if ((seq->type & SEQ_EFFECT) == 0 && (seq->flag & SELECT)) {
+               if ((seq->type & SEQ_TYPE_EFFECT) == 0 && (seq->flag & SELECT)) {
                        seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
                }
        }
@@ -1692,7 +1692,7 @@ static int sequencer_offset_clear_exec(bContext *C, wmOperator *UNUSED(op))
        }
 
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
-               if ((seq->type & SEQ_EFFECT) == 0 && (seq->flag & SELECT)) {
+               if ((seq->type & SEQ_TYPE_EFFECT) == 0 && (seq->flag & SELECT)) {
                        if (seq_test_overlap(ed->seqbasep, seq)) {
                                shuffle_seq(ed->seqbasep, seq, scene);
                        }
@@ -1737,7 +1737,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
        seq = ed->seqbasep->first; /* poll checks this is valid */
 
        while (seq) {
-               if ((seq->flag & SELECT) && (seq->type == SEQ_IMAGE) && (seq->len > 1)) {
+               if ((seq->flag & SELECT) && (seq->type == SEQ_TYPE_IMAGE) && (seq->len > 1)) {
                        /* remove seq so overlap tests don't conflict,
                         * see seq_free_sequence below for the real free'ing */
                        BLI_remlink(ed->seqbasep, seq);
@@ -1755,7 +1755,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
                                BLI_addtail(ed->seqbasep, seq_new);
 
                                seq_new->start = start_ofs;
-                               seq_new->type = SEQ_IMAGE;
+                               seq_new->type = SEQ_TYPE_IMAGE;
                                seq_new->len = 1;
                                seq_new->endstill = step - 1;
 
@@ -1826,7 +1826,7 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *UNUSED(op))
        Sequence *last_seq = BKE_sequencer_active_get(scene);
        MetaStack *ms;
 
-       if (last_seq && last_seq->type == SEQ_META && last_seq->flag & SELECT) {
+       if (last_seq && last_seq->type == SEQ_TYPE_META && last_seq->flag & SELECT) {
                /* Enter Metastrip */
                ms = MEM_mallocN(sizeof(MetaStack), "metastack");
                BLI_addtail(&ed->metastack, ms);
@@ -1904,7 +1904,7 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
 
        seqm = alloc_sequence(ed->seqbasep, 1, 1); /* channel number set later */
        strcpy(seqm->name + 2, "MetaStrip");
-       seqm->type = SEQ_META;
+       seqm->type = SEQ_TYPE_META;
        seqm->flag = SELECT;
 
        seq = ed->seqbasep->first;
@@ -1970,7 +1970,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
 
        Sequence *seq, *last_seq = BKE_sequencer_active_get(scene); /* last_seq checks (ed == NULL) */
 
-       if (last_seq == NULL || last_seq->type != SEQ_META)
+       if (last_seq == NULL || last_seq->type != SEQ_TYPE_META)
                return OPERATOR_CANCELLED;
 
        BLI_movelisttolist(ed->seqbasep, &last_seq->seqbase);
@@ -1983,7 +1983,7 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op))
 
        /* emtpy meta strip, delete all effects depending on it */
        for (seq = ed->seqbasep->first; seq; seq = seq->next)
-               if ((seq->type & SEQ_EFFECT) && seq_depends_on_meta(seq, last_seq))
+               if ((seq->type & SEQ_TYPE_EFFECT) && seq_depends_on_meta(seq, last_seq))
                        seq->flag |= SEQ_FLAG_DELETE;
 
        recurs_del_seq_flag(scene, ed->seqbasep, SEQ_FLAG_DELETE, 0);
@@ -2454,14 +2454,14 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op)
 
                // XXX - should be a generic function
                for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
-                       if ((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
+                       if ((iseq->type & SEQ_TYPE_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
                                calc_sequence(scene, iseq);
                        }
                }
 
                /* do this in a new loop since both effects need to be calculated first */
                for (iseq = scene->ed->seqbasep->first; iseq; iseq = iseq->next) {
-                       if ((iseq->type & SEQ_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
+                       if ((iseq->type & SEQ_TYPE_EFFECT) && (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) {
                                /* this may now overlap */
                                if (seq_test_overlap(ed->seqbasep, iseq) ) {
                                        shuffle_seq(ed->seqbasep, iseq, scene);
@@ -2512,16 +2512,16 @@ static int sequencer_rendersize_exec(bContext *C, wmOperator *UNUSED(op))
 
        if (active_seq->strip) {
                switch (active_seq->type) {
-                       case SEQ_IMAGE:
+                       case SEQ_TYPE_IMAGE:
                                se = give_stripelem(active_seq, scene->r.cfra);
                                break;
-                       case SEQ_MOVIE:
+                       case SEQ_TYPE_MOVIE:
                                se = active_seq->strip->stripdata;
                                break;
-                       case SEQ_SCENE:
-                       case SEQ_META:
-                       case SEQ_RAM_SOUND:
-                       case SEQ_HD_SOUND:
+                       case SEQ_TYPE_SCENE:
+                       case SEQ_TYPE_META:
+                       case SEQ_TYPE_SOUND_RAM:
+                       case SEQ_TYPE_SOUND_HD:
                        default:
                                break;
                }
@@ -2559,7 +2559,7 @@ void SEQUENCER_OT_rendersize(wmOperatorType *ot)
 
 static void seq_copy_del_sound(Scene *scene, Sequence *seq)
 {
-       if (seq->type == SEQ_META) {
+       if (seq->type == SEQ_TYPE_META) {
                Sequence *iseq;
                for (iseq = seq->seqbase.first; iseq; iseq = iseq->next) {
                        seq_copy_del_sound(scene, iseq);
@@ -2900,7 +2900,7 @@ static int sequencer_change_effect_type_exec(bContext *C, wmOperator *op)
        /* free previous effect and init new effect */
        struct SeqEffectHandle sh;
 
-       if ((seq->type & SEQ_EFFECT) == 0) {
+       if ((seq->type & SEQ_TYPE_EFFECT) == 0) {
                return OPERATOR_CANCELLED;
        }
 
@@ -2947,7 +2947,7 @@ void SEQUENCER_OT_change_effect_type(struct wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
+       ot->prop = RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_TYPE_CROSS, "Type", "Sequencer effect type");
 }
 
 static int sequencer_change_path_exec(bContext *C, wmOperator *op)
@@ -2958,7 +2958,7 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
        Sequence *seq = BKE_sequencer_active_get(scene);
        const int is_relative_path = RNA_boolean_get(op->ptr, "relative_path");
 
-       if (seq->type == SEQ_IMAGE) {
+       if (seq->type == SEQ_TYPE_IMAGE) {
                char directory[FILE_MAX];
                const int len = RNA_property_collection_length(op->ptr, RNA_struct_find_property(op->ptr, "files"));
                StripElem *se;
@@ -3028,7 +3028,7 @@ static int sequencer_change_path_invoke(bContext *C, wmOperator *op, wmEvent *UN
        RNA_string_set(op->ptr, "directory", seq->strip->dir);
 
        /* set default display depending on seq type */
-       if (seq->type == SEQ_IMAGE) {
+       if (seq->type == SEQ_TYPE_IMAGE) {
                RNA_boolean_set(op->ptr, "filter_movie", FALSE);
        }
        else {
index 3911ec0ef827b0911daa5636c5e3286652e640bd..261bc57542013bd0342d23b9f9e1d15773144575 100644 (file)
@@ -171,11 +171,11 @@ void ED_sequencer_select_sequence_single(Scene * scene, Sequence * seq, int dese
 
        BKE_sequencer_active_set(scene, seq);
 
-       if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
+       if ((seq->type == SEQ_TYPE_IMAGE) || (seq->type == SEQ_TYPE_MOVIE)) {
                if (seq->strip)
                        BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
        }
-       else if (seq->type == SEQ_SOUND) {
+       else if (seq->type == SEQ_TYPE_SOUND_RAM) {
                if (seq->strip)
                        BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
        }
@@ -409,13 +409,13 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
                if (seq) {
                        BKE_sequencer_active_set(scene, seq);
        
-                       if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) {
+                       if ((seq->type == SEQ_TYPE_IMAGE) || (seq->type == SEQ_TYPE_MOVIE)) {
                                if (seq->strip) {
                                        BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR);
                                }
                        }
                        else
-                       if (seq->type == SEQ_SOUND) {
+                       if (seq->type == SEQ_TYPE_SOUND_RAM) {
                                if (seq->strip) {
                                        BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR);
                                }
@@ -930,11 +930,11 @@ static EnumPropertyItem sequencer_prop_select_grouped_types[] = {
        {0, NULL, 0, NULL, NULL}
 };
 
-#define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_SOUND) && !(_seq->type & SEQ_EFFECT))
+#define SEQ_IS_SOUND(_seq) ((_seq->type & SEQ_TYPE_SOUND_RAM) && !(_seq->type & SEQ_TYPE_EFFECT))
 
-#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_EFFECT)
+#define SEQ_IS_EFFECT(_seq) (_seq->type & SEQ_TYPE_EFFECT)
 
-#define SEQ_USE_DATA(_seq) (ELEM(_seq->type, SEQ_SCENE, SEQ_MOVIECLIP) || SEQ_HAS_PATH(_seq))
+#define SEQ_USE_DATA(_seq) (ELEM(_seq->type, SEQ_TYPE_SCENE, SEQ_TYPE_MOVIECLIP) || SEQ_HAS_PATH(_seq))
 
 static short select_grouped_type(Editing *ed, Sequence *actseq)
 {
@@ -1008,22 +1008,22 @@ static short select_grouped_data(Editing *ed, Sequence *actseq)
                }
                SEQ_END;
        }
-       else if (actseq->type == SEQ_SCENE) {
+       else if (actseq->type == SEQ_TYPE_SCENE) {
                Scene *sce = actseq->scene;
                SEQP_BEGIN (ed, seq)
                {
-                       if (seq->type == SEQ_SCENE && seq->scene == sce) {
+                       if (seq->type == SEQ_TYPE_SCENE && seq->scene == sce) {
                                seq->flag |= SELECT;
                                changed = TRUE;
                        }
                }
                SEQ_END;
        }
-       else if (actseq->type == SEQ_MOVIECLIP) {
+       else if (actseq->type == SEQ_TYPE_MOVIECLIP) {
                MovieClip *clip = actseq->clip;
                SEQP_BEGIN (ed, seq)
                {
-                       if (seq->type == SEQ_MOVIECLIP && seq->clip == clip) {
+                       if (seq->type == SEQ_TYPE_MOVIECLIP && seq->clip == clip) {
                                seq->flag |= SELECT;
                                changed = TRUE;
                        }
@@ -1038,10 +1038,10 @@ static short select_grouped_effect(Editing *ed, Sequence *actseq)
 {
        Sequence *seq;
        short changed = FALSE;
-       short effects[SEQ_EFFECT_MAX + 1];
+       short effects[SEQ_TYPE_EFFECT_MAX + 1];
        int i;
 
-       for (i = 0; i <= SEQ_EFFECT_MAX; i++)
+       for (i = 0; i <= SEQ_TYPE_EFFECT_MAX; i++)
                effects[i] = FALSE;
 
        SEQP_BEGIN (ed, seq)
@@ -1087,7 +1087,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
 {
        Sequence *seq = NULL;
        short changed = FALSE;
-       short is_audio = ((actseq->type == SEQ_META) || SEQ_IS_SOUND(actseq));
+       short is_audio = ((actseq->type == SEQ_TYPE_META) || SEQ_IS_SOUND(actseq));
        int startdisp = actseq->startdisp;
        int enddisp   = actseq->enddisp;
        int machine   = actseq->machine;
@@ -1109,7 +1109,7 @@ static short select_grouped_effect_link(Editing *ed, Sequence *actseq)
                /* Ignore all seqs of incompatible types (audio vs video). */
                if ((seq->flag & SELECT) || (seq->startdisp >= enddisp) || (seq->enddisp < startdisp) ||
                    (!is_audio && SEQ_IS_SOUND(seq)) ||
-                   (is_audio && !((seq->type == SEQ_META) || SEQ_IS_SOUND(seq))))
+                   (is_audio && !((seq->type == SEQ_TYPE_META) || SEQ_IS_SOUND(seq))))
                {
                        continue;
                }
index 2c59e2861e57a6f9a991ab3f6b88c16905ddd969..edb40adfc6797e06b2cf8cd771e2cb29cb6337e4 100644 (file)
@@ -1774,9 +1774,16 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base
 
 #ifdef VIEW3D_CAMERA_BORDER_HACK
        if (is_view && !(G.f & G_PICKSEL)) {
-               view3d_camera_border_hack_col[0] = ob_wire_col[0];
-               view3d_camera_border_hack_col[1] = ob_wire_col[1];
-               view3d_camera_border_hack_col[2] = ob_wire_col[2];
+               if ((flag & DRAW_CONSTCOLOR) == 0) {
+                       view3d_camera_border_hack_col[0] = ob_wire_col[0];
+                       view3d_camera_border_hack_col[1] = ob_wire_col[1];
+                       view3d_camera_border_hack_col[2] = ob_wire_col[2];
+               }
+               else {
+                       float col[4];
+                       glGetFloatv(GL_CURRENT_COLOR, col);
+                       rgb_float_to_uchar(view3d_camera_border_hack_col, col);
+               }
                view3d_camera_border_hack_test = TRUE;
                return;
        }
index 38ac8c2999c30f1830df3301ada3614bbc32b4ae..429a3b3d86ac47291463f2285ddbbb462ebd7ef7 100644 (file)
@@ -2239,7 +2239,7 @@ void flushTransSeq(TransInfo *t)
                        if ((seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
                                seq->start= new_frame - tdsq->start_offset;
 #else
-                       if (seq->type != SEQ_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
+                       if (seq->type != SEQ_TYPE_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
                                seq->start= new_frame - tdsq->start_offset;
 #endif
                        if (seq->depth==0) {
@@ -2282,7 +2282,7 @@ void flushTransSeq(TransInfo *t)
 
                /* calc all meta's then effects [#27953] */
                for (seq = seqbasep->first; seq; seq = seq->next) {
-                       if (seq->type == SEQ_META && seq->flag & SELECT) {
+                       if (seq->type == SEQ_TYPE_META && seq->flag & SELECT) {
                                calc_sequence(t->scene, seq);
                        }
                }
@@ -3787,7 +3787,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
                        *count = 0;
                        *flag = 0;
                }
-               else if (seq->type == SEQ_META) {
+               else if (seq->type == SEQ_TYPE_META) {
 
                        /* for meta's we only ever need to extend their children, no matter what depth
                         * just check the meta's are in the bounds */
@@ -3844,7 +3844,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
 
                                /* Recursive */
 
-                               if ((seq->type == SEQ_META) && ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == 0)) {
+                               if ((seq->type == SEQ_TYPE_META) && ((seq->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL)) == 0)) {
                                        /* if any handles are selected, don't recurse */
                                        *recursive = TRUE;
                                }
@@ -3859,9 +3859,9 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
 #ifdef SEQ_TX_NESTED_METAS
                        *flag = (seq->flag | SELECT) & ~(SEQ_LEFTSEL|SEQ_RIGHTSEL);
                        *count = 1; /* ignore the selection for nested */
-                       *recursive = (seq->type == SEQ_META);
+                       *recursive = (seq->type == SEQ_TYPE_META);
 #else
-                       if (seq->type == SEQ_META) {
+                       if (seq->type == SEQ_TYPE_META) {
                                /* Meta's can only directly be moved between channels since they
                                 * don't have their start and length set directly (children affect that)
                                 * since this Meta is nested we don't need any of its data in fact.
@@ -4064,7 +4064,7 @@ static void freeSeqData(TransInfo *t)
                                                seq= ((TransDataSeq *)td->extra)->seq;
                                                if ((seq != seq_prev)) {
                                                        /* check effects strips, we cant change their time */
-                                                       if ((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                       if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) {
                                                                has_effect= TRUE;
                                                        }
                                                        else {
@@ -4123,7 +4123,7 @@ static void freeSeqData(TransInfo *t)
                                                for (a=0; a<t->total; a++, td++) {
                                                        seq= ((TransDataSeq *)td->extra)->seq;
                                                        if ((seq != seq_prev)) {
-                                                               if ((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                               if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) {
                                                                        calc_sequence(t->scene, seq);
                                                                }
                                                        }
@@ -4135,7 +4135,7 @@ static void freeSeqData(TransInfo *t)
                                                for (a=0; a<t->total; a++, td++) {
                                                        seq= ((TransDataSeq *)td->extra)->seq;
                                                        if ((seq != seq_prev)) {
-                                                               if ((seq->type & SEQ_EFFECT) && seq->seq1) {
+                                                               if ((seq->type & SEQ_TYPE_EFFECT) && seq->seq1) {
                                                                        if (seq_test_overlap(seqbasep, seq)) {
                                                                                shuffle_seq(seqbasep, seq, t->scene);
                                                                        }
@@ -4150,7 +4150,7 @@ static void freeSeqData(TransInfo *t)
 
                        for (seq= seqbasep->first; seq; seq= seq->next) {
                                /* We might want to build a list of effects that need to be updated during transform */
-                               if (seq->type & SEQ_EFFECT) {
+                               if (seq->type & SEQ_TYPE_EFFECT) {
                                        if      (seq->seq1 && seq->seq1->flag & SELECT) calc_sequence(t->scene, seq);
                                        else if (seq->seq2 && seq->seq2->flag & SELECT) calc_sequence(t->scene, seq);
                                        else if (seq->seq3 && seq->seq3->flag & SELECT) calc_sequence(t->scene, seq);
@@ -4219,7 +4219,7 @@ static void createTransSeqData(bContext *C, TransInfo *t)
                Sequence *seq;
                for (seq= ed->seqbasep->first; seq; seq= seq->next) {
                        /* hack */
-                       if ((seq->flag & SELECT)==0 && seq->type & SEQ_EFFECT) {
+                       if ((seq->flag & SELECT)==0 && seq->type & SEQ_TYPE_EFFECT) {
                                Sequence *seq_user;
                                int i;
                                for (i=0; i<3; i++) {
index b4dc40a81c3bc6e076f022f10e947e52287aa1d7..73b6efedd770ab34e976100fccf9230002d63918 100644 (file)
@@ -72,7 +72,7 @@ typedef struct StripColorBalance {
 } StripColorBalance;
 
 typedef struct StripProxy {
-       char dir[768];         // custom directory for index and proxy files
+       char dir[768];         // custom directory for index and proxy files
                               // (defaults to BL_proxy)
 
        char file[256];        // custom file
@@ -81,7 +81,7 @@ typedef struct StripProxy {
        short tc;              // time code in use
 
        short quality;         // proxy build quality
-       short build_size_flags;// size flags (see below) of all proxies 
+       short build_size_flags; // size flags (see below) of all proxies
                               // to build
        short build_tc_flags;  // time code flags (see below) of all tc indices
                               // to build
@@ -110,23 +110,23 @@ typedef struct Sequence {
        void *lib; /* needed (to be like ipo), else it will raise libdata warnings, this should never be used */
        char name[64]; /* SEQ_NAME_MAXSTR - name, set by default and needs to be unique, for RNA paths */
 
-       int flag, type; /*flags bitmap (see below) and the type of sequence*/
+       int flag, type; /*flags bitmap (see below) and the type of sequence*/
        int len; /* the length of the contents of this strip - before handles are applied */
        int start, startofs, endofs;
        int startstill, endstill;
        int machine, depth; /*machine - the strip channel, depth - the depth in the sequence when dealing with metastrips */
-       int startdisp, enddisp; /*starting and ending points in the sequence*/
+       int startdisp, enddisp; /*starting and ending points in the sequence*/
        float sat;
        float mul, handsize;
 
        short anim_preseek;
-       short streamindex;   /* streamindex for movie or sound files with several streams */
+       short streamindex;    /* streamindex for movie or sound files with several streams */
        int multicam_source;  /* for multicam source selection */
-       int clip_flag;          /* MOVIECLIP render flags */
+       int clip_flag;        /* MOVIECLIP render flags */
 
        Strip *strip;
 
-       struct Ipo *ipo  DNA_DEPRECATED;  /* old animation system, deprecated for 2.5 */
+       struct Ipo *ipo DNA_DEPRECATED;   /* old animation system, deprecated for 2.5 */
        struct Scene *scene;
        struct Object *scene_camera; /* override scene camera */
 
@@ -139,16 +139,16 @@ typedef struct Sequence {
        /* pointers for effects: */
        struct Sequence *seq1, *seq2, *seq3;
 
-       ListBase seqbase;       /* list of strips for metastrips */
+       ListBase seqbase;       /* list of strips for metastrips */
 
-       struct bSound *sound;   /* the linked "bSound" object */
+       struct bSound *sound;   /* the linked "bSound" object */
        void *scene_sound;
        float volume;
 
-       float pitch, pan;       /* pitch (-0.1..10), pan -2..2 */
+       float pitch, pan;     /* pitch (-0.1..10), pan -2..2 */
        float strobe;
 
-       void *effectdata;       /* Struct pointer for effect settings */
+       void *effectdata;     /* Struct pointer for effect settings */
 
        int anim_startofs;    /* only use part of animation file */
        int anim_endofs;      /* is subtle different to startofs / endofs */
@@ -157,8 +157,8 @@ typedef struct Sequence {
        int blend_mode;
        float blend_opacity;
 
-                       /* is sfra needed anymore? - it looks like its only used in one place */
-       int sfra, pad;  /* starting frame according to the timeline of the scene. */
+       /* is sfra needed anymore? - it looks like its only used in one place */
+       int sfra, pad;  /* starting frame according to the timeline of the scene. */
 } Sequence;
 
 typedef struct MetaStack {
@@ -169,7 +169,7 @@ typedef struct MetaStack {
 
 typedef struct Editing {
        ListBase *seqbasep; /* pointer to the current list of seq's being edited (can be within a meta strip) */
-       ListBase seqbase;       /* pointer to the top-most seq's */
+       ListBase seqbase;   /* pointer to the top-most seq's */
        ListBase metastack;
        
        /* Context vars, used to be static */
@@ -189,12 +189,12 @@ typedef struct WipeVars {
 } WipeVars;
 
 typedef struct GlowVars {      
-       float fMini;    /*      Minimum intensity to trigger a glow */
+       float fMini;    /*      Minimum intensity to trigger a glow */
        float fClamp;
-       float fBoost;   /*      Amount to multiply glow intensity */
-       float dDist;    /*      Radius of glow blurring */
-       int     dQuality;
-       int     bNoComp;        /*      SHOW/HIDE glow buffer */
+       float fBoost;   /*      Amount to multiply glow intensity */
+       float dDist;    /*      Radius of glow blurring */
+       int dQuality;
+       int bNoComp;    /*      SHOW/HIDE glow buffer */
 } GlowVars;
 
 typedef struct TransformVars {
@@ -214,7 +214,7 @@ typedef struct SolidColorVars {
 } SolidColorVars;
 
 typedef struct SpeedControlVars {
-       float * frameMap;
+       float *frameMap;
        float globalSpeed;
        int flags;
        int length;
@@ -226,11 +226,11 @@ typedef struct SpeedControlVars {
 #define SELECT 1
 
 /* Editor->over_flag */
-#define SEQ_EDIT_OVERLAY_SHOW                  1
-#define SEQ_EDIT_OVERLAY_ABS                   2
+#define SEQ_EDIT_OVERLAY_SHOW           1
+#define SEQ_EDIT_OVERLAY_ABS            2
 
-#define SEQ_STRIP_OFSBOTTOM            0.2f
-#define SEQ_STRIP_OFSTOP               0.8f
+#define SEQ_STRIP_OFSBOTTOM     0.2f
+#define SEQ_STRIP_OFSTOP        0.8f
 
 /* SpeedControlVars->flags */
 #define SEQ_SPEED_INTEGRATE      1
@@ -238,42 +238,42 @@ typedef struct SpeedControlVars {
 #define SEQ_SPEED_COMPRESS_IPO_Y 4
 
 /* ***************** SEQUENCE ****************** */
-#define SEQ_NAME_MAXSTR                        64
+#define SEQ_NAME_MAXSTR         64
 
 /* seq->flag */
-#define SEQ_LEFTSEL                 (1<<1)
-#define SEQ_RIGHTSEL                (1<<2)
-#define SEQ_OVERLAP                 (1<<3)
-#define SEQ_FILTERY                 (1<<4)
-#define SEQ_MUTE                    (1<<5)
-#define SEQ_MAKE_PREMUL             (1<<6)
-#define SEQ_REVERSE_FRAMES          (1<<7)
-#define SEQ_IPO_FRAME_LOCKED        (1<<8)
-#define SEQ_EFFECT_NOT_LOADED       (1<<9)
-#define SEQ_FLAG_DELETE             (1<<10)
-#define SEQ_FLIPX                   (1<<11)
-#define SEQ_FLIPY                   (1<<12)
-#define SEQ_MAKE_FLOAT              (1<<13)
-#define SEQ_LOCK                    (1<<14)
-#define SEQ_USE_PROXY               (1<<15)
-#define SEQ_USE_TRANSFORM           (1<<16)
-#define SEQ_USE_CROP                (1<<17)
-#define SEQ_USE_COLOR_BALANCE       (1<<18)
-#define SEQ_USE_PROXY_CUSTOM_DIR    (1<<19)
-
-#define SEQ_USE_PROXY_CUSTOM_FILE   (1<<21)
-#define SEQ_USE_EFFECT_DEFAULT_FADE (1<<22)
+#define SEQ_LEFTSEL                 (1 << 1)
+#define SEQ_RIGHTSEL                (1 << 2)
+#define SEQ_OVERLAP                 (1 << 3)
+#define SEQ_FILTERY                 (1 << 4)
+#define SEQ_MUTE                    (1 << 5)
+#define SEQ_MAKE_PREMUL             (1 << 6)
+#define SEQ_REVERSE_FRAMES          (1 << 7)
+#define SEQ_IPO_FRAME_LOCKED        (1 << 8)
+#define SEQ_EFFECT_NOT_LOADED       (1 << 9)
+#define SEQ_FLAG_DELETE             (1 << 10)
+#define SEQ_FLIPX                   (1 << 11)
+#define SEQ_FLIPY                   (1 << 12)
+#define SEQ_MAKE_FLOAT              (1 << 13)
+#define SEQ_LOCK                    (1 << 14)
+#define SEQ_USE_PROXY               (1 << 15)
+#define SEQ_USE_TRANSFORM           (1 << 16)
+#define SEQ_USE_CROP                (1 << 17)
+#define SEQ_USE_COLOR_BALANCE       (1 << 18)
+#define SEQ_USE_PROXY_CUSTOM_DIR    (1 << 19)
+
+#define SEQ_USE_PROXY_CUSTOM_FILE   (1 << 21)
+#define SEQ_USE_EFFECT_DEFAULT_FADE (1 << 22)
 
 // flags for whether those properties are animated or not
-#define SEQ_AUDIO_VOLUME_ANIMATED   (1<<24)
-#define SEQ_AUDIO_PITCH_ANIMATED    (1<<25)
-#define SEQ_AUDIO_PAN_ANIMATED      (1<<26)
-#define SEQ_AUDIO_DRAW_WAVEFORM     (1<<27)
+#define SEQ_AUDIO_VOLUME_ANIMATED   (1 << 24)
+#define SEQ_AUDIO_PITCH_ANIMATED    (1 << 25)
+#define SEQ_AUDIO_PAN_ANIMATED      (1 << 26)
+#define SEQ_AUDIO_DRAW_WAVEFORM     (1 << 27)
 
-#define SEQ_INVALID_EFFECT          (1<<31)
+#define SEQ_INVALID_EFFECT          (1 << 31)
 
 /* convenience define for all selection flags */
-#define SEQ_ALLSEL     (SELECT+SEQ_LEFTSEL+SEQ_RIGHTSEL)
+#define SEQ_ALLSEL  (SELECT + SEQ_LEFTSEL + SEQ_RIGHTSEL)
 
 /* deprecated, don't use a flag anymore*/
 /*#define SEQ_ACTIVE                            1048576*/
@@ -296,51 +296,52 @@ typedef struct SpeedControlVars {
 #define SEQ_PROXY_TC_RECORD_RUN_NO_GAPS         8
 #define SEQ_PROXY_TC_ALL                        15
 
-/* seq->type WATCH IT: SEQ_EFFECT BIT is used to determine if this is an effect strip!!! */
-#define SEQ_IMAGE              0
-#define SEQ_META               1
-#define SEQ_SCENE              2
-#define SEQ_MOVIE              3
-#define SEQ_RAM_SOUND          4
-#define SEQ_HD_SOUND            5
-#define SEQ_SOUND              4
-#define SEQ_MOVIECLIP           6
-
-#define SEQ_EFFECT             8
-#define SEQ_CROSS              8
-#define SEQ_ADD                        9
-#define SEQ_SUB                        10
-#define SEQ_ALPHAOVER  11
-#define SEQ_ALPHAUNDER 12
-#define SEQ_GAMCROSS   13
-#define SEQ_MUL                        14
-#define SEQ_OVERDROP   15
-// #define SEQ_PLUGIN          24 /* Deprecated */
-#define SEQ_WIPE               25
-#define SEQ_GLOW               26
-#define SEQ_TRANSFORM          27
-#define SEQ_COLOR               28
-#define SEQ_SPEED               29
-#define SEQ_MULTICAM            30
-#define SEQ_ADJUSTMENT          31
-#define SEQ_EFFECT_MAX          31
+/* seq->type WATCH IT: SEQ_TYPE_EFFECT BIT is used to determine if this is an effect strip!!! */
+enum {
+       SEQ_TYPE_IMAGE       = 0,
+       SEQ_TYPE_META        = 1,
+       SEQ_TYPE_SCENE       = 2,
+       SEQ_TYPE_MOVIE       = 3,
+       SEQ_TYPE_SOUND_RAM   = 4,
+       SEQ_TYPE_SOUND_HD    = 5,
+       SEQ_TYPE_MOVIECLIP   = 6,
+
+       SEQ_TYPE_EFFECT      = 8,
+       SEQ_TYPE_CROSS       = 8,
+       SEQ_TYPE_ADD         = 9,
+       SEQ_TYPE_SUB         = 10,
+       SEQ_TYPE_ALPHAOVER   = 11,
+       SEQ_TYPE_ALPHAUNDER  = 12,
+       SEQ_TYPE_GAMCROSS    = 13,
+       SEQ_TYPE_MUL         = 14,
+       SEQ_TYPE_OVERDROP    = 15,
+       /* SEQ_TYPE_PLUGIN      = 24, */ /* Deprecated */
+       SEQ_TYPE_WIPE        = 25,
+       SEQ_TYPE_GLOW        = 26,
+       SEQ_TYPE_TRANSFORM   = 27,
+       SEQ_TYPE_COLOR       = 28,
+       SEQ_TYPE_SPEED       = 29,
+       SEQ_TYPE_MULTICAM    = 30,
+       SEQ_TYPE_ADJUSTMENT  = 31,
+       SEQ_TYPE_EFFECT_MAX  = 31
+};
 
 #define STRIPELEM_FAILED       0
 #define STRIPELEM_OK           1
 
 #define STRIPELEM_PREVIEW_DONE  1
 
-#define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1<<0)
-#define SEQ_MOVIECLIP_RENDER_STABILIZED  (1<<1)
+#define SEQ_MOVIECLIP_RENDER_UNDISTORTED (1 << 0)
+#define SEQ_MOVIECLIP_RENDER_STABILIZED  (1 << 1)
 
 #define SEQ_BLEND_REPLACE      0
-/* all other BLEND_MODEs are simple SEQ_EFFECT ids and therefore identical
+/* all other BLEND_MODEs are simple SEQ_TYPE_EFFECT ids and therefore identical
  * to the table above. (Only those effects that handle _exactly_ two inputs,
  * otherwise, you can't really blend, right :) !)
  */
 
 
-#define SEQ_HAS_PATH(_seq) (ELEM4((_seq)->type, SEQ_MOVIE, SEQ_IMAGE, SEQ_RAM_SOUND, SEQ_HD_SOUND))
+#define SEQ_HAS_PATH(_seq) (ELEM4((_seq)->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD))
 
 #endif
 
index 09e0428058a83d90042ab0da8aabc03b717b092b..b2ff36285e6f80ec76f528b5cb8baa65d59f17d6 100644 (file)
@@ -90,11 +90,14 @@ static void rna_Scene_collada_export(
        const char *filepath,
        int selected,
        int apply_modifiers,
+       int include_armatures,
        int include_bone_children,
        int use_object_instantiation,
        int second_life)
 {
-       collada_export(scene, filepath, selected, apply_modifiers, include_bone_children, use_object_instantiation, second_life);
+       collada_export(scene, filepath, selected, apply_modifiers, 
+               include_armatures, include_bone_children, 
+               use_object_instantiation, second_life);
 }
 
 #endif
@@ -124,6 +127,7 @@ void RNA_api_scene(StructRNA *srna)
        RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */
        parm = RNA_def_boolean(func, "selected", 0, "Selection Only", "Export only selected elements");
        parm = RNA_def_boolean(func, "apply_modifiers", 0, "Apply Modifiers", "Apply modifiers (in Preview resolution)");
+       parm = RNA_def_boolean(func, "include_armatures", 0, "Include Armatures", "Include armature(s) used by the exported objects");
        parm = RNA_def_boolean(func, "include_bone_children", 0, "Include Bone Children", "Include all objects attached to bones of selected Armature(s)");
        parm = RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instantiation", "Instantiate multiple Objects from same Data");
        parm = RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life");
index 9082bb42be54b9a77ba1a022af729425edb759b4..1edf144452d8ea4f873b69bca6b2e445703347d4 100644 (file)
@@ -64,7 +64,7 @@ static void meta_tmp_ref(Sequence *seq_par, Sequence *seq)
 {
        for (; seq; seq = seq->next) {
                seq->tmp = seq_par;
-               if (seq->type == SEQ_META) {
+               if (seq->type == SEQ_TYPE_META) {
                        meta_tmp_ref(seq, seq->seqbase.first);
                }
        }
@@ -396,47 +396,47 @@ static StructRNA *rna_Sequence_refine(struct PointerRNA *ptr)
        Sequence *seq = (Sequence *)ptr->data;
 
        switch (seq->type) {
-               case SEQ_IMAGE:
+               case SEQ_TYPE_IMAGE:
                        return &RNA_ImageSequence;
-               case SEQ_META:
+               case SEQ_TYPE_META:
                        return &RNA_MetaSequence;
-               case SEQ_SCENE:
+               case SEQ_TYPE_SCENE:
                        return &RNA_SceneSequence;
-               case SEQ_MOVIE:
+               case SEQ_TYPE_MOVIE:
                        return &RNA_MovieSequence;
-               case SEQ_MOVIECLIP:
+               case SEQ_TYPE_MOVIECLIP:
                        return &RNA_MovieClipSequence;
-               case SEQ_SOUND:
+               case SEQ_TYPE_SOUND_RAM:
                        return &RNA_SoundSequence;
-               case SEQ_CROSS:
+               case SEQ_TYPE_CROSS:
                        return &RNA_CrossSequence;
-               case SEQ_ADD:
+               case SEQ_TYPE_ADD:
                        return &RNA_AddSequence;
-               case SEQ_SUB:
+               case SEQ_TYPE_SUB:
                        return &RNA_SubtractSequence;
-               case SEQ_ALPHAOVER:
+               case SEQ_TYPE_ALPHAOVER:
                        return &RNA_AlphaOverSequence;
-               case SEQ_ALPHAUNDER:
+               case SEQ_TYPE_ALPHAUNDER:
                        return &RNA_AlphaUnderSequence;
-               case SEQ_GAMCROSS:
+               case SEQ_TYPE_GAMCROSS:
                        return &RNA_GammaCrossSequence;
-               case SEQ_MUL:
+               case SEQ_TYPE_MUL:
                        return &RNA_MultiplySequence;
-               case SEQ_OVERDROP:
+               case SEQ_TYPE_OVERDROP:
                        return &RNA_OverDropSequence;
-               case SEQ_MULTICAM:
+               case SEQ_TYPE_MULTICAM:
                        return &RNA_MulticamSequence;
-               case SEQ_ADJUSTMENT:
+               case SEQ_TYPE_ADJUSTMENT:
                        return &RNA_AdjustmentSequence;
-               case SEQ_WIPE:
+               case SEQ_TYPE_WIPE:
                        return &RNA_WipeSequence;
-               case SEQ_GLOW:
+               case SEQ_TYPE_GLOW:
                        return &RNA_GlowSequence;
-               case SEQ_TRANSFORM:
+               case SEQ_TYPE_TRANSFORM:
                        return &RNA_TransformSequence;
-               case SEQ_COLOR:
+               case SEQ_TYPE_COLOR:
                        return &RNA_ColorSequence;
-               case SEQ_SPEED:
+               case SEQ_TYPE_SPEED:
                        return &RNA_SpeedControlSequence;
                default:
                        return &RNA_Sequence;
@@ -469,7 +469,7 @@ static void rna_Sequence_filepath_set(PointerRNA *ptr, const char *value)
 {
        Sequence *seq = (Sequence *)(ptr->data);
 
-       if (seq->type == SEQ_SOUND && seq->sound) {
+       if (seq->type == SEQ_TYPE_SOUND_RAM && seq->sound) {
                /* for sound strips we need to update the sound as well.
                 * arguably, this could load in a new sound rather than modify an existing one.
                 * but while using the sequencer its most likely your not using the sound in the game engine too.
@@ -967,14 +967,14 @@ static void rna_def_strip_color_balance(BlenderRNA *brna)
 
 EnumPropertyItem blend_mode_items[] = {
        {SEQ_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
-       {SEQ_CROSS, "CROSS", 0, "Cross", ""},
-       {SEQ_ADD, "ADD", 0, "Add", ""},
-       {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
-       {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
-       {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
-       {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
-       {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
-       {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
+       {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
+       {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
+       {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
+       {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
+       {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
+       {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
+       {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
+       {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
        {0, NULL, 0, NULL, NULL}
 };
 
@@ -984,27 +984,27 @@ static void rna_def_sequence(BlenderRNA *brna)
        PropertyRNA *prop;
 
        static const EnumPropertyItem seq_type_items[] = {
-               {SEQ_IMAGE, "IMAGE", 0, "Image", ""},
-               {SEQ_META, "META", 0, "Meta", ""},
-               {SEQ_SCENE, "SCENE", 0, "Scene", ""},
-               {SEQ_MOVIE, "MOVIE", 0, "Movie", ""},
-               {SEQ_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
-               {SEQ_SOUND, "SOUND", 0, "Sound", ""},
-               {SEQ_CROSS, "CROSS", 0, "Cross", ""},
-               {SEQ_ADD, "ADD", 0, "Add", ""},
-               {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
-               {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
-               {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
-               {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
-               {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
-               {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
-               {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
-               {SEQ_GLOW, "GLOW", 0, "Glow", ""},
-               {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
-               {SEQ_COLOR, "COLOR", 0, "Color", ""},
-               {SEQ_SPEED, "SPEED", 0, "Speed", ""},
-               {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
-               {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
+               {SEQ_TYPE_IMAGE, "IMAGE", 0, "Image", ""},
+               {SEQ_TYPE_META, "META", 0, "Meta", ""},
+               {SEQ_TYPE_SCENE, "SCENE", 0, "Scene", ""},
+               {SEQ_TYPE_MOVIE, "MOVIE", 0, "Movie", ""},
+               {SEQ_TYPE_MOVIECLIP, "MOVIECLIP", 0, "Clip", ""},
+               {SEQ_TYPE_SOUND_RAM, "SOUND", 0, "Sound", ""},
+               {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
+               {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
+               {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
+               {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
+               {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
+               {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
+               {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
+               {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
+               {SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
+               {SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
+               {SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
+               {SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
+               {SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
+               {SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
+               {SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
                {0, NULL, 0, NULL, NULL}
        };
        
index 2fb882d96a1b6e63d79a454b96beac66711b8554..bbc772770ea9aa4a8d7f1c9a9591e85fa3bfbcaf 100644 (file)
@@ -104,7 +104,7 @@ static Sequence *rna_Sequences_new_clip(ID *id, Editing *ed, ReportList *reports
        Scene *scene = (Scene *)id;
        Sequence *seq;
 
-       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_MOVIECLIP, clip->name);
+       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_MOVIECLIP, clip->name);
        seq->clip = clip;
        seq->len =  BKE_movieclip_get_duration(clip);
        id_us_plus((ID *)clip);
@@ -123,7 +123,7 @@ static Sequence *rna_Sequences_new_scene(ID *id, Editing *ed, ReportList *report
        Scene *scene = (Scene *)id;
        Sequence *seq;
 
-       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_SCENE, NULL);
+       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_SCENE, NULL);
        seq->scene = sce_seq;
        seq->len = sce_seq->r.efra - sce_seq->r.sfra + 1;
        seq->scene_sound = sound_scene_add_scene_sound(scene, seq, start_frame, start_frame + seq->len, 0);
@@ -143,7 +143,7 @@ static Sequence *rna_Sequences_new_image(ID *id, Editing *ed, ReportList *report
        Scene *scene = (Scene *)id;
        Sequence *seq;
 
-       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_IMAGE, file);
+       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_IMAGE, file);
        seq->len = 1;
 
        if (seq->strip->stripdata->name[0] == '\0') {
@@ -174,7 +174,7 @@ static Sequence *rna_Sequences_new_movie(ID *id, Editing *ed, ReportList *report
                return NULL;
        }
 
-       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_MOVIE, file);
+       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_MOVIE, file);
        seq->anim = an;
        seq->anim_preseek = IMB_anim_get_preseek(an);
        seq->len = IMB_anim_get_duration(an, IMB_TC_RECORD_RUN);
@@ -200,7 +200,7 @@ static Sequence *rna_Sequences_new_sound(ID *id, Editing *ed, Main *bmain, Repor
                return NULL;
        }
 
-       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_SOUND, sound->name);
+       seq = alloc_generic_sequence(ed, name, start_frame, channel, SEQ_TYPE_SOUND_RAM, sound->name);
        seq->sound = sound;
        seq->len = ceil((double)sound_get_length(sound) * FPS);
 
@@ -411,21 +411,21 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop)
        FunctionRNA *func;
 
        static EnumPropertyItem seq_effect_items[] = {
-               {SEQ_CROSS, "CROSS", 0, "Cross", ""},
-               {SEQ_ADD, "ADD", 0, "Add", ""},
-               {SEQ_SUB, "SUBTRACT", 0, "Subtract", ""},
-               {SEQ_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
-               {SEQ_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
-               {SEQ_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
-               {SEQ_MUL, "MULTIPLY", 0, "Multiply", ""},
-               {SEQ_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
-               {SEQ_WIPE, "WIPE", 0, "Wipe", ""},
-               {SEQ_GLOW, "GLOW", 0, "Glow", ""},
-               {SEQ_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
-               {SEQ_COLOR, "COLOR", 0, "Color", ""},
-               {SEQ_SPEED, "SPEED", 0, "Speed", ""},
-               {SEQ_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
-               {SEQ_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
+               {SEQ_TYPE_CROSS, "CROSS", 0, "Cross", ""},
+               {SEQ_TYPE_ADD, "ADD", 0, "Add", ""},
+               {SEQ_TYPE_SUB, "SUBTRACT", 0, "Subtract", ""},
+               {SEQ_TYPE_ALPHAOVER, "ALPHA_OVER", 0, "Alpha Over", ""},
+               {SEQ_TYPE_ALPHAUNDER, "ALPHA_UNDER", 0, "Alpha Under", ""},
+               {SEQ_TYPE_GAMCROSS, "GAMMA_CROSS", 0, "Gamma Cross", ""},
+               {SEQ_TYPE_MUL, "MULTIPLY", 0, "Multiply", ""},
+               {SEQ_TYPE_OVERDROP, "OVER_DROP", 0, "Over Drop", ""},
+               {SEQ_TYPE_WIPE, "WIPE", 0, "Wipe", ""},
+               {SEQ_TYPE_GLOW, "GLOW", 0, "Glow", ""},
+               {SEQ_TYPE_TRANSFORM, "TRANSFORM", 0, "Transform", ""},
+               {SEQ_TYPE_COLOR, "COLOR", 0, "Color", ""},
+               {SEQ_TYPE_SPEED, "SPEED", 0, "Speed", ""},
+               {SEQ_TYPE_MULTICAM, "MULTICAM", 0, "Multicam Selector", ""},
+               {SEQ_TYPE_ADJUSTMENT, "ADJUSTMENT", 0, "Adjustment Layer", ""},
                {0, NULL, 0, NULL, NULL}
        };
 
index 170d2efd60c8cc9b346bb69b176198dc82b065c2..8f5230e4b2ba25ce5bd9425f2f7c4fc3a2fec7e0 100644 (file)
@@ -1636,7 +1636,7 @@ int RE_seq_render_active(Scene *scene, RenderData *rd)
                return 0;
        
        for (seq= ed->seqbase.first; seq; seq= seq->next) {
-               if (seq->type != SEQ_SOUND)
+               if (seq->type != SEQ_TYPE_SOUND_RAM)
                        return 1;
        }
        
@@ -1761,7 +1761,7 @@ static int check_valid_camera(Scene *scene, Object *camera_override)
                        check_comp= 0;
 
                        while (seq) {
-                               if (seq->type == SEQ_SCENE && seq->scene) {
+                               if (seq->type == SEQ_TYPE_SCENE && seq->scene) {
                                        if (!seq->scene_camera) {
                                                if (!seq->scene->camera && !BKE_scene_camera_find(seq->scene)) {
                                                        if (seq->scene == scene) {
index 1cf58b4345bf72cef72a31b11f32bafe0ac3705b..ed023e42ea3fc0cbb9f64fc871c896fcaf73724b 100644 (file)
@@ -2162,7 +2162,11 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED
 static int wm_collada_export_exec(bContext *C, wmOperator *op)
 {
        char filename[FILE_MAX];
-       int selected, second_life, apply_modifiers, include_bone_children, use_object_instantiation;
+       int selected, second_life, 
+               include_armatures,
+               apply_modifiers, 
+               include_bone_children,
+               use_object_instantiation;
        
        if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
                BKE_report(op->reports, RPT_ERROR, "No filename given");
@@ -2174,6 +2178,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
        /* Options panel */
        selected                 = RNA_boolean_get(op->ptr, "selected");
        apply_modifiers          = RNA_boolean_get(op->ptr, "apply_modifiers");
+       include_armatures        = RNA_boolean_get(op->ptr, "include_armatures");
        include_bone_children    = RNA_boolean_get(op->ptr, "include_bone_children");
        use_object_instantiation = RNA_boolean_get(op->ptr, "use_object_instantiation");
        second_life              = RNA_boolean_get(op->ptr, "second_life");
@@ -2186,6 +2191,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
                filename,
                selected,
                apply_modifiers,
+               include_armatures,
                include_bone_children,
                use_object_instantiation,
                second_life)) {
@@ -2216,6 +2222,9 @@ static void WM_OT_collada_export(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "apply_modifiers", 0, "Apply Modifiers",
                        "Apply modifiers (Preview Resolution)");
 
+       RNA_def_boolean(ot->srna, "include_armatures", 0, "Include Armatures",
+                       "Include armature(s) used by the exported objects");
+
        RNA_def_boolean(ot->srna, "include_bone_children", 0, "Include Bone Children",
                        "Include all objects attached to bones of selected Armature(s)");