Merging r50226 through r50236 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Aug 2012 08:28:29 +0000 (08:28 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Aug 2012 08:28:29 +0000 (08:28 +0000)
source/blender/blenkernel/BKE_mask.h
source/blender/blenkernel/intern/mask.c
source/blender/blenkernel/intern/mask_evaluate.c
source/blender/blenkernel/intern/seqeffects.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/mask/mask_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_conversions.c
source/gameengine/Ketsji/KX_Scene.cpp

index a1c36d533681143b2741552f007a2000fbe9e8a0..9cf5a7f31a573ac3de5ef2f0e6a8850902edd7d7 100644 (file)
@@ -84,19 +84,6 @@ void BKE_mask_point_handle(struct MaskSplinePoint *point, float handle[2]);
 void BKE_mask_point_set_handle(struct MaskSplinePoint *point, float loc[2], int keep_direction,
                                float orig_handle[2], float orig_vec[3][3]);
 
-float *BKE_mask_point_segment_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                   unsigned int *tot_diff_point);
-float *BKE_mask_point_segment_feather_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                           unsigned int *tot_feather_point);
-
-float *BKE_mask_point_segment_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                                   int width, int height,
-                                                   unsigned int *tot_diff_point);
-
-float *BKE_mask_point_segment_feather_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
-                                                           int width, int height,
-                                                           unsigned int *tot_feather_point);
-
 void BKE_mask_point_segment_co(struct MaskSpline *spline, struct MaskSplinePoint *point, float u, float co[2]);
 void BKE_mask_point_normal(struct MaskSpline *spline, struct MaskSplinePoint *point,
                            float u, float n[2]);
@@ -189,6 +176,7 @@ int BKE_mask_get_duration(struct Mask *mask);
 
 #define MASK_RESOL_MAX 128
 
+
 /* mask_evaluate.c */
 unsigned int BKE_mask_spline_resolution(struct MaskSpline *spline, int width, int height);
 unsigned int BKE_mask_spline_feather_resolution(struct MaskSpline *spline, int width, int height);
@@ -205,9 +193,21 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct
                                                                          const unsigned int resol, const int do_feather_isect))[2];
 float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, int width, int height,
                                                                       int *tot_feather_point, const int do_feather_isect))[2];
-
+/* *** mask point functions which involve evaluation *** */
 float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
 
+float *BKE_mask_point_segment_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                   unsigned int *tot_diff_point);
+float *BKE_mask_point_segment_feather_diff(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                           unsigned int *tot_feather_point);
+
+float *BKE_mask_point_segment_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                                   int width, int height,
+                                                   unsigned int *tot_diff_point);
+
+float *BKE_mask_point_segment_feather_diff_with_resolution(struct MaskSpline *spline, struct MaskSplinePoint *point,
+                                                           int width, int height,
+                                                           unsigned int *tot_feather_point);
 
 /* mask_rasterize.c */
 struct MaskRasterHandle;
index d7f6b6f6b25f63e0633a9dc34de095d596d893c6..5182c52605a156360630889087d3d9d764bff910 100644 (file)
@@ -483,73 +483,6 @@ void BKE_mask_point_set_handle(MaskSplinePoint *point, float loc[2], int keep_di
        }
 }
 
-float *BKE_mask_point_segment_feather_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
-                                                           int width, int height,
-                                                           unsigned int *tot_feather_point)
-{
-       float *feather, *fp;
-       unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
-       unsigned int i;
-
-       feather = fp = MEM_callocN(2 * resol * sizeof(float), "mask point spline feather diff points");
-
-       for (i = 0; i < resol; i++, fp += 2) {
-               float u = (float)(i % resol) / resol, weight;
-               float co[2], n[2];
-
-               BKE_mask_point_segment_co(spline, point, u, co);
-               BKE_mask_point_normal(spline, point, u, n);
-               weight = BKE_mask_point_weight(spline, point, u);
-
-               fp[0] = co[0] + n[0] * weight;
-               fp[1] = co[1] + n[1] * weight;
-       }
-
-       *tot_feather_point = resol;
-
-       return feather;
-}
-
-float *BKE_mask_point_segment_feather_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_feather_point)
-{
-       return BKE_mask_point_segment_feather_diff_with_resolution(spline, point, 0, 0, tot_feather_point);
-}
-
-float *BKE_mask_point_segment_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
-                                                   int width, int height, unsigned int *tot_diff_point)
-{
-       MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
-
-       BezTriple *bezt, *bezt_next;
-       float *diff_points, *fp;
-       int j, resol = BKE_mask_spline_resolution(spline, width, height);
-
-       bezt = &point->bezt;
-       bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
-
-       if (!bezt_next)
-               return NULL;
-
-       /* resol+1 because of 'forward_diff_bezier' function */
-       *tot_diff_point = resol + 1;
-       diff_points = fp = MEM_callocN((resol + 1) * 2 * sizeof(float), "mask segment vets");
-
-       for (j = 0; j < 2; j++) {
-               BKE_curve_forward_diff_bezier(bezt->vec[1][j], bezt->vec[2][j],
-                                             bezt_next->vec[0][j], bezt_next->vec[1][j],
-                                             fp + j, resol, 2 * sizeof(float));
-       }
-
-       copy_v2_v2(fp + 2 * resol, bezt_next->vec[1]);
-
-       return diff_points;
-}
-
-float *BKE_mask_point_segment_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_diff_point)
-{
-       return BKE_mask_point_segment_diff_with_resolution(spline, point, 0, 0, tot_diff_point);
-}
-
 void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float u, float co[2])
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
index 4480fbf53b59ba54b5c0bded0c604b68644d5f87..9d9f1665a7babf6bcf09aa7b27d134ba292687ca 100644 (file)
@@ -70,27 +70,24 @@ unsigned int BKE_mask_spline_resolution(MaskSpline *spline, int width, int heigh
        unsigned int i, resol = 1;
 
        if (width != 0 && height != 0) {
-               if (width >= height)
-                       max_segment = 1.0f / (float) width;
-               else
-                       max_segment = 1.0f / (float) height;
+               max_segment = 1.0f / (float)maxi(width, height);
        }
 
        for (i = 0; i < spline->tot_point; i++) {
                MaskSplinePoint *point = &spline->points[i];
-               BezTriple *bezt, *bezt_next;
+               BezTriple *bezt_curr, *bezt_next;
                float a, b, c, len;
                unsigned int cur_resol;
 
-               bezt = &point->bezt;
+               bezt_curr = &point->bezt;
                bezt_next = BKE_mask_spline_point_next_bezt(spline, spline->points, point);
 
                if (bezt_next == NULL) {
                        break;
                }
 
-               a = len_v3v3(bezt->vec[1], bezt->vec[2]);
-               b = len_v3v3(bezt->vec[2], bezt_next->vec[0]);
+               a = len_v3v3(bezt_curr->vec[1], bezt_curr->vec[2]);
+               b = len_v3v3(bezt_curr->vec[2], bezt_next->vec[0]);
                c = len_v3v3(bezt_next->vec[0], bezt_next->vec[1]);
 
                len = a + b + c;
@@ -165,7 +162,7 @@ float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
 
-       MaskSplinePoint *point, *prev;
+       MaskSplinePoint *point_curr, *point_prev;
        float (*diff_points)[2], (*fp)[2];
        const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
        int a;
@@ -184,34 +181,34 @@ float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
        if (spline->flag & MASK_SPLINE_CYCLIC)
                a++;
 
-       prev = points_array;
-       point = prev + 1;
+       point_prev = points_array;
+       point_curr = point_prev + 1;
 
        while (a--) {
-               BezTriple *prevbezt;
-               BezTriple *bezt;
+               BezTriple *bezt_prev;
+               BezTriple *bezt_curr;
                int j;
 
                if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
-                       point = points_array;
+                       point_curr = points_array;
 
-               prevbezt = &prev->bezt;
-               bezt = &point->bezt;
+               bezt_prev = &point_prev->bezt;
+               bezt_curr = &point_curr->bezt;
 
                for (j = 0; j < 2; j++) {
-                       BKE_curve_forward_diff_bezier(prevbezt->vec[1][j], prevbezt->vec[2][j],
-                                                     bezt->vec[0][j], bezt->vec[1][j],
+                       BKE_curve_forward_diff_bezier(bezt_prev->vec[1][j], bezt_prev->vec[2][j],
+                                                     bezt_curr->vec[0][j], bezt_curr->vec[1][j],
                                                      &(*fp)[j], resol, 2 * sizeof(float));
                }
 
                fp += resol;
 
                if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC) == 0) {
-                       copy_v2_v2(*fp, bezt->vec[1]);
+                       copy_v2_v2(*fp, bezt_curr->vec[1]);
                }
 
-               prev = point;
-               point++;
+               point_prev = point_curr;
+               point_curr++;
        }
 
        return diff_points;
@@ -521,7 +518,7 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
                                                                          ))[2]
 {
        MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
-       MaskSplinePoint *point, *prev;
+       MaskSplinePoint *point_curr, *point_prev;
        float (*feather)[2], (*fp)[2];
 
        const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
@@ -534,20 +531,20 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
        if (spline->flag & MASK_SPLINE_CYCLIC)
                a++;
 
-       prev = points_array;
-       point = prev + 1;
+       point_prev = points_array;
+       point_curr = point_prev + 1;
 
        while (a--) {
-               /* BezTriple *prevbezt; */  /* UNUSED */
-               /* BezTriple *bezt; */      /* UNUSED */
+               /* BezTriple *bezt_prev; */  /* UNUSED */
+               /* BezTriple *bezt_curr; */      /* UNUSED */
                int j;
 
                if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
-                       point = points_array;
+                       point_curr = points_array;
 
 
-               /* prevbezt = &prev->bezt; */
-               /* bezt = &point->bezt; */
+               /* bezt_prev = &point_prev->bezt; */
+               /* bezt_curr = &point_curr->bezt; */
 
                for (j = 0; j < resol; j++, fp++) {
                        float u = (float) j / resol, weight;
@@ -555,9 +552,9 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
 
                        /* TODO - these calls all calculate similar things
                         * could be unified for some speed */
-                       BKE_mask_point_segment_co(spline, prev, u, co);
-                       BKE_mask_point_normal(spline, prev, u, n);
-                       weight = BKE_mask_point_weight(spline, prev, u);
+                       BKE_mask_point_segment_co(spline, point_prev, u, co);
+                       BKE_mask_point_normal(spline, point_prev, u, n);
+                       weight = BKE_mask_point_weight(spline, point_prev, u);
 
                        madd_v2_v2v2fl(*fp, co, n, weight);
                }
@@ -566,15 +563,15 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
                        float u = 1.0f, weight;
                        float co[2], n[2];
 
-                       BKE_mask_point_segment_co(spline, prev, u, co);
-                       BKE_mask_point_normal(spline, prev, u, n);
-                       weight = BKE_mask_point_weight(spline, prev, u);
+                       BKE_mask_point_segment_co(spline, point_prev, u, co);
+                       BKE_mask_point_normal(spline, point_prev, u, n);
+                       weight = BKE_mask_point_weight(spline, point_prev, u);
 
                        madd_v2_v2v2fl(*fp, co, n, weight);
                }
 
-               prev = point;
-               point++;
+               point_prev = point_curr;
+               point_curr++;
        }
 
        *tot_feather_point = tot;
@@ -645,3 +642,71 @@ float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_poin
 
        return feather;
 }
+
+/* *** mask point functions which involve evaluation *** */
+float *BKE_mask_point_segment_feather_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
+                                                           int width, int height,
+                                                           unsigned int *tot_feather_point)
+{
+       float *feather, *fp;
+       unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
+       unsigned int i;
+
+       feather = fp = MEM_callocN(2 * resol * sizeof(float), "mask point spline feather diff points");
+
+       for (i = 0; i < resol; i++, fp += 2) {
+               float u = (float)(i % resol) / resol, weight;
+               float co[2], n[2];
+
+               BKE_mask_point_segment_co(spline, point, u, co);
+               BKE_mask_point_normal(spline, point, u, n);
+               weight = BKE_mask_point_weight(spline, point, u);
+
+               fp[0] = co[0] + n[0] * weight;
+               fp[1] = co[1] + n[1] * weight;
+       }
+
+       *tot_feather_point = resol;
+
+       return feather;
+}
+
+float *BKE_mask_point_segment_feather_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_feather_point)
+{
+       return BKE_mask_point_segment_feather_diff_with_resolution(spline, point, 0, 0, tot_feather_point);
+}
+
+float *BKE_mask_point_segment_diff_with_resolution(MaskSpline *spline, MaskSplinePoint *point,
+                                                   int width, int height, unsigned int *tot_diff_point)
+{
+       MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
+
+       BezTriple *bezt, *bezt_next;
+       float *diff_points, *fp;
+       int j, resol = BKE_mask_spline_resolution(spline, width, height);
+
+       bezt = &point->bezt;
+       bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
+
+       if (!bezt_next)
+               return NULL;
+
+       /* resol+1 because of 'forward_diff_bezier' function */
+       *tot_diff_point = resol + 1;
+       diff_points = fp = MEM_callocN((resol + 1) * 2 * sizeof(float), "mask segment vets");
+
+       for (j = 0; j < 2; j++) {
+               BKE_curve_forward_diff_bezier(bezt->vec[1][j], bezt->vec[2][j],
+                                             bezt_next->vec[0][j], bezt_next->vec[1][j],
+                                             fp + j, resol, 2 * sizeof(float));
+       }
+
+       copy_v2_v2(fp + 2 * resol, bezt_next->vec[1]);
+
+       return diff_points;
+}
+
+float *BKE_mask_point_segment_diff(MaskSpline *spline, MaskSplinePoint *point, unsigned int *tot_diff_point)
+{
+       return BKE_mask_point_segment_diff_with_resolution(spline, point, 0, 0, tot_diff_point);
+}
index e1fd5a1639fde909308c30b3567e0568f3f329c9..e1c3decf24fdc5f1eaed7d0f3756a4248e28ac3c 100644 (file)
@@ -57,7 +57,7 @@
 
 #include "RNA_access.h"
 
-static void slize_get_byte_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,
+static void slice_get_byte_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,
                                    const ImBuf *ibuf3, const ImBuf *out, int start_line, unsigned char **rect1,
                                    unsigned char **rect2, unsigned char **rect3, unsigned char **rect_out)
 {
@@ -73,7 +73,7 @@ static void slize_get_byte_buffers(const SeqRenderData *context, const ImBuf *ib
                *rect3 = (unsigned char*) ibuf3->rect + offset;
 }
 
-static void slize_get_float_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,
+static void slice_get_float_buffers(const SeqRenderData *context, const ImBuf *ibuf1, const ImBuf *ibuf2,
                                     const ImBuf *ibuf3, const ImBuf *out, int start_line,
                                     float **rect1, float **rect2, float **rect3, float **rect_out)
 {
@@ -289,14 +289,14 @@ static void do_alphaover_effect(SeqRenderData context, Sequence *UNUSED(seq), fl
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaover_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaover_effect_byte(facf0, facf1, context.rectx, total_lines, (char *) rect1, (char *) rect2, (char *) rect_out);
        }
@@ -451,14 +451,14 @@ static void do_alphaunder_effect(SeqRenderData context, Sequence *UNUSED(seq), f
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaunder_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_alphaunder_effect_byte(facf0, facf1, context.rectx, total_lines, (char *) rect1, (char *) rect2, (char *) rect_out);
        }
@@ -561,14 +561,14 @@ static void do_cross_effect(SeqRenderData context, Sequence *UNUSED(seq), float
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_cross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_cross_effect_byte(facf0, facf1, context.rectx, total_lines, (char *) rect1, (char *) rect2, (char *) rect_out);
        }
@@ -810,14 +810,14 @@ static void do_gammacross_effect(SeqRenderData context, Sequence *UNUSED(seq), f
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_gammacross_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_gammacross_effect_byte(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
@@ -916,14 +916,14 @@ static void do_add_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_add_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_add_effect_byte(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
@@ -1020,14 +1020,14 @@ static void do_sub_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_sub_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_sub_effect_byte(facf0, facf1, context.rectx, total_lines, (char *) rect1, (char *) rect2, (char *) rect_out);
        }
@@ -1217,14 +1217,14 @@ static void do_mul_effect(SeqRenderData context, Sequence *UNUSED(seq), float UN
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_mul_effect_float(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_mul_effect_byte(facf0, facf1, context.rectx, total_lines, rect1, rect2, rect_out);
        }
@@ -2751,7 +2751,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
        if (out->rect_float) {
                float *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_float_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_drop_effect_float(facf0, facf1, x, y, rect1, rect2, rect_out);
                do_alphaover_effect_float(facf0, facf1, x, y, rect1, rect2, rect_out);
@@ -2759,7 +2759,7 @@ static void do_overdrop_effect(SeqRenderData context, Sequence *UNUSED(seq), flo
        else {
                unsigned char *rect1 = NULL, *rect2 = NULL, *rect_out = NULL;
 
-               slize_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
+               slice_get_byte_buffers(&context, ibuf1, ibuf2, NULL, out, start_line, &rect1, &rect2, NULL, &rect_out);
 
                do_drop_effect_byte(facf0, facf1, x, y, (char *) rect1, (char *) rect2, (char *) rect_out);
                do_alphaover_effect_byte(facf0, facf1, x, y, (char *) rect1, (char *) rect2, (char *) rect_out);
index d024e2b0393e58c2fbb3948a06e14dfe925b0df8..46537674e595435b665f05a3ef920f1406187789 100644 (file)
@@ -852,18 +852,30 @@ void summary_to_keylist(bAnimContext *ac, DLRBT_Tree *keys, DLRBT_Tree *blocks)
                int filter;
                
                /* get F-Curves to take keyframes from */
-               filter = ANIMFILTER_DATA_VISIBLE; // curves only
+               filter = ANIMFILTER_DATA_VISIBLE;
                ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
                
                /* loop through each F-Curve, grabbing the keyframes */
                for (ale = anim_data.first; ale; ale = ale->next) {
-                       fcurve_to_keylist(ale->adt, ale->data, keys, blocks);
 
-                       if (ale->datatype == ALE_MASKLAY) {
-                               mask_to_keylist(ac->ads, ale->data, keys);
-                       }
-                       else if (ale->datatype == ALE_GPFRAME) {
-                               gpl_to_keylist(ac->ads, ale->data, keys);
+                       /* Why not use all #eAnim_KeyType here?
+                        * All of the other key types are actually "summaries" themselves, and will just end up duplicating stuff
+                        * that comes up through standard filtering of just F-Curves.
+                        * Given the way that these work, there isn't really any benefit at all from including them. - Aligorith */
+
+                       switch (ale->datatype) {
+                               case ALE_FCURVE:
+                                       fcurve_to_keylist(ale->adt, ale->data, keys, blocks);
+                                       break;
+                               case ALE_MASKLAY:
+                                       mask_to_keylist(ac->ads, ale->data, keys);
+                                       break;
+                               case ALE_GPFRAME:
+                                       gpl_to_keylist(ac->ads, ale->data, keys);
+                                       break;
+                               default:
+                                       // printf("%s: datatype %d unhandled\n", __func__, ale->datatype);
+                                       break;
                        }
                }
 
index c6b19e51de99cb0e1e92e6a3b5b8cc6efa7e7a37..00bbfcf3188b6d01ec786bd98671d1855dcb8dec 100644 (file)
@@ -365,6 +365,9 @@ static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,
                               const short is_active,
                               int width, int height)
 {
+       const unsigned int resol = maxi(BKE_mask_spline_feather_resolution(spline, width, height),
+                                       BKE_mask_spline_resolution(spline, width, height));
+
        unsigned char rgb_tmp[4];
 
        const short is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
@@ -377,7 +380,7 @@ static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,
        int tot_feather_point;
        float (*feather_points)[2];
 
-       diff_points = BKE_mask_spline_differentiate_with_resolution(spline, width, height, &tot_diff_point);
+       diff_points = BKE_mask_spline_differentiate_with_resolution_ex(spline, &tot_diff_point, resol);
 
        if (!diff_points)
                return;
@@ -388,7 +391,7 @@ static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,
                glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        }
 
-       feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution(spline, width, height, &tot_feather_point, (is_fill != FALSE));
+       feather_points = BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, &tot_feather_point, resol, (is_fill != FALSE));
 
        /* draw feather */
        mask_spline_feather_color_get(masklay, spline, is_spline_sel, rgb_tmp);
index e74bda87a438ebb8987319124b495c4ed9a21832..5169d823bd83354562488eb0ab127d79a37209a1 100644 (file)
@@ -1641,6 +1641,7 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom,
 
                CLAMP(vod->rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX);
        }
+
        if (viewzoom == USER_ZOOM_CONT) {
                double time = PIL_check_seconds_timer();
                float time_step = (float)(time - vod->timer_lastdraw);
@@ -1689,8 +1690,10 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y, const short viewzoom,
                }
                
                if (use_cam_zoom) {
+                       /* zfac is ignored in this case, see below */
+#if 0
                        zfac = vod->camzoom0 * (2.0f * ((len2 / len1) - 1.0f) + 1.0f) / vod->rv3d->camzoom;
-                       zfac = 0;
+#endif
                }
                else {
                        zfac = vod->dist0 * (2.0f * ((len2 / len1) - 1.0f) + 1.0f) / vod->rv3d->dist;
index 8eba8ebea41c91044b4c105ada992c32137d03e1..7f77341447df09ba28a7ce9bfc9343004b040630 100644 (file)
@@ -6239,7 +6239,7 @@ static void createTransMaskingData(bContext *C, TransInfo *t)
 
        /* count */
        for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
-               MaskSpline *spline = masklay->splines.first;
+               MaskSpline *spline;
 
                if (masklay->restrictflag & (MASK_RESTRICT_VIEW | MASK_RESTRICT_SELECT)) {
                        continue;
@@ -6282,7 +6282,7 @@ static void createTransMaskingData(bContext *C, TransInfo *t)
 
        /* create data */
        for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
-               MaskSpline *spline = masklay->splines.first;
+               MaskSpline *spline;
 
                if (masklay->restrictflag & (MASK_RESTRICT_VIEW | MASK_RESTRICT_SELECT)) {
                        continue;
index 5d4b9ae40c259f5d6fafb7e126fc99b0a5b8fb67..f9fa0ae65f11f93d89abf976f42e20df3f4e7475 100644 (file)
@@ -1825,6 +1825,9 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene
        if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT)
                ((KX_LightObject*)gameobj)->UpdateScene(to);
 
+       if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_CAMERA)
+               to->AddCamera((KX_Camera*)gameobj);
+
        /* Add the object to the scene's logic manager */
        to->GetLogicManager()->RegisterGameObjectName(gameobj->GetName(), gameobj);
        to->GetLogicManager()->RegisterGameObj(gameobj->GetBlenderObject(), gameobj);