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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Hamalainen <blender@miikah.org>2012-08-27 14:59:15 +0400
committerMiika Hamalainen <blender@miikah.org>2012-08-27 14:59:15 +0400
commitb3f311784d6c356eac2ff46e796d4a39cfc935c8 (patch)
treefe1a81243b21f16339373a8ebfff5e6daa7af3d6
parente777ee95f03e98d9842d47c173363b252e9663e9 (diff)
parent13254cde8c7ca38af2dcec35efdb9f8f9b3bca46 (diff)
Merge with trunk r50245 + fixed issues caused by previous (failed?) merge.
-rw-r--r--release/scripts/startup/bl_ui/properties_mask_common.py1
-rw-r--r--source/blender/blenkernel/BKE_mask.h72
-rw-r--r--source/blender/blenkernel/CMakeLists.txt1
-rw-r--r--source/blender/blenkernel/intern/mask.c686
-rw-r--r--source/blender/blenkernel/intern/mask_evaluate.c864
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c36
-rw-r--r--source/blender/blenkernel/intern/sequencer.c9
-rw-r--r--source/blender/blenkernel/intern/sound.c38
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c129
-rw-r--r--source/blender/blenlib/BLI_math_vector.h3
-rw-r--r--source/blender/blenlib/BLI_pbvh.h4
-rw-r--r--source/blender/blenlib/BLI_string.h7
-rw-r--r--source/blender/blenlib/intern/math_vector.c23
-rw-r--r--source/blender/blenlib/intern/pbvh.c4
-rw-r--r--source/blender/blenlib/intern/string.c19
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/blenloader/intern/versioning_250.c6
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c4
-rw-r--r--source/blender/blenloader/intern/writefile.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_error.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_mods.h4
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api.h2
-rw-r--r--source/blender/collada/AnimationExporter.h4
-rw-r--r--source/blender/collada/AnimationImporter.cpp2
-rw-r--r--source/blender/collada/TransformReader.h2
-rw-r--r--source/blender/collada/collada_internal.h2
-rw-r--r--source/blender/compositor/nodes/COM_DespeckleNode.cpp50
-rw-r--r--source/blender/compositor/nodes/COM_DespeckleNode.h36
-rw-r--r--source/blender/compositor/operations/COM_DespeckleOperation.cpp139
-rw-r--r--source/blender/compositor/operations/COM_DespeckleOperation.h49
-rw-r--r--source/blender/editors/animation/keyframes_draw.c26
-rw-r--r--source/blender/editors/interface/view2d_ops.c12
-rw-r--r--source/blender/editors/io/io_collada.c8
-rw-r--r--source/blender/editors/mask/mask_draw.c7
-rw-r--r--source/blender/editors/object/object_group.c3
-rw-r--r--source/blender/editors/physics/physics_fluid.c2
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_ops.c4
-rw-r--r--source/blender/editors/space_clip/clip_ops.c6
-rw-r--r--source/blender/editors/space_file/space_file.c2
-rw-r--r--source/blender/editors/space_logic/logic_window.c34
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c16
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_scopes.c62
-rw-r--r--source/blender/editors/space_sequencer/sequencer_view.c221
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c5
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c2
-rw-r--r--source/blender/editors/transform/transform_conversions.c4
-rw-r--r--source/blender/imbuf/IMB_imbuf.h4
-rw-r--r--source/blender/imbuf/IMB_thumbs.h8
-rw-r--r--source/blender/imbuf/intern/anim_movie.c4
-rw-r--r--source/blender/imbuf/intern/imbuf_cocoa.m27
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp2
-rw-r--r--source/blender/imbuf/intern/util.c51
-rw-r--r--source/blender/makesdna/DNA_mask_types.h20
-rw-r--r--source/blender/makesrna/intern/rna_mask.c13
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c2
-rw-r--r--source/blender/modifiers/intern/MOD_displace.c2
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_despeckle.c73
-rw-r--r--source/blender/python/bmesh/bmesh_py_api.c6
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c434
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c110
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_meshdata.c62
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_select.c40
-rw-r--r--source/blender/python/bmesh/bmesh_py_utils.c44
-rw-r--r--source/blender/quicktime/apple/qtkit_export.m4
-rw-r--r--source/blender/quicktime/apple/qtkit_import.m8
-rw-r--r--source/blender/render/intern/include/rayobject.h19
-rw-r--r--source/blender/windowmanager/WM_api.h4
-rw-r--r--source/blenderplayer/bad_level_call_stubs/stubs.c4
-rw-r--r--source/creator/creator.c4
-rw-r--r--source/gameengine/Converter/KX_ConvertSensors.cpp24
-rw-r--r--source/gameengine/Expressions/BoolValue.cpp2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp3
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp6
78 files changed, 2236 insertions, 1374 deletions
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py
index 67980c388b5..208b0a63075 100644
--- a/release/scripts/startup/bl_ui/properties_mask_common.py
+++ b/release/scripts/startup/bl_ui/properties_mask_common.py
@@ -121,6 +121,7 @@ class MASK_PT_spline():
spline = mask.layers.active.splines.active
col = layout.column()
+ col.prop(spline, "offset_mode")
col.prop(spline, "weight_interpolation")
row = col.row()
diff --git a/source/blender/blenkernel/BKE_mask.h b/source/blender/blenkernel/BKE_mask.h
index b46aefe4e98..9cf5a7f31a5 100644
--- a/source/blender/blenkernel/BKE_mask.h
+++ b/source/blender/blenkernel/BKE_mask.h
@@ -19,7 +19,8 @@
* All rights reserved.
*
* Contributor(s): Blender Foundation,
- * Sergey Sharybin
+ * Sergey Sharybin,
+ * Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -63,29 +64,12 @@ void BKE_mask_layer_copy_list(struct ListBase *masklayers_new, struct ListBase *
/* splines */
struct MaskSpline *BKE_mask_spline_add(struct MaskLayer *masklay);
-
-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);
-
-int BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline, const unsigned int resol);
-
-float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
-
-float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, int *tot_diff_point,
- const unsigned int resol))[2];
-void BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point);
-float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_diff_point))[2];
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, int *tot_feather_point,
- 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];
-
-float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
-
void BKE_mask_point_direction_switch(struct MaskSplinePoint *point);
void BKE_mask_spline_direction_switch(struct MaskLayer *masklay, struct MaskSpline *spline);
+struct BezTriple *BKE_mask_spline_point_next_bezt(struct MaskSpline *spline, struct MaskSplinePoint *points_array,
+ struct MaskSplinePoint *point);
+
typedef enum {
MASK_PROJ_NEG = -1,
MASK_PROJ_ANY = 0,
@@ -100,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]);
@@ -205,6 +176,39 @@ 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);
+int BKE_mask_spline_differentiate_calc_total(const struct MaskSpline *spline, const unsigned int resol);
+
+float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int *tot_diff_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points(struct MaskSpline *spline, int *tot_feather_point))[2];
+
+float (*BKE_mask_spline_differentiate_with_resolution_ex(struct MaskSpline *spline, int *tot_diff_point,
+ const unsigned int resol))[2];
+void BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point);
+float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline, int width, int height, int *tot_diff_point))[2];
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(struct MaskSpline *spline, int *tot_feather_point,
+ 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;
typedef struct MaskRasterHandle MaskRasterHandle;
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 0a0635126f5..afa3998fb49 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -101,6 +101,7 @@ set(SRC
intern/lamp.c
intern/lattice.c
intern/library.c
+ intern/mask_evaluate.c
intern/mask_rasterize.c
intern/mask.c
intern/material.c
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index a6ceba588d2..f73fb3879b8 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -19,7 +19,8 @@
* All rights reserved.
*
* Contributor(s): Blender Foundation,
- * Sergey Sharybin
+ * Sergey Sharybin,
+ * Campbell Barton
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -41,12 +42,8 @@
#include "DNA_mask_types.h"
#include "DNA_node_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
-#include "DNA_movieclip_types.h"
-#include "DNA_tracking_types.h"
#include "DNA_sequence_types.h"
#include "BKE_curve.h"
@@ -58,7 +55,6 @@
#include "BKE_sequencer.h"
#include "BKE_tracking.h"
#include "BKE_movieclip.h"
-#include "BKE_utildefines.h"
static MaskSplinePoint *mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
{
@@ -90,7 +86,7 @@ static MaskSplinePoint *mask_spline_point_prev(MaskSpline *spline, MaskSplinePoi
}
}
-static BezTriple *mask_spline_point_next_bezt(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
+BezTriple *BKE_mask_spline_point_next_bezt(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
{
if (point == &points_array[spline->tot_point - 1]) {
if (spline->flag & MASK_SPLINE_CYCLIC) {
@@ -269,588 +265,6 @@ MaskSpline *BKE_mask_spline_add(MaskLayer *masklay)
return spline;
}
-unsigned int BKE_mask_spline_resolution(MaskSpline *spline, int width, int height)
-{
- float max_segment = 0.01f;
- 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;
- }
-
- for (i = 0; i < spline->tot_point; i++) {
- MaskSplinePoint *point = &spline->points[i];
- BezTriple *bezt, *bezt_next;
- float a, b, c, len;
- unsigned int cur_resol;
-
- bezt = &point->bezt;
- bezt_next = 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]);
- c = len_v3v3(bezt_next->vec[0], bezt_next->vec[1]);
-
- len = a + b + c;
- cur_resol = len / max_segment;
-
- resol = MAX2(resol, cur_resol);
-
- if (resol >= MASK_RESOL_MAX) {
- break;
- }
- }
-
- return CLAMPIS(resol, 1, MASK_RESOL_MAX);
-}
-
-unsigned int BKE_mask_spline_feather_resolution(MaskSpline *spline, int width, int height)
-{
- const float max_segment = 0.005;
- unsigned int resol = BKE_mask_spline_resolution(spline, width, height);
- float max_jump = 0.0f;
- int i;
-
- /* avoid checking the featrher if we already hit the maximum value */
- if (resol >= MASK_RESOL_MAX) {
- return MASK_RESOL_MAX;
- }
-
- for (i = 0; i < spline->tot_point; i++) {
- MaskSplinePoint *point = &spline->points[i];
- float prev_u, prev_w;
- int j;
-
- prev_u = 0.0f;
- prev_w = point->bezt.weight;
-
- for (j = 0; j < point->tot_uw; j++) {
- const float w_diff = (point->uw[j].w - prev_w);
- const float u_diff = (point->uw[j].u - prev_u);
-
- /* avoid divide by zero and very high values,
- * though these get clamped eventually */
- if (u_diff > FLT_EPSILON) {
- float jump = fabsf(w_diff / u_diff);
-
- max_jump = MAX2(max_jump, jump);
- }
-
- prev_u = point->uw[j].u;
- prev_w = point->uw[j].w;
- }
- }
-
- resol += max_jump / max_segment;
-
- return CLAMPIS(resol, 1, MASK_RESOL_MAX);
-}
-
-int BKE_mask_spline_differentiate_calc_total(const MaskSpline *spline, const unsigned int resol)
-{
- if (spline->flag & MASK_SPLINE_CYCLIC) {
- return spline->tot_point * resol;
- }
- else {
- return ((spline->tot_point - 1) * resol) + 1;
- }
-}
-
-float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
- int *tot_diff_point,
- const unsigned int resol
- ))[2]
-{
- MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
-
- MaskSplinePoint *point, *prev;
- float (*diff_points)[2], (*fp)[2];
- const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
- int a;
-
- if (spline->tot_point <= 1) {
- /* nothing to differentiate */
- *tot_diff_point = 0;
- return NULL;
- }
-
- /* len+1 because of 'forward_diff_bezier' function */
- *tot_diff_point = tot;
- diff_points = fp = MEM_mallocN((tot + 1) * sizeof(*diff_points), "mask spline vets");
-
- a = spline->tot_point - 1;
- if (spline->flag & MASK_SPLINE_CYCLIC)
- a++;
-
- prev = points_array;
- point = prev + 1;
-
- while (a--) {
- BezTriple *prevbezt;
- BezTriple *bezt;
- int j;
-
- if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
- point = points_array;
-
- prevbezt = &prev->bezt;
- bezt = &point->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],
- &(*fp)[j], resol, 2 * sizeof(float));
- }
-
- fp += resol;
-
- if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC) == 0) {
- copy_v2_v2(*fp, bezt->vec[1]);
- }
-
- prev = point;
- point++;
- }
-
- return diff_points;
-}
-
-float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, int width, int height,
- int *tot_diff_point
- ))[2]
-{
- int unsigned resol = BKE_mask_spline_resolution(spline, width, height);
-
- return BKE_mask_spline_differentiate_with_resolution_ex(spline, tot_diff_point, resol);
-}
-
-float (*BKE_mask_spline_differentiate(MaskSpline *spline, int *tot_diff_point))[2]
-{
- return BKE_mask_spline_differentiate_with_resolution(spline, 0, 0, tot_diff_point);
-}
-
-/* ** feather points self-intersection collapse routine ** */
-
-typedef struct FeatherEdgesBucket {
- int tot_segment;
- int (*segments)[2];
- int alloc_segment;
-} FeatherEdgesBucket;
-
-static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int end)
-{
- const int alloc_delta = 256;
-
- if (bucket->tot_segment >= bucket->alloc_segment) {
- if (!bucket->segments) {
- bucket->segments = MEM_callocN(alloc_delta * sizeof(*bucket->segments), "feather bucket segments");
- }
- else {
- bucket->segments = MEM_reallocN(bucket->segments,
- (alloc_delta + bucket->tot_segment) * sizeof(*bucket->segments));
- }
-
- bucket->alloc_segment += alloc_delta;
- }
-
- bucket->segments[bucket->tot_segment][0] = start;
- bucket->segments[bucket->tot_segment][1] = end;
-
- bucket->tot_segment++;
-}
-
-static void feather_bucket_check_intersect(float (*feather_points)[2], int tot_feather_point, FeatherEdgesBucket *bucket,
- int cur_a, int cur_b)
-{
- int i;
-
- float *v1 = (float *) feather_points[cur_a];
- float *v2 = (float *) feather_points[cur_b];
-
- for (i = 0; i < bucket->tot_segment; i++) {
- int check_a = bucket->segments[i][0];
- int check_b = bucket->segments[i][1];
-
- float *v3 = (float *) feather_points[check_a];
- float *v4 = (float *) feather_points[check_b];
-
- if (check_a >= cur_a - 1 || cur_b == check_a)
- continue;
-
- if (isect_seg_seg_v2(v1, v2, v3, v4)) {
- int k;
- float p[2];
- float min_a[2], max_a[2];
- float min_b[2], max_b[2];
-
- isect_seg_seg_v2_point(v1, v2, v3, v4, p);
-
- INIT_MINMAX2(min_a, max_a);
- INIT_MINMAX2(min_b, max_b);
-
- /* collapse loop with smaller AABB */
- for (k = 0; k < tot_feather_point; k++) {
- if (k >= check_b && k <= cur_a) {
- DO_MINMAX2(feather_points[k], min_a, max_a);
- }
- else {
- DO_MINMAX2(feather_points[k], min_b, max_b);
- }
- }
-
- if (max_a[0] - min_a[0] < max_b[0] - min_b[0] ||
- max_a[1] - min_a[1] < max_b[1] - min_b[1])
- {
- for (k = check_b; k <= cur_a; k++) {
- copy_v2_v2(feather_points[k], p);
- }
- }
- else {
- for (k = 0; k <= check_a; k++) {
- copy_v2_v2(feather_points[k], p);
- }
-
- if (cur_b != 0) {
- for (k = cur_b; k < tot_feather_point; k++) {
- copy_v2_v2(feather_points[k], p);
- }
- }
- }
- }
- }
-}
-
-static int feather_bucket_index_from_coord(float co[2], const float min[2], const float bucket_scale[2],
- const int buckets_per_side)
-{
- int x = (int) ((co[0] - min[0]) * bucket_scale[0]);
- int y = (int) ((co[1] - min[1]) * bucket_scale[1]);
-
- if (x == buckets_per_side)
- x--;
-
- if (y == buckets_per_side)
- y--;
-
- return y * buckets_per_side + x;
-}
-
-static void feather_bucket_get_diagonal(FeatherEdgesBucket *buckets, int start_bucket_index, int end_bucket_index,
- int buckets_per_side, FeatherEdgesBucket **diagonal_bucket_a_r,
- FeatherEdgesBucket **diagonal_bucket_b_r)
-{
- int start_bucket_x = start_bucket_index % buckets_per_side;
- int start_bucket_y = start_bucket_index / buckets_per_side;
-
- int end_bucket_x = end_bucket_index % buckets_per_side;
- int end_bucket_y = end_bucket_index / buckets_per_side;
-
- int diagonal_bucket_a_index = start_bucket_y * buckets_per_side + end_bucket_x;
- int diagonal_bucket_b_index = end_bucket_y * buckets_per_side + start_bucket_x;
-
- *diagonal_bucket_a_r = &buckets[diagonal_bucket_a_index];
- *diagonal_bucket_b_r = &buckets[diagonal_bucket_b_index];
-}
-
-void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point)
-{
-#define BUCKET_INDEX(co) \
- feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side)
-
- int buckets_per_side, tot_bucket;
- float bucket_size, bucket_scale[2];
-
- FeatherEdgesBucket *buckets;
-
- int i;
- float min[2], max[2];
- float max_delta_x = -1.0f, max_delta_y = -1.0f, max_delta;
-
- if (tot_feather_point < 4) {
- /* self-intersection works only for quads at least,
- * in other cases polygon can't be self-intersecting anyway
- */
-
- return;
- }
-
- /* find min/max corners of mask to build buckets in that space */
- INIT_MINMAX2(min, max);
-
- for (i = 0; i < tot_feather_point; i++) {
- int next = i + 1;
- float delta;
-
- DO_MINMAX2(feather_points[i], min, max);
-
- if (next == tot_feather_point) {
- if (spline->flag & MASK_SPLINE_CYCLIC)
- next = 0;
- else
- break;
- }
-
- delta = fabsf(feather_points[i][0] - feather_points[next][0]);
- if (delta > max_delta_x)
- max_delta_x = delta;
-
- delta = fabsf(feather_points[i][1] - feather_points[next][1]);
- if (delta > max_delta_y)
- max_delta_y = delta;
- }
-
- /* prevent divisionsby zero by ensuring bounding box is not collapsed */
- if (max[0] - min[0] < FLT_EPSILON) {
- max[0] += 0.01f;
- min[0] -= 0.01f;
- }
-
- if (max[1] - min[1] < FLT_EPSILON) {
- max[1] += 0.01f;
- min[1] -= 0.01f;
- }
-
- /* use dynamically calculated buckets per side, so we likely wouldn't
- * run into a situation when segment doesn't fit two buckets which is
- * pain collecting candidates for intersection
- */
-
- max_delta_x /= max[0] - min[0];
- max_delta_y /= max[1] - min[1];
-
- max_delta = MAX2(max_delta_x, max_delta_y);
-
- buckets_per_side = MIN2(512, 0.9f / max_delta);
-
- if (buckets_per_side == 0) {
- /* happens when some segment fills the whole bounding box across some of dimension */
-
- buckets_per_side = 1;
- }
-
- tot_bucket = buckets_per_side * buckets_per_side;
- bucket_size = 1.0f / buckets_per_side;
-
- /* pre-compute multipliers, to save mathematical operations in loops */
- bucket_scale[0] = 1.0f / ((max[0] - min[0]) * bucket_size);
- bucket_scale[1] = 1.0f / ((max[1] - min[1]) * bucket_size);
-
- /* fill in buckets' edges */
- buckets = MEM_callocN(sizeof(FeatherEdgesBucket) * tot_bucket, "feather buckets");
-
- for (i = 0; i < tot_feather_point; i++) {
- int start = i, end = i + 1;
- int start_bucket_index, end_bucket_index;
-
- if (end == tot_feather_point) {
- if (spline->flag & MASK_SPLINE_CYCLIC)
- end = 0;
- else
- break;
- }
-
- start_bucket_index = BUCKET_INDEX(feather_points[start]);
- end_bucket_index = BUCKET_INDEX(feather_points[end]);
-
- feather_bucket_add_edge(&buckets[start_bucket_index], start, end);
-
- if (start_bucket_index != end_bucket_index) {
- FeatherEdgesBucket *end_bucket = &buckets[end_bucket_index];
- FeatherEdgesBucket *diagonal_bucket_a, *diagonal_bucket_b;
-
- feather_bucket_get_diagonal(buckets, start_bucket_index, end_bucket_index, buckets_per_side,
- &diagonal_bucket_a, &diagonal_bucket_b);
-
- feather_bucket_add_edge(end_bucket, start, end);
- feather_bucket_add_edge(diagonal_bucket_a, start, end);
- feather_bucket_add_edge(diagonal_bucket_a, start, end);
- }
- }
-
- /* check all edges for intersection with edges from their buckets */
- for (i = 0; i < tot_feather_point; i++) {
- int cur_a = i, cur_b = i + 1;
- int start_bucket_index, end_bucket_index;
-
- FeatherEdgesBucket *start_bucket;
-
- if (cur_b == tot_feather_point)
- cur_b = 0;
-
- start_bucket_index = BUCKET_INDEX(feather_points[cur_a]);
- end_bucket_index = BUCKET_INDEX(feather_points[cur_b]);
-
- start_bucket = &buckets[start_bucket_index];
-
- feather_bucket_check_intersect(feather_points, tot_feather_point, start_bucket, cur_a, cur_b);
-
- if (start_bucket_index != end_bucket_index) {
- FeatherEdgesBucket *end_bucket = &buckets[end_bucket_index];
- FeatherEdgesBucket *diagonal_bucket_a, *diagonal_bucket_b;
-
- feather_bucket_get_diagonal(buckets, start_bucket_index, end_bucket_index, buckets_per_side,
- &diagonal_bucket_a, &diagonal_bucket_b);
-
- feather_bucket_check_intersect(feather_points, tot_feather_point, end_bucket, cur_a, cur_b);
- feather_bucket_check_intersect(feather_points, tot_feather_point, diagonal_bucket_a, cur_a, cur_b);
- feather_bucket_check_intersect(feather_points, tot_feather_point, diagonal_bucket_b, cur_a, cur_b);
- }
- }
-
- /* free buckets */
- for (i = 0; i < tot_bucket; i++) {
- if (buckets[i].segments)
- MEM_freeN(buckets[i].segments);
- }
-
- MEM_freeN(buckets);
-
-#undef BUCKET_INDEX
-}
-
-/**
- * values align with #BKE_mask_spline_differentiate_with_resolution_ex
- * when \a resol arguments match.
- */
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline,
- int *tot_feather_point,
- const unsigned int resol,
- const int do_feather_isect
- ))[2]
-{
- MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
- MaskSplinePoint *point, *prev;
- float (*feather)[2], (*fp)[2];
-
- const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
- int a;
-
- /* tot+1 because of 'forward_diff_bezier' function */
- feather = fp = MEM_mallocN((tot + 1) * sizeof(*feather), "mask spline feather diff points");
-
- a = spline->tot_point - 1;
- if (spline->flag & MASK_SPLINE_CYCLIC)
- a++;
-
- prev = points_array;
- point = prev + 1;
-
- while (a--) {
- /* BezTriple *prevbezt; */ /* UNUSED */
- /* BezTriple *bezt; */ /* UNUSED */
- int j;
-
- if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
- point = points_array;
-
-
- /* prevbezt = &prev->bezt; */
- /* bezt = &point->bezt; */
-
- for (j = 0; j < resol; j++, fp++) {
- float u = (float) j / resol, weight;
- float co[2], n[2];
-
- /* 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);
-
- madd_v2_v2v2fl(*fp, co, n, weight);
- }
-
- if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC) == 0) {
- 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);
-
- madd_v2_v2v2fl(*fp, co, n, weight);
- }
-
- prev = point;
- point++;
- }
-
- *tot_feather_point = tot;
-
- if ((spline->flag & MASK_SPLINE_NOINTERSECT) && do_feather_isect) {
- BKE_mask_spline_feather_collapse_inner_loops(spline, feather, tot);
- }
-
- return feather;
-}
-
-float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, int width, int height,
- int *tot_feather_point, const int do_feather_isect))[2]
-{
- unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
-
- return BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, tot_feather_point, resol, do_feather_isect);
-}
-
-float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, int *tot_feather_point))[2]
-{
- return BKE_mask_spline_feather_differentiated_points_with_resolution(spline, 0, 0, tot_feather_point, TRUE);
-}
-
-float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_point))[2]
-{
- MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
-
- int i, tot = 0;
- float (*feather)[2], (*fp)[2];
-
- /* count */
- for (i = 0; i < spline->tot_point; i++) {
- MaskSplinePoint *point = &points_array[i];
-
- tot += point->tot_uw + 1;
- }
-
- /* create data */
- feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather points");
-
- for (i = 0; i < spline->tot_point; i++) {
- MaskSplinePoint *point = &points_array[i];
- BezTriple *bezt = &point->bezt;
- float weight, n[2];
- int j;
-
- BKE_mask_point_normal(spline, point, 0.0f, n);
- weight = BKE_mask_point_weight(spline, point, 0.0f);
-
- madd_v2_v2v2fl(*fp, bezt->vec[1], n, weight);
- fp++;
-
- for (j = 0; j < point->tot_uw; j++) {
- float u = point->uw[j].u;
- float co[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);
-
- madd_v2_v2v2fl(*fp, co, n, weight);
- fp++;
- }
- }
-
- *tot_feather_point = tot;
-
- return feather;
-}
-
void BKE_mask_point_direction_switch(MaskSplinePoint *point)
{
const int tot_uw = point->tot_uw;
@@ -1069,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 = 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);
@@ -1143,7 +490,7 @@ void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float
BezTriple *bezt = &point->bezt, *bezt_next;
float q0[2], q1[2], q2[2], r0[2], r1[2];
- bezt_next = mask_spline_point_next_bezt(spline, points_array, point);
+ bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
if (!bezt_next) {
copy_v2_v2(co, bezt->vec[1]);
@@ -1167,7 +514,7 @@ void BKE_mask_point_normal(MaskSpline *spline, MaskSplinePoint *point, float u,
BezTriple *bezt = &point->bezt, *bezt_next;
float q0[2], q1[2], q2[2], r0[2], r1[2], vec[2];
- bezt_next = mask_spline_point_next_bezt(spline, points_array, point);
+ bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
if (!bezt_next) {
BKE_mask_point_handle(point, vec);
@@ -1202,7 +549,7 @@ float BKE_mask_point_weight_scalar(MaskSpline *spline, MaskSplinePoint *point, c
MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
BezTriple *bezt = &point->bezt, *bezt_next;
- bezt_next = mask_spline_point_next_bezt(spline, points_array, point);
+ bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
if (!bezt_next) {
return bezt->weight;
@@ -1223,7 +570,7 @@ float BKE_mask_point_weight(MaskSpline *spline, MaskSplinePoint *point, const fl
MaskSplinePoint *points_array = BKE_mask_spline_point_array_from_point(spline, point);
BezTriple *bezt = &point->bezt, *bezt_next;
- bezt_next = mask_spline_point_next_bezt(spline, points_array, point);
+ bezt_next = BKE_mask_spline_point_next_bezt(spline, points_array, point);
if (!bezt_next) {
return bezt->weight;
@@ -1847,17 +1194,6 @@ void BKE_mask_calc_handle_point(MaskSpline *spline, MaskSplinePoint *point)
mask_calc_point_handle(point, point_prev, point_next);
}
-static void enforce_dist_v2_v2fl(float v1[2], const float v2[2], const float dist)
-{
- if (!equals_v2v2(v2, v1)) {
- float nor[2];
-
- sub_v2_v2v2(nor, v1, v2);
- normalize_v2(nor);
- madd_v2_v2v2fl(v1, v2, nor, dist);
- }
-}
-
void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, MaskSplinePoint *point, const float u)
{
/* TODO! - make this interpolate between siblings - not always midpoint! */
@@ -1899,8 +1235,8 @@ void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, MaskSplinePoint *p
length_average /= (float)length_tot;
weight_average /= (float)length_tot;
- enforce_dist_v2_v2fl(point->bezt.vec[0], point->bezt.vec[1], length_average);
- enforce_dist_v2_v2fl(point->bezt.vec[2], point->bezt.vec[1], length_average);
+ dist_ensure_v2_v2fl(point->bezt.vec[0], point->bezt.vec[1], length_average);
+ dist_ensure_v2_v2fl(point->bezt.vec[2], point->bezt.vec[1], length_average);
point->bezt.weight = weight_average;
}
}
@@ -1932,8 +1268,8 @@ void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point,
/* preserve length by applying it back */
if (do_recalc_length == FALSE) {
- enforce_dist_v2_v2fl(point->bezt.vec[0], point->bezt.vec[1], length_average);
- enforce_dist_v2_v2fl(point->bezt.vec[2], point->bezt.vec[1], length_average);
+ dist_ensure_v2_v2fl(point->bezt.vec[0], point->bezt.vec[1], length_average);
+ dist_ensure_v2_v2fl(point->bezt.vec[2], point->bezt.vec[1], length_average);
}
}
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c
new file mode 100644
index 00000000000..065dc38c81e
--- /dev/null
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -0,0 +1,864 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ * Sergey Sharybin,
+ * Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/blenkernel/intern/mask_evaluate.c
+ * \ingroup bke
+ *
+ * Functions for evaluating the mask beziers into points for the outline and feather.
+ */
+
+#include <stddef.h>
+#include <string.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+#include "BLI_path_util.h"
+#include "BLI_string.h"
+#include "BLI_listbase.h"
+#include "BLI_math.h"
+
+#include "DNA_mask_types.h"
+#include "DNA_node_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
+#include "DNA_screen_types.h"
+#include "DNA_space_types.h"
+#include "DNA_movieclip_types.h"
+#include "DNA_tracking_types.h"
+#include "DNA_sequence_types.h"
+
+#include "BKE_curve.h"
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_mask.h"
+#include "BKE_node.h"
+#include "BKE_sequencer.h"
+#include "BKE_tracking.h"
+#include "BKE_movieclip.h"
+#include "BKE_utildefines.h"
+
+
+unsigned int BKE_mask_spline_resolution(MaskSpline *spline, int width, int height)
+{
+ float max_segment = 0.01f;
+ unsigned int i, resol = 1;
+
+ if (width != 0 && height != 0) {
+ max_segment = 1.0f / (float)maxi(width, height);
+ }
+
+ for (i = 0; i < spline->tot_point; i++) {
+ MaskSplinePoint *point = &spline->points[i];
+ BezTriple *bezt_curr, *bezt_next;
+ float a, b, c, len;
+ unsigned int cur_resol;
+
+ 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_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;
+ cur_resol = len / max_segment;
+
+ resol = MAX2(resol, cur_resol);
+
+ if (resol >= MASK_RESOL_MAX) {
+ break;
+ }
+ }
+
+ return CLAMPIS(resol, 1, MASK_RESOL_MAX);
+}
+
+unsigned int BKE_mask_spline_feather_resolution(MaskSpline *spline, int width, int height)
+{
+ const float max_segment = 0.005;
+ unsigned int resol = BKE_mask_spline_resolution(spline, width, height);
+ float max_jump = 0.0f;
+ int i;
+
+ /* avoid checking the featrher if we already hit the maximum value */
+ if (resol >= MASK_RESOL_MAX) {
+ return MASK_RESOL_MAX;
+ }
+
+ for (i = 0; i < spline->tot_point; i++) {
+ MaskSplinePoint *point = &spline->points[i];
+ float prev_u, prev_w;
+ int j;
+
+ prev_u = 0.0f;
+ prev_w = point->bezt.weight;
+
+ for (j = 0; j < point->tot_uw; j++) {
+ const float w_diff = (point->uw[j].w - prev_w);
+ const float u_diff = (point->uw[j].u - prev_u);
+
+ /* avoid divide by zero and very high values,
+ * though these get clamped eventually */
+ if (u_diff > FLT_EPSILON) {
+ float jump = fabsf(w_diff / u_diff);
+
+ max_jump = MAX2(max_jump, jump);
+ }
+
+ prev_u = point->uw[j].u;
+ prev_w = point->uw[j].w;
+ }
+ }
+
+ resol += max_jump / max_segment;
+
+ return CLAMPIS(resol, 1, MASK_RESOL_MAX);
+}
+
+int BKE_mask_spline_differentiate_calc_total(const MaskSpline *spline, const unsigned int resol)
+{
+ if (spline->flag & MASK_SPLINE_CYCLIC) {
+ return spline->tot_point * resol;
+ }
+ else {
+ return ((spline->tot_point - 1) * resol) + 1;
+ }
+}
+
+float (*BKE_mask_spline_differentiate_with_resolution_ex(MaskSpline *spline,
+ int *tot_diff_point,
+ const unsigned int resol
+ ))[2]
+{
+ MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
+
+ MaskSplinePoint *point_curr, *point_prev;
+ float (*diff_points)[2], (*fp)[2];
+ const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
+ int a;
+
+ if (spline->tot_point <= 1) {
+ /* nothing to differentiate */
+ *tot_diff_point = 0;
+ return NULL;
+ }
+
+ /* len+1 because of 'forward_diff_bezier' function */
+ *tot_diff_point = tot;
+ diff_points = fp = MEM_mallocN((tot + 1) * sizeof(*diff_points), "mask spline vets");
+
+ a = spline->tot_point - 1;
+ if (spline->flag & MASK_SPLINE_CYCLIC)
+ a++;
+
+ point_prev = points_array;
+ point_curr = point_prev + 1;
+
+ while (a--) {
+ BezTriple *bezt_prev;
+ BezTriple *bezt_curr;
+ int j;
+
+ if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
+ point_curr = points_array;
+
+ bezt_prev = &point_prev->bezt;
+ bezt_curr = &point_curr->bezt;
+
+ for (j = 0; j < 2; 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_curr->vec[1]);
+ }
+
+ point_prev = point_curr;
+ point_curr++;
+ }
+
+ return diff_points;
+}
+
+float (*BKE_mask_spline_differentiate_with_resolution(MaskSpline *spline, int width, int height,
+ int *tot_diff_point
+ ))[2]
+{
+ int unsigned resol = BKE_mask_spline_resolution(spline, width, height);
+
+ return BKE_mask_spline_differentiate_with_resolution_ex(spline, tot_diff_point, resol);
+}
+
+float (*BKE_mask_spline_differentiate(MaskSpline *spline, int *tot_diff_point))[2]
+{
+ return BKE_mask_spline_differentiate_with_resolution(spline, 0, 0, tot_diff_point);
+}
+
+/* ** feather points self-intersection collapse routine ** */
+
+typedef struct FeatherEdgesBucket {
+ int tot_segment;
+ int (*segments)[2];
+ int alloc_segment;
+} FeatherEdgesBucket;
+
+static void feather_bucket_add_edge(FeatherEdgesBucket *bucket, int start, int end)
+{
+ const int alloc_delta = 256;
+
+ if (bucket->tot_segment >= bucket->alloc_segment) {
+ if (!bucket->segments) {
+ bucket->segments = MEM_callocN(alloc_delta * sizeof(*bucket->segments), "feather bucket segments");
+ }
+ else {
+ bucket->segments = MEM_reallocN(bucket->segments,
+ (alloc_delta + bucket->tot_segment) * sizeof(*bucket->segments));
+ }
+
+ bucket->alloc_segment += alloc_delta;
+ }
+
+ bucket->segments[bucket->tot_segment][0] = start;
+ bucket->segments[bucket->tot_segment][1] = end;
+
+ bucket->tot_segment++;
+}
+
+static void feather_bucket_check_intersect(float (*feather_points)[2], int tot_feather_point, FeatherEdgesBucket *bucket,
+ int cur_a, int cur_b)
+{
+ int i;
+
+ float *v1 = (float *) feather_points[cur_a];
+ float *v2 = (float *) feather_points[cur_b];
+
+ for (i = 0; i < bucket->tot_segment; i++) {
+ int check_a = bucket->segments[i][0];
+ int check_b = bucket->segments[i][1];
+
+ float *v3 = (float *) feather_points[check_a];
+ float *v4 = (float *) feather_points[check_b];
+
+ if (check_a >= cur_a - 1 || cur_b == check_a)
+ continue;
+
+ if (isect_seg_seg_v2(v1, v2, v3, v4)) {
+ int k;
+ float p[2];
+ float min_a[2], max_a[2];
+ float min_b[2], max_b[2];
+
+ isect_seg_seg_v2_point(v1, v2, v3, v4, p);
+
+ INIT_MINMAX2(min_a, max_a);
+ INIT_MINMAX2(min_b, max_b);
+
+ /* collapse loop with smaller AABB */
+ for (k = 0; k < tot_feather_point; k++) {
+ if (k >= check_b && k <= cur_a) {
+ DO_MINMAX2(feather_points[k], min_a, max_a);
+ }
+ else {
+ DO_MINMAX2(feather_points[k], min_b, max_b);
+ }
+ }
+
+ if (max_a[0] - min_a[0] < max_b[0] - min_b[0] ||
+ max_a[1] - min_a[1] < max_b[1] - min_b[1])
+ {
+ for (k = check_b; k <= cur_a; k++) {
+ copy_v2_v2(feather_points[k], p);
+ }
+ }
+ else {
+ for (k = 0; k <= check_a; k++) {
+ copy_v2_v2(feather_points[k], p);
+ }
+
+ if (cur_b != 0) {
+ for (k = cur_b; k < tot_feather_point; k++) {
+ copy_v2_v2(feather_points[k], p);
+ }
+ }
+ }
+ }
+ }
+}
+
+static int feather_bucket_index_from_coord(float co[2], const float min[2], const float bucket_scale[2],
+ const int buckets_per_side)
+{
+ int x = (int) ((co[0] - min[0]) * bucket_scale[0]);
+ int y = (int) ((co[1] - min[1]) * bucket_scale[1]);
+
+ if (x == buckets_per_side)
+ x--;
+
+ if (y == buckets_per_side)
+ y--;
+
+ return y * buckets_per_side + x;
+}
+
+static void feather_bucket_get_diagonal(FeatherEdgesBucket *buckets, int start_bucket_index, int end_bucket_index,
+ int buckets_per_side, FeatherEdgesBucket **diagonal_bucket_a_r,
+ FeatherEdgesBucket **diagonal_bucket_b_r)
+{
+ int start_bucket_x = start_bucket_index % buckets_per_side;
+ int start_bucket_y = start_bucket_index / buckets_per_side;
+
+ int end_bucket_x = end_bucket_index % buckets_per_side;
+ int end_bucket_y = end_bucket_index / buckets_per_side;
+
+ int diagonal_bucket_a_index = start_bucket_y * buckets_per_side + end_bucket_x;
+ int diagonal_bucket_b_index = end_bucket_y * buckets_per_side + start_bucket_x;
+
+ *diagonal_bucket_a_r = &buckets[diagonal_bucket_a_index];
+ *diagonal_bucket_b_r = &buckets[diagonal_bucket_b_index];
+}
+
+void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*feather_points)[2], const int tot_feather_point)
+{
+#define BUCKET_INDEX(co) \
+ feather_bucket_index_from_coord(co, min, bucket_scale, buckets_per_side)
+
+ int buckets_per_side, tot_bucket;
+ float bucket_size, bucket_scale[2];
+
+ FeatherEdgesBucket *buckets;
+
+ int i;
+ float min[2], max[2];
+ float max_delta_x = -1.0f, max_delta_y = -1.0f, max_delta;
+
+ if (tot_feather_point < 4) {
+ /* self-intersection works only for quads at least,
+ * in other cases polygon can't be self-intersecting anyway
+ */
+
+ return;
+ }
+
+ /* find min/max corners of mask to build buckets in that space */
+ INIT_MINMAX2(min, max);
+
+ for (i = 0; i < tot_feather_point; i++) {
+ int next = i + 1;
+ float delta;
+
+ DO_MINMAX2(feather_points[i], min, max);
+
+ if (next == tot_feather_point) {
+ if (spline->flag & MASK_SPLINE_CYCLIC)
+ next = 0;
+ else
+ break;
+ }
+
+ delta = fabsf(feather_points[i][0] - feather_points[next][0]);
+ if (delta > max_delta_x)
+ max_delta_x = delta;
+
+ delta = fabsf(feather_points[i][1] - feather_points[next][1]);
+ if (delta > max_delta_y)
+ max_delta_y = delta;
+ }
+
+ /* prevent divisionsby zero by ensuring bounding box is not collapsed */
+ if (max[0] - min[0] < FLT_EPSILON) {
+ max[0] += 0.01f;
+ min[0] -= 0.01f;
+ }
+
+ if (max[1] - min[1] < FLT_EPSILON) {
+ max[1] += 0.01f;
+ min[1] -= 0.01f;
+ }
+
+ /* use dynamically calculated buckets per side, so we likely wouldn't
+ * run into a situation when segment doesn't fit two buckets which is
+ * pain collecting candidates for intersection
+ */
+
+ max_delta_x /= max[0] - min[0];
+ max_delta_y /= max[1] - min[1];
+
+ max_delta = MAX2(max_delta_x, max_delta_y);
+
+ buckets_per_side = MIN2(512, 0.9f / max_delta);
+
+ if (buckets_per_side == 0) {
+ /* happens when some segment fills the whole bounding box across some of dimension */
+
+ buckets_per_side = 1;
+ }
+
+ tot_bucket = buckets_per_side * buckets_per_side;
+ bucket_size = 1.0f / buckets_per_side;
+
+ /* pre-compute multipliers, to save mathematical operations in loops */
+ bucket_scale[0] = 1.0f / ((max[0] - min[0]) * bucket_size);
+ bucket_scale[1] = 1.0f / ((max[1] - min[1]) * bucket_size);
+
+ /* fill in buckets' edges */
+ buckets = MEM_callocN(sizeof(FeatherEdgesBucket) * tot_bucket, "feather buckets");
+
+ for (i = 0; i < tot_feather_point; i++) {
+ int start = i, end = i + 1;
+ int start_bucket_index, end_bucket_index;
+
+ if (end == tot_feather_point) {
+ if (spline->flag & MASK_SPLINE_CYCLIC)
+ end = 0;
+ else
+ break;
+ }
+
+ start_bucket_index = BUCKET_INDEX(feather_points[start]);
+ end_bucket_index = BUCKET_INDEX(feather_points[end]);
+
+ feather_bucket_add_edge(&buckets[start_bucket_index], start, end);
+
+ if (start_bucket_index != end_bucket_index) {
+ FeatherEdgesBucket *end_bucket = &buckets[end_bucket_index];
+ FeatherEdgesBucket *diagonal_bucket_a, *diagonal_bucket_b;
+
+ feather_bucket_get_diagonal(buckets, start_bucket_index, end_bucket_index, buckets_per_side,
+ &diagonal_bucket_a, &diagonal_bucket_b);
+
+ feather_bucket_add_edge(end_bucket, start, end);
+ feather_bucket_add_edge(diagonal_bucket_a, start, end);
+ feather_bucket_add_edge(diagonal_bucket_a, start, end);
+ }
+ }
+
+ /* check all edges for intersection with edges from their buckets */
+ for (i = 0; i < tot_feather_point; i++) {
+ int cur_a = i, cur_b = i + 1;
+ int start_bucket_index, end_bucket_index;
+
+ FeatherEdgesBucket *start_bucket;
+
+ if (cur_b == tot_feather_point)
+ cur_b = 0;
+
+ start_bucket_index = BUCKET_INDEX(feather_points[cur_a]);
+ end_bucket_index = BUCKET_INDEX(feather_points[cur_b]);
+
+ start_bucket = &buckets[start_bucket_index];
+
+ feather_bucket_check_intersect(feather_points, tot_feather_point, start_bucket, cur_a, cur_b);
+
+ if (start_bucket_index != end_bucket_index) {
+ FeatherEdgesBucket *end_bucket = &buckets[end_bucket_index];
+ FeatherEdgesBucket *diagonal_bucket_a, *diagonal_bucket_b;
+
+ feather_bucket_get_diagonal(buckets, start_bucket_index, end_bucket_index, buckets_per_side,
+ &diagonal_bucket_a, &diagonal_bucket_b);
+
+ feather_bucket_check_intersect(feather_points, tot_feather_point, end_bucket, cur_a, cur_b);
+ feather_bucket_check_intersect(feather_points, tot_feather_point, diagonal_bucket_a, cur_a, cur_b);
+ feather_bucket_check_intersect(feather_points, tot_feather_point, diagonal_bucket_b, cur_a, cur_b);
+ }
+ }
+
+ /* free buckets */
+ for (i = 0; i < tot_bucket; i++) {
+ if (buckets[i].segments)
+ MEM_freeN(buckets[i].segments);
+ }
+
+ MEM_freeN(buckets);
+
+#undef BUCKET_INDEX
+}
+
+/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
+static float (*mask_spline_feather_differentiated_points_with_resolution_ex__even(MaskSpline *spline,
+ int *tot_feather_point,
+ const unsigned int resol,
+ const int do_feather_isect
+ ))[2]
+{
+ MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
+ MaskSplinePoint *point_curr, *point_prev;
+ float (*feather)[2], (*fp)[2];
+
+ const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
+ int a;
+
+ /* tot+1 because of 'forward_diff_bezier' function */
+ feather = fp = MEM_mallocN((tot + 1) * sizeof(*feather), "mask spline feather diff points");
+
+ a = spline->tot_point - 1;
+ if (spline->flag & MASK_SPLINE_CYCLIC)
+ a++;
+
+ point_prev = points_array;
+ point_curr = point_prev + 1;
+
+ while (a--) {
+ /* BezTriple *bezt_prev; */ /* UNUSED */
+ /* BezTriple *bezt_curr; */ /* UNUSED */
+ int j;
+
+ if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
+ point_curr = points_array;
+
+
+ /* bezt_prev = &point_prev->bezt; */
+ /* bezt_curr = &point_curr->bezt; */
+
+ for (j = 0; j < resol; j++, fp++) {
+ float u = (float) j / resol, weight;
+ float co[2], n[2];
+
+ /* TODO - these calls all calculate similar things
+ * could be unified for some speed */
+ 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);
+ }
+
+ if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC) == 0) {
+ float u = 1.0f, weight;
+ float co[2], n[2];
+
+ 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);
+ }
+
+ point_prev = point_curr;
+ point_curr++;
+ }
+
+ *tot_feather_point = tot;
+
+ if ((spline->flag & MASK_SPLINE_NOINTERSECT) && do_feather_isect) {
+ BKE_mask_spline_feather_collapse_inner_loops(spline, feather, tot);
+ }
+
+ return feather;
+}
+
+/** only called from #BKE_mask_spline_feather_differentiated_points_with_resolution_ex() ! */
+static float (*mask_spline_feather_differentiated_points_with_resolution_ex__double(MaskSpline *spline,
+ int *tot_feather_point,
+ const unsigned int resol,
+ const int do_feather_isect
+ ))[2]
+{
+ MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
+
+ MaskSplinePoint *point_curr, *point_prev;
+ float (*feather)[2], (*fp)[2];
+ const int tot = BKE_mask_spline_differentiate_calc_total(spline, resol);
+ int a;
+
+ if (spline->tot_point <= 1) {
+ /* nothing to differentiate */
+ *tot_feather_point = 0;
+ return NULL;
+ }
+
+ /* len+1 because of 'forward_diff_bezier' function */
+ *tot_feather_point = tot;
+ feather = fp = MEM_mallocN((tot + 1) * sizeof(*feather), "mask spline vets");
+
+ a = spline->tot_point - 1;
+ if (spline->flag & MASK_SPLINE_CYCLIC)
+ a++;
+
+ point_prev = points_array;
+ point_curr = point_prev + 1;
+
+ while (a--) {
+ BezTriple local_prevbezt;
+ BezTriple local_bezt;
+ float point_prev_n[2], point_curr_n[2], tvec[2];
+ float weight_prev, weight_curr;
+ float len_base, len_feather, len_scalar;
+
+ BezTriple *bezt_prev;
+ BezTriple *bezt_curr;
+ int j;
+
+ if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC))
+ point_curr = points_array;
+
+ bezt_prev = &point_prev->bezt;
+ bezt_curr = &point_curr->bezt;
+
+ /* modified copy for feather */
+ local_prevbezt = *bezt_prev;
+ local_bezt = *bezt_curr;
+
+ bezt_prev = &local_prevbezt;
+ bezt_curr = &local_bezt;
+
+ /* calc the normals */
+ sub_v2_v2v2(tvec, bezt_prev->vec[1], bezt_prev->vec[0]);
+ normalize_v2(tvec);
+ point_prev_n[0] = -tvec[1];
+ point_prev_n[1] = tvec[0];
+
+ sub_v2_v2v2(tvec, bezt_curr->vec[1], bezt_curr->vec[0]);
+ normalize_v2(tvec);
+ point_curr_n[0] = -tvec[1];
+ point_curr_n[1] = tvec[0];
+
+ weight_prev = bezt_prev->weight;
+ weight_curr = bezt_curr->weight;
+
+ mul_v2_fl(point_prev_n, weight_prev);
+ mul_v2_fl(point_curr_n, weight_curr);
+
+ /* before we transform verts */
+ len_base = len_v2v2(bezt_prev->vec[1], bezt_curr->vec[1]);
+
+ // add_v2_v2(bezt_prev->vec[0], point_prev_n); // not needed
+ add_v2_v2(bezt_prev->vec[1], point_prev_n);
+ add_v2_v2(bezt_prev->vec[2], point_prev_n);
+
+ add_v2_v2(bezt_curr->vec[0], point_curr_n);
+ add_v2_v2(bezt_curr->vec[1], point_curr_n);
+ // add_v2_v2(bezt_curr->vec[2], point_curr_n); // not needed
+
+ len_feather = len_v2v2(bezt_prev->vec[1], bezt_curr->vec[1]);
+
+ /* scale by chane in length */
+ len_scalar = len_feather / len_base;
+ dist_ensure_v2_v2fl(bezt_prev->vec[2], bezt_prev->vec[1], len_scalar * len_v2v2(bezt_prev->vec[2], bezt_prev->vec[1]));
+ dist_ensure_v2_v2fl(bezt_curr->vec[0], bezt_curr->vec[1], len_scalar * len_v2v2(bezt_curr->vec[0], bezt_curr->vec[1]));
+
+
+ for (j = 0; j < 2; 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));
+ }
+
+
+ /* scale by the uw's */
+ if (point_prev->tot_uw) {
+ for (j = 0; j < resol; j++, fp++) {
+ float u = (float) j / resol;
+ float weight_uw, weight_scalar;
+ float co[2];
+
+ /* TODO - these calls all calculate similar things
+ * could be unified for some speed */
+ BKE_mask_point_segment_co(spline, point_prev, u, co);
+
+ weight_uw = BKE_mask_point_weight(spline, point_prev, u);
+ weight_scalar = BKE_mask_point_weight_scalar(spline, point_prev, u);
+
+ dist_ensure_v2_v2fl(*fp, co, len_v2v2(*fp, co) * (weight_uw / weight_scalar));
+ }
+ }
+ else {
+ fp += resol;
+ }
+
+ if (a == 0 && (spline->flag & MASK_SPLINE_CYCLIC) == 0) {
+ copy_v2_v2(*fp, bezt_curr->vec[1]);
+ }
+
+ point_prev = point_curr;
+ point_curr++;
+ }
+
+ if ((spline->flag & MASK_SPLINE_NOINTERSECT) && do_feather_isect) {
+ BKE_mask_spline_feather_collapse_inner_loops(spline, feather, tot);
+ }
+
+ return feather;
+}
+
+/**
+ * values align with #BKE_mask_spline_differentiate_with_resolution_ex
+ * when \a resol arguments match.
+ */
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpline *spline,
+ int *tot_feather_point,
+ const unsigned int resol,
+ const int do_feather_isect
+ ))[2]
+{
+ switch (spline->offset_mode) {
+ case MASK_SPLINE_OFFSET_EVEN:
+ return mask_spline_feather_differentiated_points_with_resolution_ex__even(spline, tot_feather_point, resol, do_feather_isect);
+ break;
+ case MASK_SPLINE_OFFSET_SMOOTH:
+ default:
+ return mask_spline_feather_differentiated_points_with_resolution_ex__double(spline, tot_feather_point, resol, do_feather_isect);
+ break;
+ }
+}
+
+float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline, int width, int height,
+ int *tot_feather_point, const int do_feather_isect))[2]
+{
+ unsigned int resol = BKE_mask_spline_feather_resolution(spline, width, height);
+
+ return BKE_mask_spline_feather_differentiated_points_with_resolution_ex(spline, tot_feather_point, resol, do_feather_isect);
+}
+
+float (*BKE_mask_spline_feather_differentiated_points(MaskSpline *spline, int *tot_feather_point))[2]
+{
+ return BKE_mask_spline_feather_differentiated_points_with_resolution(spline, 0, 0, tot_feather_point, TRUE);
+}
+
+float (*BKE_mask_spline_feather_points(MaskSpline *spline, int *tot_feather_point))[2]
+{
+ MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
+
+ int i, tot = 0;
+ float (*feather)[2], (*fp)[2];
+
+ /* count */
+ for (i = 0; i < spline->tot_point; i++) {
+ MaskSplinePoint *point = &points_array[i];
+
+ tot += point->tot_uw + 1;
+ }
+
+ /* create data */
+ feather = fp = MEM_mallocN(tot * sizeof(*feather), "mask spline feather points");
+
+ for (i = 0; i < spline->tot_point; i++) {
+ MaskSplinePoint *point = &points_array[i];
+ BezTriple *bezt = &point->bezt;
+ float weight, n[2];
+ int j;
+
+ BKE_mask_point_normal(spline, point, 0.0f, n);
+ weight = BKE_mask_point_weight(spline, point, 0.0f);
+
+ madd_v2_v2v2fl(*fp, bezt->vec[1], n, weight);
+ fp++;
+
+ for (j = 0; j < point->tot_uw; j++) {
+ float u = point->uw[j].u;
+ float co[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);
+
+ madd_v2_v2v2fl(*fp, co, n, weight);
+ fp++;
+ }
+ }
+
+ *tot_feather_point = tot;
+
+ 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);
+}
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 87906337ca2..d137393e698 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -56,7 +56,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)
{
@@ -72,7 +72,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)
{
@@ -286,14 +286,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);
}
@@ -448,14 +448,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);
}
@@ -558,14 +558,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);
}
@@ -807,14 +807,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);
}
@@ -913,14 +913,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);
}
@@ -1017,14 +1017,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);
}
@@ -1214,14 +1214,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);
}
@@ -2748,7 +2748,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);
@@ -2756,7 +2756,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);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 3bcef50a3b4..8aab622148b 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -207,8 +207,10 @@ void BKE_sequence_free(Scene *scene, Sequence *seq)
/* free modifiers */
BKE_sequence_modifier_clear(seq);
- BKE_sequencer_cache_cleanup_sequence(seq);
- BKE_sequencer_preprocessed_cache_cleanup_sequence(seq);
+ /* free cached data used by this strip,
+ * also invalidate cache for all dependent sequences
+ */
+ BKE_sequence_invalidate_cache(scene, seq);
MEM_freeN(seq);
}
@@ -2936,6 +2938,9 @@ static void free_anim_seq(Sequence *seq)
/* check whether sequence cur depends on seq */
int BKE_sequence_check_depend(Sequence *seq, Sequence *cur)
{
+ if (cur->seq1 == seq || cur->seq2 == seq || cur->seq3 == seq)
+ return TRUE;
+
/* sequences are not intersecting in time, assume no dependency exists between them */
if (cur->enddisp < seq->startdisp || cur->startdisp > seq->enddisp)
return FALSE;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 14360297ec0..2462de07a18 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -774,37 +774,37 @@ void sound_force_device(int UNUSED(device)) {}
void sound_init_once(void) {}
void sound_init(struct Main *UNUSED(bmain)) {}
void sound_exit(void) {}
-void sound_cache(struct bSound* UNUSED(sound)) { }
-void sound_delete_cache(struct bSound* UNUSED(sound)) {}
-void sound_load(struct Main *UNUSED(bmain), struct bSound* UNUSED(sound)) {}
+void sound_cache(struct bSound *UNUSED(sound)) { }
+void sound_delete_cache(struct bSound *UNUSED(sound)) {}
+void sound_load(struct Main *UNUSED(bmain), struct bSound *UNUSED(sound)) {}
void sound_create_scene(struct Scene *UNUSED(scene)) {}
void sound_destroy_scene(struct Scene *UNUSED(scene)) {}
void sound_mute_scene(struct Scene *UNUSED(scene), int UNUSED(muted)) {}
-void* sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
-void* sound_scene_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence)) { return NULL; }
-void* sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
-void* sound_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence* UNUSED(sequence)) { return NULL; }
-void sound_remove_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle)) {}
-void sound_mute_scene_sound(void* UNUSED(handle), char UNUSED(mute)) {}
-void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
+void *sound_scene_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void *sound_scene_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) { return NULL; }
+void *sound_add_scene_sound(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) { return NULL; }
+void *sound_add_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) { return NULL; }
+void sound_remove_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle)) {}
+void sound_mute_scene_sound(void *UNUSED(handle), char UNUSED(mute)) {}
+void sound_move_scene_sound(struct Scene *UNUSED(scene), void *UNUSED(handle), int UNUSED(startframe), int UNUSED(endframe), int UNUSED(frameskip)) {}
void sound_move_scene_sound_defaults(struct Scene *UNUSED(scene), struct Sequence *UNUSED(sequence)) {}
void sound_play_scene(struct Scene *UNUSED(scene)) {}
void sound_stop_scene(struct Scene *UNUSED(scene)) {}
void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {}
float sound_sync_scene(struct Scene *UNUSED(scene)) { return NAN_FLT; }
int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
-int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
-void sound_read_waveform(struct bSound* sound) { (void)sound; }
+int sound_read_sound_buffer(struct bSound *UNUSED(sound), float *UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
+void sound_read_waveform(struct bSound *sound) { (void)sound; }
void sound_init_main(struct Main *bmain) { (void)bmain; }
void sound_set_cfra(int cfra) { (void)cfra; }
-void sound_update_sequencer(struct Main* main, struct bSound* sound) { (void)main; (void)sound; }
-void sound_update_scene(struct Scene* scene) { (void)scene; }
-void sound_update_scene_sound(void* handle, struct bSound* sound) { (void)handle; (void)sound; }
+void sound_update_sequencer(struct Main *main, struct bSound *sound) { (void)main; (void)sound; }
+void sound_update_scene(struct Scene *scene) { (void)scene; }
+void sound_update_scene_sound(void *handle, struct bSound *sound) { (void)handle; (void)sound; }
void sound_update_scene_listener(struct Scene *scene) { (void)scene; }
void sound_update_fps(struct Scene *scene) { (void)scene; }
-void sound_set_scene_sound_volume(void* handle, float volume, char animated) { (void)handle; (void)volume; (void)animated; }
-void sound_set_scene_sound_pan(void* handle, float pan, char animated) { (void)handle; (void)pan; (void)animated; }
+void sound_set_scene_sound_volume(void *handle, float volume, char animated) { (void)handle; (void)volume; (void)animated; }
+void sound_set_scene_sound_pan(void *handle, float pan, char animated) { (void)handle; (void)pan; (void)animated; }
void sound_set_scene_volume(struct Scene *scene, float volume) { (void)scene; (void)volume; }
-void sound_set_scene_sound_pitch(void* handle, float pitch, char animated) { (void)handle; (void)pitch; (void)animated; }
-float sound_get_length(struct bSound* sound) { (void)sound; return 0; }
+void sound_set_scene_sound_pitch(void *handle, float pitch, char animated) { (void)handle; (void)pitch; (void)animated; }
+float sound_get_length(struct bSound *sound) { (void)sound; return 0; }
#endif // WITH_AUDASPACE
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index f22fd74baf4..3526058e12b 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -69,8 +69,6 @@
#include "ffmpeg_compat.h"
-extern void do_init_ffmpeg(void);
-
static int ffmpeg_type = 0;
static int ffmpeg_codec = CODEC_ID_MPEG4;
static int ffmpeg_audio_codec = CODEC_ID_NONE;
@@ -101,6 +99,8 @@ static AUD_Device *audio_mixdown_device = 0;
#define FFMPEG_AUTOSPLIT_SIZE 2000000000
+#define PRINT if (G.debug & G_DEBUG_FFMPEG) printf
+
/* Delete a picture buffer */
static void delete_picture(AVFrame *f)
@@ -125,9 +125,7 @@ static int write_audio_frame(void)
AUD_readDevice(audio_mixdown_device, audio_input_buffer, audio_input_samples);
audio_time += (double) audio_input_samples / (double) c->sample_rate;
- pkt.size = avcodec_encode_audio(c, audio_output_buffer,
- audio_outbuf_size,
- (short *)audio_input_buffer);
+ pkt.size = avcodec_encode_audio(c, audio_output_buffer, audio_outbuf_size, (short *) audio_input_buffer);
if (pkt.size < 0) {
// XXX error("Error writing audio packet");
@@ -137,9 +135,8 @@ static int write_audio_frame(void)
pkt.data = audio_output_buffer;
if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) {
- pkt.pts = av_rescale_q(c->coded_frame->pts,
- c->time_base, audio_stream->time_base);
- fprintf(stderr, "Audio Frame PTS: %d\n", (int)pkt.pts);
+ pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, audio_stream->time_base);
+ PRINT("Audio Frame PTS: %d\n", (int) pkt.pts);
}
pkt.stream_index = audio_stream->index;
@@ -189,8 +186,7 @@ static const char **get_file_extensions(int format)
return rv;
}
case FFMPEG_MPEG2: {
- static const char *rv[] = { ".dvd", ".vob", ".mpg", ".mpeg",
- NULL };
+ static const char *rv[] = { ".dvd", ".vob", ".mpg", ".mpeg", NULL };
return rv;
}
case FFMPEG_MPEG4: {
@@ -254,21 +250,18 @@ static int write_video_frame(RenderData *rd, int cfra, AVFrame *frame, ReportLis
frame->top_field_first = ((rd->mode & R_ODDFIELD) != 0);
}
- outsize = avcodec_encode_video(c, video_buffer, video_buffersize,
- frame);
+ outsize = avcodec_encode_video(c, video_buffer, video_buffersize, frame);
if (outsize > 0) {
AVPacket packet;
av_init_packet(&packet);
if (c->coded_frame->pts != AV_NOPTS_VALUE) {
- packet.pts = av_rescale_q(c->coded_frame->pts,
- c->time_base,
- video_stream->time_base);
- fprintf(stderr, "Video Frame PTS: %d\n", (int)packet.pts);
+ packet.pts = av_rescale_q(c->coded_frame->pts, c->time_base, video_stream->time_base);
+ PRINT("Video Frame PTS: %d\n", (int)packet.pts);
}
else {
- fprintf(stderr, "Video Frame PTS: not set\n");
+ PRINT("Video Frame PTS: not set\n");
}
if (c->coded_frame->key_frame)
packet.flags |= AV_PKT_FLAG_KEY;
@@ -364,7 +357,7 @@ static void set_ffmpeg_property_option(AVCodecContext *c, IDProperty *prop)
char *param;
const AVOption *rv = NULL;
- fprintf(stderr, "FFMPEG expert option: %s: ", prop->name);
+ PRINT("FFMPEG expert option: %s: ", prop->name);
BLI_strncpy(name, prop->name, sizeof(name));
@@ -376,15 +369,15 @@ static void set_ffmpeg_property_option(AVCodecContext *c, IDProperty *prop)
switch (prop->type) {
case IDP_STRING:
- fprintf(stderr, "%s.\n", IDP_String(prop));
+ PRINT("%s.\n", IDP_String(prop));
av_set_string3(c, prop->name, IDP_String(prop), 1, &rv);
break;
case IDP_FLOAT:
- fprintf(stderr, "%g.\n", IDP_Float(prop));
+ PRINT("%g.\n", IDP_Float(prop));
rv = av_set_double(c, prop->name, IDP_Float(prop));
break;
case IDP_INT:
- fprintf(stderr, "%d.\n", IDP_Int(prop));
+ PRINT("%d.\n", IDP_Int(prop));
if (param) {
if (IDP_Int(prop)) {
@@ -401,8 +394,7 @@ static void set_ffmpeg_property_option(AVCodecContext *c, IDProperty *prop)
}
if (!rv) {
- fprintf(stderr, "ffmpeg-option not supported: %s! Skipping.\n",
- prop->name);
+ PRINT("ffmpeg-option not supported: %s! Skipping.\n", prop->name);
}
}
@@ -446,11 +438,14 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
/* prepare a video stream for the output file */
static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContext *of,
- int rectx, int recty)
+ int rectx, int recty, char *error, int error_size)
{
AVStream *st;
AVCodecContext *c;
AVCodec *codec;
+
+ error[0] = '\0';
+
st = av_new_stream(of, 0);
if (!st) return NULL;
@@ -460,7 +455,6 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
c->codec_id = codec_id;
c->codec_type = AVMEDIA_TYPE_VIDEO;
-
/* Get some values from the current render settings */
c->width = rectx;
@@ -492,7 +486,8 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
c->me_method = ME_EPZS;
codec = avcodec_find_encoder(c->codec_id);
- if (!codec) return NULL;
+ if (!codec)
+ return NULL;
/* Be sure to use the correct pixel format(e.g. RGB, YUV) */
@@ -547,27 +542,25 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
// || !strcmp(of->oformat->name, "3gp")
)
{
- fprintf(stderr, "Using global header\n");
+ PRINT("Using global header\n");
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
}
/* Determine whether we are encoding interlaced material or not */
if (rd->mode & R_FIELDS) {
- fprintf(stderr, "Encoding interlaced video\n");
+ PRINT("Encoding interlaced video\n");
c->flags |= CODEC_FLAG_INTERLACED_DCT;
c->flags |= CODEC_FLAG_INTERLACED_ME;
}
/* xasp & yasp got float lately... */
- st->sample_aspect_ratio = c->sample_aspect_ratio = av_d2q(
- ((double) rd->xasp / (double) rd->yasp), 255);
+ st->sample_aspect_ratio = c->sample_aspect_ratio = av_d2q(((double) rd->xasp / (double) rd->yasp), 255);
set_ffmpeg_properties(rd, c, "video");
if (avcodec_open(c, codec) < 0) {
- //
- //XXX error("Couldn't initialize codec");
+ BLI_strncpy(error, IMB_ffmpeg_last_error(), error_size);
return NULL;
}
@@ -584,16 +577,11 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex
else
video_buffersize = avpicture_get_size(c->pix_fmt, c->width, c->height);
- video_buffer = (uint8_t *)MEM_mallocN(video_buffersize * sizeof(uint8_t),
- "FFMPEG video buffer");
+ video_buffer = (uint8_t *)MEM_mallocN(video_buffersize * sizeof(uint8_t), "FFMPEG video buffer");
current_frame = alloc_picture(c->pix_fmt, c->width, c->height);
- img_convert_ctx = sws_getContext(c->width, c->height,
- PIX_FMT_BGR32,
- c->width, c->height,
- c->pix_fmt,
- SWS_BICUBIC,
+ img_convert_ctx = sws_getContext(c->width, c->height, PIX_FMT_BGR32, c->width, c->height, c->pix_fmt, SWS_BICUBIC,
NULL, NULL, NULL);
return st;
}
@@ -645,11 +633,9 @@ static AVStream *alloc_audio_stream(RenderData *rd, int codec_id, AVFormatContex
audio_outbuf_size = c->frame_size * c->channels * sizeof(int16_t) * 4;
}
- audio_output_buffer = (uint8_t *)av_malloc(
- audio_outbuf_size);
+ audio_output_buffer = (uint8_t *) av_malloc(audio_outbuf_size);
- audio_input_buffer = (uint8_t *)av_malloc(
- audio_input_samples * c->channels * sizeof(int16_t));
+ audio_input_buffer = (uint8_t *) av_malloc(audio_input_samples * c->channels * sizeof(int16_t));
audio_time = 0.0f;
@@ -672,7 +658,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
AVFormatContext *of;
AVOutputFormat *fmt;
AVDictionary *opts = NULL;
- char name[256];
+ char name[256], error[1024];
const char **exts;
ffmpeg_type = rd->ffcodecdata.type;
@@ -681,14 +667,11 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
ffmpeg_video_bitrate = rd->ffcodecdata.video_bitrate;
ffmpeg_audio_bitrate = rd->ffcodecdata.audio_bitrate;
ffmpeg_gop_size = rd->ffcodecdata.gop_size;
- ffmpeg_autosplit = rd->ffcodecdata.flags
- & FFMPEG_AUTOSPLIT_OUTPUT;
+ ffmpeg_autosplit = rd->ffcodecdata.flags & FFMPEG_AUTOSPLIT_OUTPUT;
- do_init_ffmpeg();
-
/* Determine the correct filename */
BKE_ffmpeg_filepath_get(name, rd);
- fprintf(stderr, "Starting output to %s(ffmpeg)...\n"
+ PRINT("Starting output to %s(ffmpeg)...\n"
" Using type=%d, codec=%d, audio_codec=%d,\n"
" video_bitrate=%d, audio_bitrate=%d,\n"
" gop_size=%d, autosplit=%d\n"
@@ -793,10 +776,14 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
}
if (fmt->video_codec != CODEC_ID_NONE) {
- video_stream = alloc_video_stream(rd, fmt->video_codec, of, rectx, recty);
- printf("alloc video stream %p\n", video_stream);
+ video_stream = alloc_video_stream(rd, fmt->video_codec, of, rectx, recty, error, sizeof(error));
+ PRINT("alloc video stream %p\n", video_stream);
if (!video_stream) {
- BKE_report(reports, RPT_ERROR, "Error initializing video stream.");
+ if (error[0])
+ BKE_report(reports, RPT_ERROR, error);
+ else
+ BKE_report(reports, RPT_ERROR, "Error initializing video stream.");
+
av_dict_free(&opts);
return 0;
}
@@ -867,13 +854,11 @@ void flush_ffmpeg(void)
break;
}
if (c->coded_frame->pts != AV_NOPTS_VALUE) {
- packet.pts = av_rescale_q(c->coded_frame->pts,
- c->time_base,
- video_stream->time_base);
- fprintf(stderr, "Video Frame PTS: %d\n", (int)packet.pts);
+ packet.pts = av_rescale_q(c->coded_frame->pts, c->time_base, video_stream->time_base);
+ PRINT("Video Frame PTS: %d\n", (int) packet.pts);
}
else {
- fprintf(stderr, "Video Frame PTS: not set\n");
+ PRINT("Video Frame PTS: not set\n");
}
if (c->coded_frame->key_frame) {
packet.flags |= AV_PKT_FLAG_KEY;
@@ -916,8 +901,7 @@ void BKE_ffmpeg_filepath_get(char *string, RenderData *rd)
}
while (*fe) {
- if (BLI_strcasecmp(string + strlen(string) - strlen(*fe),
- *fe) == 0)
+ if (BLI_strcasecmp(string + strlen(string) - strlen(*fe), *fe) == 0)
{
break;
}
@@ -983,9 +967,7 @@ int BKE_ffmpeg_append(RenderData *rd, int start_frame, int frame, int *pixels, i
AVFrame *avframe;
int success = 1;
- fprintf(stderr, "Writing frame %i, "
- "render width=%d, render height=%d\n", frame,
- rectx, recty);
+ PRINT("Writing frame %i, render width=%d, render height=%d\n", frame, rectx, recty);
// why is this done before writing the video frame and again at end_ffmpeg?
// write_audio_frames(frame / (((double)rd->frs_sec) / rd->frs_sec_base));
@@ -1013,7 +995,7 @@ void BKE_ffmpeg_end(void)
{
unsigned int i;
- fprintf(stderr, "Closing ffmpeg...\n");
+ PRINT("Closing ffmpeg...\n");
#if 0
if (audio_stream) { /* SEE UPPER */
@@ -1029,7 +1011,7 @@ void BKE_ffmpeg_end(void)
#endif
if (video_stream && video_stream->codec) {
- fprintf(stderr, "Flushing delayed frames...\n");
+ PRINT("Flushing delayed frames...\n");
flush_ffmpeg();
}
@@ -1041,7 +1023,7 @@ void BKE_ffmpeg_end(void)
if (video_stream && video_stream->codec) {
avcodec_close(video_stream->codec);
- printf("zero video stream %p\n", video_stream);
+ PRINT("zero video stream %p\n", video_stream);
video_stream = 0;
}
@@ -1142,8 +1124,7 @@ IDProperty *BKE_ffmpeg_property_add(RenderData *rd, const char *type, int opt_in
BLI_strncpy(name, o->name, sizeof(name));
}
- fprintf(stderr, "ffmpeg_property_add: %s %d %d %s\n",
- type, parent_index, opt_index, name);
+ PRINT("ffmpeg_property_add: %s %d %d %s\n", type, parent_index, opt_index, name);
prop = IDP_GetPropertyFromGroup(group, name);
if (prop) {
@@ -1181,8 +1162,7 @@ IDProperty *BKE_ffmpeg_property_add(RenderData *rd, const char *type, int opt_in
/* not all versions of ffmpeg include that, so here we go ... */
-static const AVOption *my_av_find_opt(void *v, const char *name,
- const char *unit, int mask, int flags)
+static const AVOption *my_av_find_opt(void *v, const char *name, const char *unit, int mask, int flags)
{
AVClass *c = *(AVClass **)v;
const AVOption *o = c->option;
@@ -1235,14 +1215,11 @@ int BKE_ffmpeg_property_add_string(RenderData *rd, const char *type, const char
if (param && o->type != FF_OPT_TYPE_CONST && o->unit) {
p = my_av_find_opt(&c, param, o->unit, 0, 0);
if (p) {
- prop = BKE_ffmpeg_property_add(rd,
- (char *) type, p - c.av_class->option,
- o - c.av_class->option);
+ prop = BKE_ffmpeg_property_add(rd, (char *) type, p - c.av_class->option, o - c.av_class->option);
}
}
else {
- prop = BKE_ffmpeg_property_add(rd,
- (char *) type, o - c.av_class->option, 0);
+ prop = BKE_ffmpeg_property_add(rd, (char *) type, o - c.av_class->option, 0);
}
@@ -1316,12 +1293,10 @@ static void ffmpeg_set_expert_options(RenderData *rd)
if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
BKE_ffmpeg_property_add_string(rd, "video", "cqp:0");
}
-#if 0 /* disabled for after release */
else if (codec_id == CODEC_ID_DNXHD) {
if (rd->ffcodecdata.flags & FFMPEG_LOSSLESS_OUTPUT)
- ffmpeg_property_add_string(rd, "video", "mbd:rd");
+ BKE_ffmpeg_property_add_string(rd, "video", "mbd:rd");
}
-#endif
}
void BKE_ffmpeg_preset_set(RenderData *rd, int preset)
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 3d111e61e82..d63df752fe3 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -221,6 +221,9 @@ MINLINE void normal_float_to_short_v3(short r[3], const float n[3]);
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3]);
+void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist);
+void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist);
+
/***************************** Array Functions *******************************/
/* attempted to follow fixed length vertex functions. names could be improved*/
double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size);
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index 6c0d547fe6f..20d04f7881e 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -260,8 +260,8 @@ void BLI_pbvh_node_free_proxies(PBVHNode *node);
PBVHProxyNode *BLI_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node);
void BLI_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***nodes, int *totnode);
-//void BLI_pbvh_node_BB_reset(PBVHNode* node);
-//void BLI_pbvh_node_BB_expand(PBVHNode* node, float co[3]);
+//void BLI_pbvh_node_BB_reset(PBVHNode *node);
+//void BLI_pbvh_node_BB_expand(PBVHNode *node, float co[3]);
#endif /* __BLI_PBVH_H__ */
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index a74629e589c..b3d0df04eb1 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -32,6 +32,8 @@
* \ingroup bli
*/
+#include <stdarg.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -140,6 +142,11 @@ __attribute__((nonnull))
;
/*
+ * Replacement for vsnprintf
+ */
+size_t BLI_vsnprintf(char *buffer, size_t count, const char *format, va_list arg);
+
+/*
* Print formatted string into a newly mallocN'd string
* and return it.
*/
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 5cda1c0b81f..4196bab0474 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -451,6 +451,29 @@ void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
if (max[2] < vec[2]) max[2] = vec[2];
}
+/** ensure \a v1 is \a dist from \a v2 */
+void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist)
+{
+ if (!equals_v3v3(v2, v1)) {
+ float nor[3];
+
+ sub_v3_v3v3(nor, v1, v2);
+ normalize_v3(nor);
+ madd_v3_v3v3fl(v1, v2, nor, dist);
+ }
+}
+
+void dist_ensure_v2_v2fl(float v1[2], const float v2[2], const float dist)
+{
+ if (!equals_v2v2(v2, v1)) {
+ float nor[2];
+
+ sub_v2_v2v2(nor, v1, v2);
+ normalize_v2(nor);
+ madd_v2_v2v2fl(v1, v2, nor, dist);
+ }
+}
+
/***************************** Array Functions *******************************/
double dot_vn_vn(const float *array_src_a, const float *array_src_b, const int size)
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index b4b546d9167..22597c9f8e6 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -260,12 +260,12 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node)
node->vb = vb;
}
-//void BLI_pbvh_node_BB_reset(PBVHNode* node)
+//void BLI_pbvh_node_BB_reset(PBVHNode *node)
//{
// BB_reset(&node->vb);
//}
//
-//void BLI_pbvh_node_BB_expand(PBVHNode* node, float co[3])
+//void BLI_pbvh_node_BB_expand(PBVHNode *node, float co[3])
//{
// BB_expand(&node->vb, co);
//}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 7a750a74a33..8501db7c8b8 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -78,22 +78,31 @@ char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
return dst;
}
-size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
+size_t BLI_vsnprintf(char *buffer, size_t count, const char *format, va_list arg)
{
size_t n;
- va_list arg;
- va_start(arg, format);
n = vsnprintf(buffer, count, format, arg);
-
+
if (n != -1 && n < count) {
buffer[n] = '\0';
}
else {
buffer[count - 1] = '\0';
}
-
+
+ return n;
+}
+
+size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
+{
+ size_t n;
+ va_list arg;
+
+ va_start(arg, format);
+ n = BLI_vsnprintf(buffer, count, format, arg);
va_end(arg);
+
return n;
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 65d487f7612..e9c8de8e339 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2617,7 +2617,7 @@ static void lib_link_armature(FileData *fd, Main *main)
}
}
-static void direct_link_bones(FileData *fd, Bone* bone)
+static void direct_link_bones(FileData *fd, Bone *bone)
{
Bone *child;
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index ed5ffbf463e..1bad1bd80df 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -129,7 +129,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
ar->v2d.flag = (V2D_PIXELOFS_X|V2D_PIXELOFS_Y);
}
-static void sequencer_init_preview_region(ARegion* ar)
+static void sequencer_init_preview_region(ARegion *ar)
{
// XXX a bit ugly still, copied from space_sequencer
/* NOTE: if you change values here, also change them in space_sequencer.c, sequencer_new */
@@ -1787,7 +1787,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
SpaceLink *sl;
for (sl = sa->spacedata.first; sl; sl = sl->next) {
if (sl->spacetype == SPACE_VIEW3D) {
- View3D* v3d = (View3D *)sl;
+ View3D *v3d = (View3D *)sl;
v3d->flag2 &= ~V3D_RENDER_OVERRIDE;
}
}
@@ -2206,7 +2206,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
bActuator *act;
for (act = ob->actuators.first; act; act = act->next) {
if (act->type == ACT_STEERING) {
- bSteeringActuator* stact = act->data;
+ bSteeringActuator *stact = act->data;
if (stact->facingaxis == 0) {
stact->facingaxis = 1;
}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index c31906cbd80..8ace277b42d 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1141,7 +1141,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
if (main->versionfile <= 212) {
- bSound* sound;
+ bSound *sound;
bProperty *prop;
Object *ob;
Mesh *me;
@@ -1307,7 +1307,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
}
if (main->versionfile <= 224) {
- bSound* sound;
+ bSound *sound;
Scene *sce;
Mesh *me;
bScreen *sc;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 4ada0c54a93..252e81537c4 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2525,7 +2525,7 @@ static void write_libraries(WriteData *wd, Main *main)
}
}
-static void write_bone(WriteData *wd, Bone* bone)
+static void write_bone(WriteData *wd, Bone *bone)
{
Bone* cbone;
diff --git a/source/blender/bmesh/intern/bmesh_error.h b/source/blender/bmesh/intern/bmesh_error.h
index c3cedcb0e13..2ef146c7b38 100644
--- a/source/blender/bmesh/intern/bmesh_error.h
+++ b/source/blender/bmesh/intern/bmesh_error.h
@@ -84,8 +84,8 @@ void BMO_error_clear(BMesh *bm);
(void)((!(a)) ? ( \
( \
fprintf(stderr, \
- "BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
- __FILE__, __func__, __LINE__, STRINGIFY(a)), \
+ "BMESH_ASSERT failed: %s, %s(), %d at \'%s\'\n", \
+ __FILE__, __func__, __LINE__, STRINGIFY(a)), \
_BMESH_DUMMY_ABORT(), \
NULL)) : NULL)
diff --git a/source/blender/bmesh/intern/bmesh_mods.h b/source/blender/bmesh/intern/bmesh_mods.h
index 802c6cca05d..790f0cb6267 100644
--- a/source/blender/bmesh/intern/bmesh_mods.h
+++ b/source/blender/bmesh/intern/bmesh_mods.h
@@ -47,9 +47,9 @@ BMFace *BM_face_split_n(BMesh *bm, BMFace *f,
float cos[][3], int n,
BMLoop **r_l, BMEdge *example);
-BMEdge* BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
+BMEdge *BM_vert_collapse_faces(BMesh *bm, BMEdge *ke, BMVert *kv, float fac,
const short join_faces, const short kill_degenerate_faces);
-BMEdge* BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
+BMEdge *BM_vert_collapse_edge(BMesh *bm, BMEdge *ke, BMVert *kv,
const short kill_degenerate_faces);
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h
index 91a48c782f0..0674103162c 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api.h
@@ -289,7 +289,7 @@ void BMO_slot_vec_get(BMOperator *op, const char *slot_name, float r_vec[3]);
/* only supports square mats */
/* size must be 3 or 4; this api is meant only for transformation matrices.
* note that internally the matrix is stored in 4x4 form, and it's safe to
- * call whichever BMO_Get_Mat* function you want. */
+ * call whichever BMO_Get_MatXXX function you want. */
void BMO_slot_mat_set(BMOperator *op, const char *slot_name, const float *mat, int size);
void BMO_slot_mat4_get(BMOperator *op, const char *slot_name, float r_mat[4][4]);
void BMO_slot_mat3_set(BMOperator *op, const char *slot_name, float r_mat[3][3]);
diff --git a/source/blender/collada/AnimationExporter.h b/source/blender/collada/AnimationExporter.h
index 0a7832e9d64..7fd39765cc9 100644
--- a/source/blender/collada/AnimationExporter.h
+++ b/source/blender/collada/AnimationExporter.h
@@ -96,7 +96,7 @@ public:
protected:
const ExportSettings *export_settings;
- void dae_animation(Object* ob, FCurve *fcu, char* transformName, bool is_param, Material *ma = NULL);
+ void dae_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma = NULL);
void write_bone_animation_matrix(Object *ob_arm, Bone *bone);
@@ -161,7 +161,7 @@ protected:
bool hasAnimations(Scene *sce);
- char* extract_transform_name(char *rna_path);
+ char *extract_transform_name(char *rna_path);
std::string getObjectBoneName(Object *ob, const FCurve * fcu);
};
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index a237222774d..d241926c20c 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -561,7 +561,7 @@ void AnimationImporter:: Assign_transform_animations(COLLADAFW::Transformation *
case COLLADAFW::Transformation::MATRIX:
/*{
- COLLADAFW::Matrix* mat = (COLLADAFW::Matrix*)transform;
+ COLLADAFW::Matrix *mat = (COLLADAFW::Matrix*)transform;
COLLADABU::Math::Matrix4 mat4 = mat->getMatrix();
switch (binding->animationClass) {
case COLLADAFW::AnimationList::TRANSFORM:
diff --git a/source/blender/collada/TransformReader.h b/source/blender/collada/TransformReader.h
index a08f4438d73..47e59a1bf52 100644
--- a/source/blender/collada/TransformReader.h
+++ b/source/blender/collada/TransformReader.h
@@ -56,7 +56,7 @@ public:
COLLADAFW::Transformation *tm; // which transform is animated by an AnimationList->id
};
- TransformReader(UnitConverter* conv);
+ TransformReader(UnitConverter *conv);
void get_node_mat(float mat[][4], COLLADAFW::Node *node, std::map<COLLADAFW::UniqueId, Animation> *animation_map, Object *ob);
diff --git a/source/blender/collada/collada_internal.h b/source/blender/collada/collada_internal.h
index b64c75e7960..c1f75f996ce 100644
--- a/source/blender/collada/collada_internal.h
+++ b/source/blender/collada/collada_internal.h
@@ -59,7 +59,7 @@ public:
// Initialize with Z_UP, since Blender uses right-handed, z-up
UnitConverter();
- void read_asset(const COLLADAFW::FileInfo* asset);
+ void read_asset(const COLLADAFW::FileInfo *asset);
void convertVector3(COLLADABU::Math::Vector3 &vec, float *v);
diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.cpp b/source/blender/compositor/nodes/COM_DespeckleNode.cpp
new file mode 100644
index 00000000000..603ddcd1389
--- /dev/null
+++ b/source/blender/compositor/nodes/COM_DespeckleNode.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#include "COM_DespeckleNode.h"
+#include "DNA_scene_types.h"
+#include "COM_ExecutionSystem.h"
+#include "COM_DespeckleOperation.h"
+#include "BLI_math.h"
+
+DespeckleNode::DespeckleNode(bNode *editorNode) : Node(editorNode)
+{
+ /* pass */
+}
+
+void DespeckleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+{
+ bNode *editorNode = this->getbNode();
+ InputSocket *inputSocket = this->getInputSocket(0);
+ InputSocket *inputImageSocket = this->getInputSocket(1);
+ OutputSocket *outputSocket = this->getOutputSocket(0);
+ DespeckleOperation *operation = new DespeckleOperation();
+
+ operation->setbNode(editorNode);
+ operation->setThreshold(editorNode->custom3);
+ operation->setThresholdNeighbour(editorNode->custom4);
+
+ inputImageSocket->relinkConnections(operation->getInputSocket(0), 1, graph);
+ inputSocket->relinkConnections(operation->getInputSocket(1), 0, graph);
+ outputSocket->relinkConnections(operation->getOutputSocket());
+ addPreviewOperation(graph, operation->getOutputSocket(0));
+
+ graph->addOperation(operation);
+}
diff --git a/source/blender/compositor/nodes/COM_DespeckleNode.h b/source/blender/compositor/nodes/COM_DespeckleNode.h
new file mode 100644
index 00000000000..2b8ab9d0226
--- /dev/null
+++ b/source/blender/compositor/nodes/COM_DespeckleNode.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#ifndef _COM_DespeckleNode_h_
+#define _COM_DespeckleNode_h_
+
+#include "COM_Node.h"
+
+/**
+ * @brief DespeckleNode
+ * @ingroup Node
+ */
+class DespeckleNode : public Node {
+public:
+ DespeckleNode(bNode *editorNode);
+ void convertToOperations(ExecutionSystem *graph, CompositorContext *context);
+};
+
+#endif
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cpp b/source/blender/compositor/operations/COM_DespeckleOperation.cpp
new file mode 100644
index 00000000000..599f54720f2
--- /dev/null
+++ b/source/blender/compositor/operations/COM_DespeckleOperation.cpp
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "COM_DespeckleOperation.h"
+
+#include "BLI_utildefines.h"
+
+DespeckleOperation::DespeckleOperation() : NodeOperation()
+{
+ this->addInputSocket(COM_DT_COLOR);
+ this->addInputSocket(COM_DT_VALUE);
+ this->addOutputSocket(COM_DT_COLOR);
+ this->setResolutionInputSocketIndex(0);
+ this->m_inputOperation = NULL;
+ this->setComplex(true);
+}
+void DespeckleOperation::initExecution()
+{
+ this->m_inputOperation = this->getInputSocketReader(0);
+ this->m_inputValueOperation = this->getInputSocketReader(1);
+}
+
+void DespeckleOperation::deinitExecution()
+{
+ this->m_inputOperation = NULL;
+ this->m_inputValueOperation = NULL;
+}
+
+BLI_INLINE int color_diff(const float a[3], const float b[3], const float threshold)
+{
+ return ((fabsf(a[0] - b[0]) > threshold) ||
+ (fabsf(a[1] - b[1]) > threshold) ||
+ (fabsf(a[2] - b[2]) > threshold));
+}
+
+void DespeckleOperation::executePixel(float output[4], int x, int y, void *data)
+{
+ float w = 0.0f;
+ float color_org[4];
+ float color_mid[4];
+ float color_mid_ok[4];
+ float in1[4];
+ int x1 = x - 1;
+ int x2 = x;
+ int x3 = x + 1;
+ int y1 = y - 1;
+ int y2 = y;
+ int y3 = y + 1;
+ CLAMP(x1, 0, getWidth() - 1);
+ CLAMP(x2, 0, getWidth() - 1);
+ CLAMP(x3, 0, getWidth() - 1);
+ CLAMP(y1, 0, getHeight() - 1);
+ CLAMP(y2, 0, getHeight() - 1);
+ CLAMP(y3, 0, getHeight() - 1);
+ float value[4];
+ this->m_inputValueOperation->read(value, x2, y2, NULL);
+ //const float mval = 1.0f - value[0];
+
+
+ this->m_inputOperation->read(color_org, x2, y2, NULL);
+
+#define TOT_DIV_ONE 1.0f
+#define TOT_DIV_CNR (float)M_SQRT1_2
+
+#define WTOT (TOT_DIV_ONE * 4 + TOT_DIV_CNR * 4)
+
+#define COLOR_ADD(fac) \
+{ \
+ madd_v4_v4fl(color_mid, in1, fac); \
+ if (color_diff(in1, color_org, this->m_threshold)) { \
+ w += fac; \
+ madd_v4_v4fl(color_mid_ok, in1, fac); \
+ } \
+}
+
+ zero_v4(color_mid);
+ zero_v4(color_mid_ok);
+
+ this->m_inputOperation->read(in1, x1, y1, NULL); COLOR_ADD(TOT_DIV_CNR)
+ this->m_inputOperation->read(in1, x2, y1, NULL); COLOR_ADD(TOT_DIV_ONE)
+ this->m_inputOperation->read(in1, x3, y1, NULL); COLOR_ADD(TOT_DIV_CNR)
+ this->m_inputOperation->read(in1, x1, y2, NULL); COLOR_ADD(TOT_DIV_ONE)
+
+#if 0
+ this->m_inputOperation->read(in2, x2, y2, NULL);
+ madd_v4_v4fl(color_mid, in2, this->m_filter[4]);
+#endif
+
+ this->m_inputOperation->read(in1, x3, y2, NULL); COLOR_ADD(TOT_DIV_ONE)
+ this->m_inputOperation->read(in1, x1, y3, NULL); COLOR_ADD(TOT_DIV_CNR)
+ this->m_inputOperation->read(in1, x2, y3, NULL); COLOR_ADD(TOT_DIV_ONE)
+ this->m_inputOperation->read(in1, x3, y3, NULL); COLOR_ADD(TOT_DIV_CNR)
+
+ mul_v4_fl(color_mid, 1.0f / (4.0f + (4.0f * (float)M_SQRT1_2)));
+ //mul_v4_fl(color_mid, 1.0f / w);
+
+ if ((w != 0.0f) &&
+ ((w / WTOT) > (this->m_threshold_neighbour)) &&
+ color_diff(color_mid, color_org, this->m_threshold))
+ {
+ mul_v4_fl(color_mid_ok, 1.0f / w);
+ interp_v4_v4v4(output, color_org, color_mid_ok, value[0]);
+ }
+ else {
+ copy_v4_v4(output, color_org);
+ }
+}
+
+bool DespeckleOperation::determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
+{
+ rcti newInput;
+ int addx = 2; //(this->m_filterWidth - 1) / 2 + 1;
+ int addy = 2; //(this->m_filterHeight - 1) / 2 + 1;
+ newInput.xmax = input->xmax + addx;
+ newInput.xmin = input->xmin - addx;
+ newInput.ymax = input->ymax + addy;
+ newInput.ymin = input->ymin - addy;
+
+ return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output);
+}
diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.h b/source/blender/compositor/operations/COM_DespeckleOperation.h
new file mode 100644
index 00000000000..5b79d7cb7e0
--- /dev/null
+++ b/source/blender/compositor/operations/COM_DespeckleOperation.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor: Campbell Barton
+ */
+
+#ifndef _COM_DespeckleOperation_h
+#define _COM_DespeckleOperation_h
+#include "COM_NodeOperation.h"
+
+class DespeckleOperation : public NodeOperation {
+private:
+ float m_threshold;
+ float m_threshold_neighbour;
+
+ int m_filterWidth;
+ int m_filterHeight;
+
+protected:
+ SocketReader *m_inputOperation;
+ SocketReader *m_inputValueOperation;
+
+public:
+ DespeckleOperation();
+ bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output);
+ void executePixel(float output[4], int x, int y, void *data);
+
+ void setThreshold(float threshold) { this->m_threshold = threshold; }
+ void setThresholdNeighbour(float threshold) { this->m_threshold_neighbour = threshold; }
+
+ void initExecution();
+ void deinitExecution();
+};
+
+#endif
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index d024e2b0393..46537674e59 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -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;
}
}
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index cc2ca5c5475..5b19bb2d3c9 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -682,7 +682,10 @@ static int view_zoomin_exec(bContext *C, wmOperator *op)
/* default not to zoom the sequencer vertically */
if (sa && sa->spacetype == SPACE_SEQ) {
- do_zoom_y = FALSE;
+ ARegion *ar = CTX_wm_region(C);
+
+ if (ar && ar->regiontype != RGN_TYPE_PREVIEW)
+ do_zoom_y = FALSE;
}
/* set RNA-Props - zooming in by uniform factor */
@@ -727,7 +730,7 @@ static void VIEW2D_OT_zoom_in(wmOperatorType *ot)
/* api callbacks */
ot->invoke = view_zoomin_invoke;
-// ot->exec = view_zoomin_exec; // XXX, needs view_zoomdrag_init called first.
+ ot->exec = view_zoomin_exec; // XXX, needs view_zoomdrag_init called first.
ot->poll = view_zoom_poll;
/* rna - must keep these in sync with the other operators */
@@ -748,7 +751,10 @@ static int view_zoomout_exec(bContext *C, wmOperator *op)
/* default not to zoom the sequencer vertically */
if (sa && sa->spacetype == SPACE_SEQ) {
- do_zoom_y = FALSE;
+ ARegion *ar = CTX_wm_region(C);
+
+ if (ar && ar->regiontype != RGN_TYPE_PREVIEW)
+ do_zoom_y = FALSE;
}
/* set RNA-Props - zooming in by uniform factor */
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index ebfc0522f17..d0ce3f0cace 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -269,15 +269,15 @@ void WM_OT_collada_export(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "active_uv_only", 0, "Only Active UV layer",
- "Export textures assigned to the object UV maps");
+ "Export textures assigned to the object UV maps");
RNA_def_boolean(ot->srna, "include_uv_textures", 0, "Include UV Textures",
- "Export textures assigned to the object UV maps");
+ "Export textures assigned to the object UV maps");
RNA_def_boolean(ot->srna, "include_material_textures", 0, "Include Material Textures",
- "Export textures assigned to the object Materials");
+ "Export textures assigned to the object Materials");
- RNA_def_boolean(ot->srna, "use_texture_copies", 1, "Copy",
+ RNA_def_boolean(ot->srna, "use_texture_copies", 1, "Copy",
"Copy textures to same folder where the .dae file is exported");
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index c6b19e51de9..00bbfcf3188 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -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);
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index 53bfddee740..cca37cf3a44 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -370,6 +370,7 @@ void OBJECT_OT_group_add(wmOperatorType *ot)
/* api callbacks */
ot->exec = group_add_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -403,6 +404,7 @@ void OBJECT_OT_group_link(wmOperatorType *ot)
/* api callbacks */
ot->exec = group_link_exec;
ot->invoke = WM_enum_search_invoke;
+ ot->poll = ED_operator_objectmode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -438,6 +440,7 @@ void OBJECT_OT_group_remove(wmOperatorType *ot)
/* api callbacks */
ot->exec = group_remove_exec;
+ ot->poll = ED_operator_objectmode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 2f91652968f..f95b07bd71e 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -1113,7 +1113,7 @@ void fluidsimSettingsFree(FluidsimSettings *UNUSED(fss))
{
}
-FluidsimSettings* fluidsimSettingsCopy(FluidsimSettings *UNUSED(fss))
+FluidsimSettings *fluidsimSettingsCopy(FluidsimSettings *UNUSED(fss))
{
return NULL;
}
diff --git a/source/blender/editors/space_clip/clip_dopesheet_ops.c b/source/blender/editors/space_clip/clip_dopesheet_ops.c
index 6d1610f3f91..09f6271b6ef 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_ops.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_ops.c
@@ -157,7 +157,7 @@ void CLIP_OT_dopesheet_select_channel(wmOperatorType *ot)
/* properties */
RNA_def_float_vector(ot->srna, "location", 2, NULL, -FLT_MAX, FLT_MAX,
- "Location", "Mouse location to select channel", -100.0f, 100.0f);
+ "Location", "Mouse location to select channel", -100.0f, 100.0f);
RNA_def_boolean(ot->srna, "extend", 0,
- "Extend", "Extend selection rather than clearing the existing selection");
+ "Extend", "Extend selection rather than clearing the existing selection");
}
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 20b0ad509d3..aa2cadbd2d3 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -456,7 +456,7 @@ void CLIP_OT_view_pan(wmOperatorType *ot)
/* properties */
RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
- "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
+ "Offset", "Offset in floating point units, 1.0 is the width and height of the image", -FLT_MAX, FLT_MAX);
}
/********************** view zoom operator *********************/
@@ -580,7 +580,7 @@ void CLIP_OT_view_zoom(wmOperatorType *ot)
/* properties */
RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
- "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
+ "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out", -FLT_MAX, FLT_MAX);
}
/********************** view zoom in/out operator *********************/
@@ -701,7 +701,7 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
/* properties */
RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
- "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out", -FLT_MAX, FLT_MAX);
}
/********************** view all operator *********************/
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 8c5ecb48613..fcf6f28b406 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -252,7 +252,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa))
static void file_listener(ScrArea *sa, wmNotifier *wmn)
{
- /* SpaceFile* sfile = (SpaceFile*)sa->spacedata.first; */
+ /* SpaceFile *sfile = (SpaceFile*)sa->spacedata.first; */
/* context changes */
switch (wmn->category) {
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index a8bd0a443fa..08e0934e8ae 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -724,25 +724,25 @@ static const char *actuator_name(int type)
static const char *actuator_pup(Object *owner)
{
switch (owner->type) {
- case OB_ARMATURE:
- return "Actuators %t|Action %x15|Armature %x23|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
- break;
+ case OB_ARMATURE:
+ return ("Actuators %t|Action %x15|Armature %x23|Motion %x0|Constraint %x9|Ipo %x1"
+ "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
+ break;
- case OB_MESH:
- return "Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
- break;
+ case OB_MESH:
+ return ("Actuators %t|Shape Action %x21|Motion %x0|Constraint %x9|Ipo %x1"
+ "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
+ break;
- default:
- return "Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
- "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
- "|Scene %x11|Random %x13|Message %x14|Game %x17"
- "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22";
+ default:
+ return ("Actuators %t|Motion %x0|Constraint %x9|Ipo %x1"
+ "|Camera %x3|Sound %x5|Property %x6|Edit Object %x10"
+ "|Scene %x11|Random %x13|Message %x14|Game %x17"
+ "|Visibility %x18|2D Filter %x19|Parent %x20|State %x22");
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 81699d36f5f..5a40c2ce4e7 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1668,6 +1668,20 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
+static int sequencer_delete_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ ARegion *ar = CTX_wm_region(C);
+
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ /* bounding box of 30 pixels is used for markers shortcuts,
+ * prevent conflict with markers shortcurts here
+ */
+ if (event->mval[1] <= 30)
+ return OPERATOR_PASS_THROUGH;
+ }
+
+ return WM_operator_confirm(C, op, event);
+}
void SEQUENCER_OT_delete(wmOperatorType *ot)
{
@@ -1678,7 +1692,7 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
ot->description = "Erase selected strips from the sequencer";
/* api callbacks */
- ot->invoke = WM_operator_confirm;
+ ot->invoke = sequencer_delete_invoke;
ot->exec = sequencer_delete_exec;
ot->poll = sequencer_edit_poll;
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 81ee9927cb6..f5c3a4c4d89 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -52,7 +52,7 @@ struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa);
/* sequencer_draw.c */
void draw_timeline_seq(const struct bContext *C, struct ARegion *ar);
-void draw_image_seq(const struct bContext* C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset, int draw_overlay);
+void draw_image_seq(const struct bContext *C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset, int draw_overlay);
void seq_reset_imageofs(struct SpaceSeq *sseq);
diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c
index 5debeaf79ae..1655b3ec7bc 100644
--- a/source/blender/editors/space_sequencer/sequencer_scopes.c
+++ b/source/blender/editors/space_sequencer/sequencer_scopes.c
@@ -60,16 +60,14 @@ static void scope_put_pixel(unsigned char *table, unsigned char *pos)
pos[3] = 255;
}
-static void scope_put_pixel_single(unsigned char *table, unsigned char *pos,
- int col)
+static void scope_put_pixel_single(unsigned char *table, unsigned char *pos, int col)
{
char newval = table[pos[col]];
pos[col] = newval;
pos[3] = 255;
}
-static void wform_put_line(int w,
- unsigned char *last_pos, unsigned char *new_pos)
+static void wform_put_line(int w, unsigned char *last_pos, unsigned char *new_pos)
{
if (last_pos > new_pos) {
unsigned char *temp = new_pos;
@@ -86,8 +84,7 @@ static void wform_put_line(int w,
}
}
-static void wform_put_line_single(
- int w, unsigned char *last_pos, unsigned char *new_pos, int col)
+static void wform_put_line_single(int w, unsigned char *last_pos, unsigned char *new_pos, int col)
{
if (last_pos > new_pos) {
unsigned char *temp = new_pos;
@@ -161,8 +158,7 @@ static ImBuf *make_waveform_view_from_ibuf_byte(ImBuf *ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- waveform_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -204,8 +200,7 @@ static ImBuf *make_waveform_view_from_ibuf_float(ImBuf *ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- waveform_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -249,8 +244,7 @@ ImBuf *make_waveform_view_from_ibuf(ImBuf *ibuf)
static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf)
{
- ImBuf *rval = IMB_allocImBuf(
- ibuf->x + 3, 515, 32, IB_rect);
+ ImBuf *rval = IMB_allocImBuf(ibuf->x + 3, 515, 32, IB_rect);
int x, y;
unsigned char *src = (unsigned char *) ibuf->rect;
unsigned char *tgt = (unsigned char *) rval->rect;
@@ -263,8 +257,7 @@ static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- waveform_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -275,16 +268,14 @@ static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf)
unsigned char *rgb = src + 4 * (ibuf->x * y + x);
for (c = 0; c < 3; c++) {
unsigned char *p = tgt;
- p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) +
- c * sw + x / 3 + 1);
+ p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) + c * sw + x / 3 + 1);
scope_put_pixel_single(wtable, p, c);
p += 4 * w;
scope_put_pixel_single(wtable, p, c);
if (last_p[c] != NULL) {
- wform_put_line_single(
- w, last_p[c], p, c);
+ wform_put_line_single(w, last_p[c], p, c);
}
last_p[c] = p;
}
@@ -311,8 +302,7 @@ static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf)
wform_put_grid(tgt, w, h);
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- waveform_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, waveform_gamma) * 255);
}
for (y = 0; y < ibuf->y; y++) {
@@ -327,16 +317,14 @@ static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf)
CLAMP(v, 0.0f, 1.0f);
- p += 4 * (w * ((int) (v * (h - 3)) + 1) +
- c * sw + x / 3 + 1);
+ p += 4 * (w * ((int) (v * (h - 3)) + 1) + c * sw + x / 3 + 1);
scope_put_pixel_single(wtable, p, c);
p += 4 * w;
scope_put_pixel_single(wtable, p, c);
if (last_p[c] != NULL) {
- wform_put_line_single(
- w, last_p[c], p, c);
+ wform_put_line_single(w, last_p[c], p, c);
}
last_p[c] = p;
}
@@ -470,7 +458,7 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
unsigned int bins[3][256];
- memset(bins, 0, 3 * 256 * sizeof(unsigned int));
+ memset(bins, 0, sizeof(bins));
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
@@ -492,10 +480,8 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
for (c = 0; c < 3; c++) {
for (x = 0; x < 256; x++) {
- draw_histogram_bar(rval, x * 2 + 1,
- ((float) bins[c][x]) / n, c);
- draw_histogram_bar(rval, x * 2 + 2,
- ((float) bins[c][x]) / n, c);
+ draw_histogram_bar(rval, x * 2 + 1, ((float) bins[c][x]) / n, c);
+ draw_histogram_bar(rval, x * 2 + 2, ((float) bins[c][x]) / n, c);
}
}
@@ -507,10 +493,10 @@ static ImBuf *make_histogram_view_from_ibuf_byte(ImBuf *ibuf)
static int get_bin_float(float f)
{
if (f < -0.25f) {
- f = -0.25f;
+ return 0;
}
- else if (f > 1.25f) {
- f = 1.25f;
+ else if (f >= 1.25f) {
+ return 511;
}
return (int) (((f + 0.25f) / 1.5f) * 512);
@@ -524,7 +510,7 @@ static ImBuf *make_histogram_view_from_ibuf_float(ImBuf *ibuf)
unsigned int bins[3][512];
- memset(bins, 0, 3 * 256 * sizeof(unsigned int));
+ memset(bins, 0, sizeof(bins));
for (y = 0; y < ibuf->y; y++) {
for (x = 0; x < ibuf->x; x++) {
@@ -567,9 +553,7 @@ ImBuf *make_histogram_view_from_ibuf(ImBuf *ibuf)
}
}
-static void vectorscope_put_cross(unsigned char r, unsigned char g,
- unsigned char b,
- char *tgt, int w, int h, int size)
+static void vectorscope_put_cross(unsigned char r, unsigned char g, unsigned char b, char *tgt, int w, int h, int size)
{
float rgb[3], yuv[3];
char *p;
@@ -609,8 +593,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf)
unsigned char wtable[256];
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- scope_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, scope_gamma) * 255);
}
for (x = 0; x <= 255; x++) {
@@ -656,8 +639,7 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf)
unsigned char wtable[256];
for (x = 0; x < 256; x++) {
- wtable[x] = (unsigned char) (pow(((float) x + 1) / 256,
- scope_gamma) * 255);
+ wtable[x] = (unsigned char) (pow(((float) x + 1) / 256, scope_gamma) * 255);
}
for (x = 0; x <= 255; x++) {
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c
new file mode 100644
index 00000000000..fa39003bd55
--- /dev/null
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -0,0 +1,221 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 Blender Foundation.
+ * All rights reserved.
+ *
+ * Contributor(s): Blender Foundation,
+ * Sergey Sharybin
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+
+/** \file blender/editors/space_sequencer/sequencer_modifier.c
+ * \ingroup spseq
+ */
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
+
+#include "DNA_scene_types.h"
+
+#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_sequencer.h"
+#include "BKE_screen.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_image.h"
+#include "ED_screen.h"
+#include "ED_space_api.h"
+
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "UI_view2d.h"
+
+/* own include */
+#include "sequencer_intern.h"
+
+/******************** sample backdrop operator ********************/
+
+typedef struct ImageSampleInfo {
+ ARegionType *art;
+ void *draw_handle;
+ int x, y;
+ int channels;
+
+ unsigned char col[4];
+ float colf[4];
+
+ unsigned char *colp;
+ float *colfp;
+
+ int draw;
+} ImageSampleInfo;
+
+static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
+{
+ Scene *scene = CTX_data_scene(C);
+ ImageSampleInfo *info = arg_info;
+
+ if (info->draw) {
+ ED_image_draw_info(ar, (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT), info->channels,
+ info->x, info->y, info->col, info->colf, NULL, NULL);
+ }
+}
+
+static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
+{
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+ SpaceSeq *sseq = (SpaceSeq *) CTX_wm_space_data(C);
+ ARegion *ar = CTX_wm_region(C);
+ ImBuf *ibuf = sequencer_ibuf_get(bmain, scene, sseq, CFRA, 0);
+ ImageSampleInfo *info = op->customdata;
+ float fx, fy;
+
+ if (ibuf == NULL) {
+ IMB_freeImBuf(ibuf);
+ info->draw = 0;
+ return;
+ }
+
+ UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
+
+ fx += (float) ibuf->x / 2.0f;
+ fy += (float) ibuf->y / 2.0f;
+
+ if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) {
+ float *fp;
+ unsigned char *cp;
+ int x = (int) fx, y = (int) fy;
+
+ info->x = x;
+ info->y = y;
+ info->draw = 1;
+ info->channels = ibuf->channels;
+
+ info->colp = NULL;
+ info->colfp = NULL;
+
+ if (ibuf->rect) {
+ cp = (unsigned char *)(ibuf->rect + y * ibuf->x + x);
+
+ info->col[0] = cp[0];
+ info->col[1] = cp[1];
+ info->col[2] = cp[2];
+ info->col[3] = cp[3];
+ info->colp = info->col;
+
+ info->colf[0] = (float)cp[0] / 255.0f;
+ info->colf[1] = (float)cp[1] / 255.0f;
+ info->colf[2] = (float)cp[2] / 255.0f;
+ info->colf[3] = (float)cp[3] / 255.0f;
+ info->colfp = info->colf;
+ }
+ if (ibuf->rect_float) {
+ fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x));
+
+ info->colf[0] = fp[0];
+ info->colf[1] = fp[1];
+ info->colf[2] = fp[2];
+ info->colf[3] = fp[3];
+ info->colfp = info->colf;
+ }
+ }
+ else {
+ info->draw = 0;
+ }
+
+ IMB_freeImBuf(ibuf);
+ ED_area_tag_redraw(CTX_wm_area(C));
+}
+
+static void sample_exit(bContext *C, wmOperator *op)
+{
+ ImageSampleInfo *info = op->customdata;
+
+ ED_region_draw_cb_exit(info->art, info->draw_handle);
+ ED_area_tag_redraw(CTX_wm_area(C));
+ MEM_freeN(info);
+}
+
+static int sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ ARegion *ar = CTX_wm_region(C);
+ ImageSampleInfo *info;
+
+ info = MEM_callocN(sizeof(ImageSampleInfo), "ImageSampleInfo");
+ info->art = ar->type;
+ info->draw_handle = ED_region_draw_cb_activate(ar->type, sample_draw, info, REGION_DRAW_POST_PIXEL);
+ op->customdata = info;
+
+ sample_apply(C, op, event);
+
+ WM_event_add_modal_handler(C, op);
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int sample_modal(bContext *C, wmOperator *op, wmEvent *event)
+{
+ switch (event->type) {
+ case LEFTMOUSE:
+ case RIGHTMOUSE: /* XXX hardcoded */
+ sample_exit(C, op);
+ return OPERATOR_CANCELLED;
+ case MOUSEMOVE:
+ sample_apply(C, op, event);
+ break;
+ }
+
+ return OPERATOR_RUNNING_MODAL;
+}
+
+static int sample_cancel(bContext *C, wmOperator *op)
+{
+ sample_exit(C, op);
+
+ return OPERATOR_CANCELLED;
+}
+
+int sample_poll(bContext *C)
+{
+ return BKE_sequencer_editing_get(CTX_data_scene(C), FALSE) != NULL;
+}
+
+void SEQUENCER_OT_sample(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Sample Color";
+ ot->idname = "SEQUENCER_OT_sample";
+ ot->description = "Use mouse to sample color in current frame";
+
+ /* api callbacks */
+ ot->invoke = sample_invoke;
+ ot->modal = sample_modal;
+ ot->cancel = sample_cancel;
+ ot->poll = sample_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_BLOCKING;
+}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index e74bda87a43..5169d823bd8 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -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;
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index 561e97a8393..855771b17a2 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -489,7 +489,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
else if (event->type == NDOF_MOTION) {
/* do these automagically get delivered? yes. */
// puts("ndof motion detected in fly mode!");
- // static const char* tag_name = "3D mouse position";
+ // static const char *tag_name = "3D mouse position";
wmNDOFMotionData *incoming_ndof = (wmNDOFMotionData *)event->customdata;
switch (incoming_ndof->progress) {
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 8eba8ebea41..7f77341447d 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -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;
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 738e61dbe6e..a04affd4891 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -506,5 +506,9 @@ void IMB_processor_apply_threaded(int buffer_lines, int handle_size, void *init_
void *customdata),
void *(do_thread) (void *));
+/* ffmpeg */
+void IMB_ffmpeg_init(void);
+const char *IMB_ffmpeg_last_error(void);
+
#endif
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index e206541b135..a6f38516a14 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -63,16 +63,16 @@ typedef enum ThumbSource {
// IB_metadata
/* create thumbnail for file and returns new imbuf for thumbnail */
-ImBuf *IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
+ImBuf *IMB_thumb_create(const char *path, ThumbSize size, ThumbSource source, ImBuf *ibuf);
/* read thumbnail for file and returns new imbuf for thumbnail */
-ImBuf *IMB_thumb_read(const char* path, ThumbSize size);
+ImBuf *IMB_thumb_read(const char *path, ThumbSize size);
/* delete all thumbs for the file */
-void IMB_thumb_delete(const char* path, ThumbSize size);
+void IMB_thumb_delete(const char *path, ThumbSize size);
/* return the state of the thumb, needed to determine how to manage the thumb */
-ImBuf *IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source);
+ImBuf *IMB_thumb_manage(const char *path, ThumbSize size, ThumbSource source);
/* create the necessary dirs to store the thumbnails */
void IMB_thumb_makedirs(void);
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index f07a18cb89c..9092d59c351 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -439,8 +439,6 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
#ifdef WITH_FFMPEG
-extern void do_init_ffmpeg(void);
-
static int startffmpeg(struct anim *anim)
{
int i, videoStream;
@@ -463,8 +461,6 @@ static int startffmpeg(struct anim *anim)
streamcount = anim->streamindex;
- do_init_ffmpeg();
-
if (avformat_open_input(&pFormatCtx, anim->name, NULL, NULL) != 0) {
return -1;
}
diff --git a/source/blender/imbuf/intern/imbuf_cocoa.m b/source/blender/imbuf/intern/imbuf_cocoa.m
index ebfee7a1a30..10381e9d1c3 100644
--- a/source/blender/imbuf/intern/imbuf_cocoa.m
+++ b/source/blender/imbuf/intern/imbuf_cocoa.m
@@ -92,9 +92,8 @@ struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, int size, int flags)
/* allocate the image buffer */
ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0);
if (!ibuf) {
- fprintf(stderr,
- "imb_cocoaLoadImage: could not allocate memory for the " \
- "image.\n");
+ fprintf(stderr,
+ "imb_cocoaLoadImage: could not allocate memory for the image.\n");
[bitmapImage release];
[pool drain];
return NULL;
@@ -243,8 +242,8 @@ short imb_cocoaSaveImage(struct ImBuf *ibuf, char *name, int flags)
break;
default:
fprintf(stderr,
- "imb_cocoaSaveImage: unsupported number of bytes per "
- "pixel: %d\n", samplesperpixel);
+ "imb_cocoaSaveImage: unsupported number of bytes per "
+ "pixel: %d\n", samplesperpixel);
return (0);
}
@@ -257,16 +256,16 @@ short imb_cocoaSaveImage(struct ImBuf *ibuf, char *name, int flags)
/* Create bitmap image rep in blender format */
blBitmapFormatImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
- pixelsWide:ibuf->x
- pixelsHigh:ibuf->y
- bitsPerSample:bitspersample samplesPerPixel:samplesperpixel hasAlpha:hasAlpha isPlanar:NO
- colorSpaceName:colorSpace
- bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
- bytesPerRow:(ibuf->x*bitspersample*samplesperpixel/8)
- bitsPerPixel:(bitspersample*samplesperpixel)];
+ pixelsWide:ibuf->x
+ pixelsHigh:ibuf->y
+ bitsPerSample:bitspersample samplesPerPixel:samplesperpixel hasAlpha:hasAlpha isPlanar:NO
+ colorSpaceName:colorSpace
+ bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
+ bytesPerRow:(ibuf->x*bitspersample*samplesperpixel/8)
+ bitsPerPixel:(bitspersample*samplesperpixel)];
if (!blBitmapFormatImage) {
- [pool drain];
- return FALSE;
+ [pool drain];
+ return FALSE;
}
/* setup pointers */
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 34afdda0177..26aab29b8dd 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -153,7 +153,7 @@ void Mem_IStream::clear()
/* File Input Stream */
-class IFileStream : public IStream
+class IFileStream : public Imf::IStream
{
public:
IFileStream(const char *filename)
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index 2b0597d64a5..9ec22f0798e 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -43,6 +43,8 @@
#include "BLI_path_util.h"
#include "BLI_fileops.h"
+#include "BLI_utildefines.h"
+#include "BLI_string.h"
#include "DNA_userdef_types.h"
#include "BKE_global.h"
@@ -220,6 +222,8 @@ static int isqtime(const char *name)
#ifdef WITH_FFMPEG
+static char ffmpeg_last_error[1024];
+
void silence_log_ffmpeg(int quiet)
{
if (quiet) {
@@ -230,21 +234,40 @@ void silence_log_ffmpeg(int quiet)
}
}
-extern void do_init_ffmpeg(void);
-void do_init_ffmpeg(void)
+void ffmpeg_log_callback(void *ptr, int level, const char *format, va_list arg)
{
- static int ffmpeg_init = 0;
- if (!ffmpeg_init) {
- ffmpeg_init = 1;
- av_register_all();
- avdevice_register_all();
- if ((G.debug & G_DEBUG_FFMPEG) == 0) {
- silence_log_ffmpeg(1);
- }
- else {
- silence_log_ffmpeg(0);
- }
+ if (ELEM(level, AV_LOG_FATAL, AV_LOG_ERROR)) {
+ size_t n = BLI_vsnprintf(ffmpeg_last_error, sizeof(ffmpeg_last_error), format, arg);
+
+ /* strip trailing \n */
+ ffmpeg_last_error[n - 1] = '\0';
}
+
+ /* call default logger to print all message to console */
+ av_log_default_callback(ptr, level, format, arg);
+}
+
+void IMB_ffmpeg_init(void)
+{
+ av_register_all();
+ avdevice_register_all();
+
+ if ((G.debug & G_DEBUG_FFMPEG) == 0) {
+ silence_log_ffmpeg(1);
+ }
+ else {
+ silence_log_ffmpeg(0);
+ }
+
+ ffmpeg_last_error[0] = '\0';
+
+ /* set own callback which could store last error to report to UI */
+ av_log_set_callback(ffmpeg_log_callback);
+}
+
+const char *IMB_ffmpeg_last_error(void)
+{
+ return ffmpeg_last_error;
}
static int isffmpeg(const char *filename)
@@ -255,8 +278,6 @@ static int isffmpeg(const char *filename)
AVCodec *pCodec;
AVCodecContext *pCodecCtx;
- do_init_ffmpeg();
-
if (BLI_testextensie(filename, ".swf") ||
BLI_testextensie(filename, ".jpg") ||
BLI_testextensie(filename, ".png") ||
diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h
index 6c7f7aa2471..bf388d8c018 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -82,13 +82,14 @@ typedef struct MaskSplinePoint {
typedef struct MaskSpline {
struct MaskSpline *next, *prev;
- int flag; /* defferent spline flag (closed, ...) */
+ short flag; /* defferent spline flag (closed, ...) */
+ char offset_mode; /* feather offset method */
+ char weight_interp; /* weight interpolation */
+
int tot_point; /* total number of points */
MaskSplinePoint *points; /* points which defines spline itself */
MaskParent parent; /* parenting information of the whole spline */
- int weight_interp, pad; /* weight interpolation */
-
MaskSplinePoint *points_deform; /* deformed copy of 'points' BezTriple data - not saved */
} MaskSpline;
@@ -146,8 +147,17 @@ enum {
};
/* MaskSpline->weight_interp */
-#define MASK_SPLINE_INTERP_LINEAR 1
-#define MASK_SPLINE_INTERP_EASE 2
+enum {
+ MASK_SPLINE_INTERP_LINEAR = 1,
+ MASK_SPLINE_INTERP_EASE = 2
+};
+
+/* MaskSpline->offset_mode */
+enum {
+ MASK_SPLINE_OFFSET_EVEN = 0,
+ MASK_SPLINE_OFFSET_SMOOTH = 1
+};
+
/* ob->restrictflag */
#define MASK_RESTRICT_VIEW 1
diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c
index a6571a2db4f..719baed8edb 100644
--- a/source/blender/makesrna/intern/rna_mask.c
+++ b/source/blender/makesrna/intern/rna_mask.c
@@ -540,6 +540,12 @@ static void rna_def_maskSpline(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem spline_offset_mode_items[] = {
+ {MASK_SPLINE_OFFSET_EVEN, "EVEN", 0, "Even", "Calculate even feather offset"},
+ {MASK_SPLINE_OFFSET_SMOOTH, "SMOOTH", 0, "Smooth", "Calculate feather offset as a second curve"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
StructRNA *srna;
PropertyRNA *prop;
@@ -548,6 +554,13 @@ static void rna_def_maskSpline(BlenderRNA *brna)
srna = RNA_def_struct(brna, "MaskSpline", NULL);
RNA_def_struct_ui_text(srna, "Mask spline", "Single spline used for defining mask shape");
+ /* offset mode */
+ prop = RNA_def_property(srna, "offset_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "offset_mode");
+ RNA_def_property_enum_items(prop, spline_offset_mode_items);
+ RNA_def_property_ui_text(prop, "Feather Offset", "The method used for calculating the feather offset");
+ RNA_def_property_update(prop, 0, "rna_Mask_update_data");
+
/* weight interpolation */
prop = RNA_def_property(srna, "weight_interpolation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "weight_interp");
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index a6f3c0095b5..597c2294ade 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2995,7 +2995,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
{CODEC_ID_FLV1, "FLASH", 0, "Flash Video", ""},
{CODEC_ID_FFV1, "FFV1", 0, "FFmpeg video codec #1", ""},
{CODEC_ID_QTRLE, "QTRLE", 0, "QTRLE", ""},
- /* {CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""}, */ /* disabled for after release */
+ {CODEC_ID_DNXHD, "DNXHD", 0, "DNxHD", ""},
{0, NULL, 0, NULL, NULL}
};
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 0898ba5608f..172a79970b5 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -910,7 +910,7 @@ static void rna_def_trackingMarkers(BlenderRNA *brna, PropertyRNA *cprop)
"Frame number to find marker for", MINFRAME, MAXFRAME);
RNA_def_property_flag(parm, PROP_REQUIRED);
parm = RNA_def_boolean(func, "exact", TRUE, "Exact",
- "Get marker at exact frame number rather than get estimated marker");
+ "Get marker at exact frame number rather than get estimated marker");
parm = RNA_def_pointer(func, "marker", "MovieTrackingMarker", "", "Marker for specified frame");
RNA_def_function_return(func, parm);
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c
index 4a6d5ceb10f..988d15e8df4 100644
--- a/source/blender/modifiers/intern/MOD_displace.c
+++ b/source/blender/modifiers/intern/MOD_displace.c
@@ -185,7 +185,7 @@ static void displaceModifier_do(
if (dmd->texture) {
tex_co = MEM_callocN(sizeof(*tex_co) * numVerts,
- "displaceModifier_do tex_co");
+ "displaceModifier_do tex_co");
get_texture_coords((MappingInfoModifierData *)dmd, ob, dm, vertexCos, tex_co, numVerts);
modifier_init_texture(dmd->modifier.scene, dmd->texture);
diff --git a/source/blender/nodes/composite/nodes/node_composite_despeckle.c b/source/blender/nodes/composite/nodes/node_composite_despeckle.c
new file mode 100644
index 00000000000..21b703dc9a8
--- /dev/null
+++ b/source/blender/nodes/composite/nodes/node_composite_despeckle.c
@@ -0,0 +1,73 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2006 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/nodes/composite/nodes/node_composite_despeckle.c
+ * \ingroup cmpnodes
+ */
+
+#include "node_composite_util.h"
+
+/* **************** FILTER ******************** */
+static bNodeSocketTemplate cmp_node_despeckle_in[]= {
+ { SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
+ { SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
+ { -1, 0, "" }
+};
+static bNodeSocketTemplate cmp_node_despeckle_out[]= {
+ { SOCK_RGBA, 0, N_("Image")},
+ { -1, 0, "" }
+};
+
+#ifdef WITH_COMPOSITOR_LEGACY
+
+static void node_composit_exec_despeckle(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
+{
+ /* pass */
+}
+
+#endif /* WITH_COMPOSITOR_LEGACY */
+
+static void node_composit_init_despeckle(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
+{
+ node->custom3 = 0.5f;
+ node->custom4 = 0.5f;
+}
+
+void register_node_type_cmp_despeckle(bNodeTreeType *ttype)
+{
+ static bNodeType ntype;
+
+ node_type_base(ttype, &ntype, CMP_NODE_DESPECKLE, "Despeckle", NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS);
+ node_type_socket_templates(&ntype, cmp_node_despeckle_in, cmp_node_despeckle_out);
+ node_type_size(&ntype, 80, 40, 120);
+ node_type_init(&ntype, node_composit_init_despeckle);
+#ifdef WITH_COMPOSITOR_LEGACY
+ node_type_exec(&ntype, node_composit_exec_despeckle);
+#endif
+
+ nodeRegisterType(ttype, &ntype);
+}
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c
index f3e5b300ced..e02efc79da0 100644
--- a/source/blender/python/bmesh/bmesh_py_api.c
+++ b/source/blender/python/bmesh/bmesh_py_api.c
@@ -97,9 +97,9 @@ static PyObject *bpy_bm_from_edit_mesh(PyObject *UNUSED(self), PyObject *value)
}
static struct PyMethodDef BPy_BM_methods[] = {
- {"new", (PyCFunction)bpy_bm_new, METH_NOARGS, bpy_bm_new_doc},
- {"from_edit_mesh", (PyCFunction)bpy_bm_from_edit_mesh, METH_O, bpy_bm_from_edit_mesh_doc},
- {NULL, NULL, 0, NULL}
+ {"new", (PyCFunction)bpy_bm_new, METH_NOARGS, bpy_bm_new_doc},
+ {"from_edit_mesh", (PyCFunction)bpy_bm_from_edit_mesh, METH_O, bpy_bm_from_edit_mesh_doc},
+ {NULL, NULL, 0, NULL}
};
PyDoc_STRVAR(BPy_BM_doc,
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index 8e7c4810b08..c16b1fb901f 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -420,7 +420,7 @@ static PyObject *bpy_bmesh_fmod_getattro(PyObject *UNUSED(self), PyObject *pynam
}
PyErr_Format(PyExc_AttributeError,
- "BMeshOpsModule: operator \"%.200s\" doesn't exist",
+ "BMeshOpsModule: operator \"%.200s\" doesn't exist",
name);
return NULL;
}
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 24e7cd575ed..d7d9baf35ed 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -55,34 +55,34 @@
/* scene does not use BM_* flags. */
PyC_FlagSet bpy_bm_scene_vert_edge_face_flags[] = {
- {1, "VERT"},
- {2, "EDGE"},
- {4, "FACE"},
- {0, NULL}
+ {1, "VERT"},
+ {2, "EDGE"},
+ {4, "FACE"},
+ {0, NULL}
};
PyC_FlagSet bpy_bm_htype_vert_edge_face_flags[] = {
- {BM_VERT, "VERT"},
- {BM_EDGE, "EDGE"},
- {BM_FACE, "FACE"},
- {0, NULL}
+ {BM_VERT, "VERT"},
+ {BM_EDGE, "EDGE"},
+ {BM_FACE, "FACE"},
+ {0, NULL}
};
PyC_FlagSet bpy_bm_htype_all_flags[] = {
- {BM_VERT, "VERT"},
- {BM_LOOP, "EDGE"},
- {BM_FACE, "FACE"},
- {BM_LOOP, "LOOP"},
- {0, NULL}
+ {BM_VERT, "VERT"},
+ {BM_LOOP, "EDGE"},
+ {BM_FACE, "FACE"},
+ {BM_LOOP, "LOOP"},
+ {0, NULL}
};
PyC_FlagSet bpy_bm_hflag_all_flags[] = {
- {BM_ELEM_SELECT, "SELECT"},
- {BM_ELEM_HIDDEN, "HIDE"},
- {BM_ELEM_SEAM, "SEAM"},
- {BM_ELEM_SMOOTH, "SMOOTH"},
- {BM_ELEM_TAG, "TAG"},
- {0, NULL}
+ {BM_ELEM_SELECT, "SELECT"},
+ {BM_ELEM_HIDDEN, "HIDE"},
+ {BM_ELEM_SEAM, "SEAM"},
+ {BM_ELEM_SMOOTH, "SMOOTH"},
+ {BM_ELEM_TAG, "TAG"},
+ {0, NULL}
};
/* py-type definitions
@@ -556,131 +556,131 @@ static PyObject *bpy_bmelemseq_layers_get(BPy_BMElemSeq *self, void *htype)
}
static PyGetSetDef bpy_bmesh_getseters[] = {
- {(char *)"verts", (getter)bpy_bmvertseq_get, (setter)NULL, (char *)bpy_bmvertseq_doc, NULL},
- {(char *)"edges", (getter)bpy_bmedgeseq_get, (setter)NULL, (char *)bpy_bmedgeseq_doc, NULL},
- {(char *)"faces", (getter)bpy_bmfaceseq_get, (setter)NULL, (char *)bpy_bmfaceseq_doc, NULL},
- {(char *)"loops", (getter)bpy_bmloopseq_get, (setter)NULL, (char *)bpy_bmloopseq_doc, NULL},
- {(char *)"select_mode", (getter)bpy_bmesh_select_mode_get, (setter)bpy_bmesh_select_mode_set, (char *)bpy_bmesh_select_mode_doc, NULL},
+ {(char *)"verts", (getter)bpy_bmvertseq_get, (setter)NULL, (char *)bpy_bmvertseq_doc, NULL},
+ {(char *)"edges", (getter)bpy_bmedgeseq_get, (setter)NULL, (char *)bpy_bmedgeseq_doc, NULL},
+ {(char *)"faces", (getter)bpy_bmfaceseq_get, (setter)NULL, (char *)bpy_bmfaceseq_doc, NULL},
+ {(char *)"loops", (getter)bpy_bmloopseq_get, (setter)NULL, (char *)bpy_bmloopseq_doc, NULL},
+ {(char *)"select_mode", (getter)bpy_bmesh_select_mode_get, (setter)bpy_bmesh_select_mode_set, (char *)bpy_bmesh_select_mode_doc, NULL},
- {(char *)"select_history", (getter)bpy_bmesh_select_history_get, (setter)bpy_bmesh_select_history_set, (char *)bpy_bmesh_select_history_doc, NULL},
+ {(char *)"select_history", (getter)bpy_bmesh_select_history_get, (setter)bpy_bmesh_select_history_set, (char *)bpy_bmesh_select_history_doc, NULL},
- /* readonly checks */
- {(char *)"is_wrapped", (getter)bpy_bmesh_is_wrapped_get, (setter)NULL, (char *)bpy_bmesh_is_wrapped_doc, NULL}, /* as with mathutils */
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+ /* readonly checks */
+ {(char *)"is_wrapped", (getter)bpy_bmesh_is_wrapped_get, (setter)NULL, (char *)bpy_bmesh_is_wrapped_doc, NULL}, /* as with mathutils */
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmvert_getseters[] = {
- /* generic */
- {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
- {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
- {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
- {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
-
- {(char *)"co", (getter)bpy_bmvert_co_get, (setter)bpy_bmvert_co_set, (char *)bpy_bmvert_co_doc, NULL},
- {(char *)"normal", (getter)bpy_bmvert_normal_get, (setter)bpy_bmvert_normal_set, (char *)bpy_bmvert_normal_doc, NULL},
-
- /* connectivity data */
- {(char *)"link_edges", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_edges_doc, (void *)BM_EDGES_OF_VERT},
- {(char *)"link_faces", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_faces_doc, (void *)BM_FACES_OF_VERT},
- {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_loops_doc, (void *)BM_LOOPS_OF_VERT},
-
- /* readonly checks */
- {(char *)"is_manifold", (getter)bpy_bmvert_is_manifold_get, (setter)NULL, (char *)bpy_bmvert_is_manifold_doc, NULL},
- {(char *)"is_wire", (getter)bpy_bmvert_is_wire_get, (setter)NULL, (char *)bpy_bmvert_is_wire_doc, NULL},
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
-
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ /* generic */
+ {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
+ {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
+ {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
+ {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
+
+ {(char *)"co", (getter)bpy_bmvert_co_get, (setter)bpy_bmvert_co_set, (char *)bpy_bmvert_co_doc, NULL},
+ {(char *)"normal", (getter)bpy_bmvert_normal_get, (setter)bpy_bmvert_normal_set, (char *)bpy_bmvert_normal_doc, NULL},
+
+ /* connectivity data */
+ {(char *)"link_edges", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_edges_doc, (void *)BM_EDGES_OF_VERT},
+ {(char *)"link_faces", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_faces_doc, (void *)BM_FACES_OF_VERT},
+ {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmvert_link_loops_doc, (void *)BM_LOOPS_OF_VERT},
+
+ /* readonly checks */
+ {(char *)"is_manifold", (getter)bpy_bmvert_is_manifold_get, (setter)NULL, (char *)bpy_bmvert_is_manifold_doc, NULL},
+ {(char *)"is_wire", (getter)bpy_bmvert_is_wire_get, (setter)NULL, (char *)bpy_bmvert_is_wire_doc, NULL},
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmedge_getseters[] = {
- /* generic */
- {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
- {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
- {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
- {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
+ /* generic */
+ {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
+ {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
+ {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
+ {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
- {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH},
- {(char *)"seam", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_seam_doc, (void *)BM_ELEM_SEAM},
+ {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH},
+ {(char *)"seam", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_seam_doc, (void *)BM_ELEM_SEAM},
- /* connectivity data */
- {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_verts_doc, (void *)BM_VERTS_OF_EDGE},
+ /* connectivity data */
+ {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_verts_doc, (void *)BM_VERTS_OF_EDGE},
- {(char *)"link_faces", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_link_faces_doc, (void *)BM_FACES_OF_EDGE},
- {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_link_loops_doc, (void *)BM_LOOPS_OF_EDGE},
+ {(char *)"link_faces", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_link_faces_doc, (void *)BM_FACES_OF_EDGE},
+ {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmedge_link_loops_doc, (void *)BM_LOOPS_OF_EDGE},
- /* readonly checks */
- {(char *)"is_manifold", (getter)bpy_bmedge_is_manifold_get, (setter)NULL, (char *)bpy_bmedge_is_manifold_doc, NULL},
- {(char *)"is_wire", (getter)bpy_bmedge_is_wire_get, (setter)NULL, (char *)bpy_bmedge_is_wire_doc, NULL},
- {(char *)"is_boundary", (getter)bpy_bmedge_is_boundary_get, (setter)NULL, (char *)bpy_bmedge_is_boundary_doc, NULL},
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+ /* readonly checks */
+ {(char *)"is_manifold", (getter)bpy_bmedge_is_manifold_get, (setter)NULL, (char *)bpy_bmedge_is_manifold_doc, NULL},
+ {(char *)"is_wire", (getter)bpy_bmedge_is_wire_get, (setter)NULL, (char *)bpy_bmedge_is_wire_doc, NULL},
+ {(char *)"is_boundary", (getter)bpy_bmedge_is_boundary_get, (setter)NULL, (char *)bpy_bmedge_is_boundary_doc, NULL},
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmface_getseters[] = {
- /* generic */
- {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
- {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
- {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
- {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
+ /* generic */
+ {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
+ {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
+ {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
+ {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
- {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH},
+ {(char *)"smooth", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_smooth_doc, (void *)BM_ELEM_SMOOTH},
- {(char *)"normal", (getter)bpy_bmface_normal_get, (setter)bpy_bmface_normal_set, (char *)bpy_bmface_normal_doc, NULL},
+ {(char *)"normal", (getter)bpy_bmface_normal_get, (setter)bpy_bmface_normal_set, (char *)bpy_bmface_normal_doc, NULL},
- {(char *)"material_index", (getter)bpy_bmface_material_index_get, (setter)bpy_bmface_material_index_set, (char *)bpy_bmface_material_index_doc, NULL},
+ {(char *)"material_index", (getter)bpy_bmface_material_index_get, (setter)bpy_bmface_material_index_set, (char *)bpy_bmface_material_index_doc, NULL},
- /* connectivity data */
- {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_verts_doc, (void *)BM_VERTS_OF_FACE},
- {(char *)"edges", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_edges_doc, (void *)BM_EDGES_OF_FACE},
- {(char *)"loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_loops_doc, (void *)BM_LOOPS_OF_FACE},
+ /* connectivity data */
+ {(char *)"verts", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_verts_doc, (void *)BM_VERTS_OF_FACE},
+ {(char *)"edges", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_edges_doc, (void *)BM_EDGES_OF_FACE},
+ {(char *)"loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmface_loops_doc, (void *)BM_LOOPS_OF_FACE},
- /* readonly checks */
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+ /* readonly checks */
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmloop_getseters[] = {
- /* generic */
- // flags are available but not used for loops.
- // {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
- // {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
- {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
- {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
-
- {(char *)"vert", (getter)bpy_bmloop_vert_get, (setter)NULL, (char *)bpy_bmloop_vert_doc, NULL},
- {(char *)"edge", (getter)bpy_bmloop_edge_get, (setter)NULL, (char *)bpy_bmloop_edge_doc, NULL},
- {(char *)"face", (getter)bpy_bmloop_face_get, (setter)NULL, (char *)bpy_bmloop_face_doc, NULL},
-
- /* connectivity data */
- {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmloops_link_loops_doc, (void *)BM_LOOPS_OF_LOOP},
- {(char *)"link_loop_next", (getter)bpy_bmloop_link_loop_next_get, (setter)NULL, (char *)bpy_bmloop_link_loop_next_doc, NULL},
- {(char *)"link_loop_prev", (getter)bpy_bmloop_link_loop_prev_get, (setter)NULL, (char *)bpy_bmloop_link_loop_prev_doc, NULL},
-
- /* readonly checks */
- {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
-
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ /* generic */
+ // flags are available but not used for loops.
+ // {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
+ // {(char *)"hide", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc, (void *)BM_ELEM_HIDDEN},
+ {(char *)"tag", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_tag_doc, (void *)BM_ELEM_TAG},
+ {(char *)"index", (getter)bpy_bm_elem_index_get, (setter)bpy_bm_elem_index_set, (char *)bpy_bm_elem_index_doc, NULL},
+
+ {(char *)"vert", (getter)bpy_bmloop_vert_get, (setter)NULL, (char *)bpy_bmloop_vert_doc, NULL},
+ {(char *)"edge", (getter)bpy_bmloop_edge_get, (setter)NULL, (char *)bpy_bmloop_edge_doc, NULL},
+ {(char *)"face", (getter)bpy_bmloop_face_get, (setter)NULL, (char *)bpy_bmloop_face_doc, NULL},
+
+ /* connectivity data */
+ {(char *)"link_loops", (getter)bpy_bmelemseq_elem_get, (setter)NULL, (char *)bpy_bmloops_link_loops_doc, (void *)BM_LOOPS_OF_LOOP},
+ {(char *)"link_loop_next", (getter)bpy_bmloop_link_loop_next_get, (setter)NULL, (char *)bpy_bmloop_link_loop_next_doc, NULL},
+ {(char *)"link_loop_prev", (getter)bpy_bmloop_link_loop_prev_get, (setter)NULL, (char *)bpy_bmloop_link_loop_prev_doc, NULL},
+
+ /* readonly checks */
+ {(char *)"is_valid", (getter)bpy_bm_is_valid_get, (setter)NULL, (char *)bpy_bm_is_valid_doc, NULL},
+
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmvertseq_getseters[] = {
- {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_VERT},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_VERT},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmedgeseq_getseters[] = {
- {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_EDGE},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_EDGE},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmfaceseq_getseters[] = {
- {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_FACE},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_FACE},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmloopseq_getseters[] = {
- {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_LOOP},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {(char *)"layers", (getter)bpy_bmelemseq_layers_get, (setter)NULL, (char *)bpy_bmelemseq_layers_doc, (void *)BM_LOOP},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -2166,7 +2166,7 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
if (keyfunc != NULL && !PyCallable_Check(keyfunc)) {
PyErr_SetString(PyExc_TypeError,
- "the 'key' argument is not a callable object");
+ "the 'key' argument is not a callable object");
return NULL;
}
@@ -2280,129 +2280,129 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec
}
static struct PyMethodDef bpy_bmesh_methods[] = {
- /* utility */
- {"copy", (PyCFunction)bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
- {"clear", (PyCFunction)bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
- {"free", (PyCFunction)bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
-
- /* conversion */
- {"from_object", (PyCFunction)bpy_bmesh_from_object, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_object_doc},
- {"from_mesh", (PyCFunction)bpy_bmesh_from_mesh, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_mesh_doc},
- {"to_mesh", (PyCFunction)bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
-
- /* meshdata */
- {"select_flush_mode", (PyCFunction)bpy_bmesh_select_flush_mode, METH_NOARGS, bpy_bmesh_select_flush_mode_doc},
- {"select_flush", (PyCFunction)bpy_bmesh_select_flush, METH_O, bpy_bmesh_select_flush_doc},
- {"normal_update", (PyCFunction)bpy_bmesh_normal_update, METH_VARARGS, bpy_bmesh_normal_update_doc},
- {"transform", (PyCFunction)bpy_bmesh_transform, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_transform_doc},
- {NULL, NULL, 0, NULL}
+ /* utility */
+ {"copy", (PyCFunction)bpy_bmesh_copy, METH_NOARGS, bpy_bmesh_copy_doc},
+ {"clear", (PyCFunction)bpy_bmesh_clear, METH_NOARGS, bpy_bmesh_clear_doc},
+ {"free", (PyCFunction)bpy_bmesh_free, METH_NOARGS, bpy_bmesh_free_doc},
+
+ /* conversion */
+ {"from_object", (PyCFunction)bpy_bmesh_from_object, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_object_doc},
+ {"from_mesh", (PyCFunction)bpy_bmesh_from_mesh, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_from_mesh_doc},
+ {"to_mesh", (PyCFunction)bpy_bmesh_to_mesh, METH_VARARGS, bpy_bmesh_to_mesh_doc},
+
+ /* meshdata */
+ {"select_flush_mode", (PyCFunction)bpy_bmesh_select_flush_mode, METH_NOARGS, bpy_bmesh_select_flush_mode_doc},
+ {"select_flush", (PyCFunction)bpy_bmesh_select_flush, METH_O, bpy_bmesh_select_flush_doc},
+ {"normal_update", (PyCFunction)bpy_bmesh_normal_update, METH_VARARGS, bpy_bmesh_normal_update_doc},
+ {"transform", (PyCFunction)bpy_bmesh_transform, METH_VARARGS | METH_KEYWORDS, bpy_bmesh_transform_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmvert_methods[] = {
- {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
- {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
- {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
- {"copy_from_face_interp", (PyCFunction)bpy_bmvert_copy_from_face_interp, METH_VARARGS, bpy_bmvert_copy_from_face_interp_doc},
- {"copy_from_vert_interp", (PyCFunction)bpy_bmvert_copy_from_vert_interp, METH_VARARGS, bpy_bmvert_copy_from_vert_interp_doc},
+ {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
+ {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
+ {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
+ {"copy_from_face_interp", (PyCFunction)bpy_bmvert_copy_from_face_interp, METH_VARARGS, bpy_bmvert_copy_from_face_interp_doc},
+ {"copy_from_vert_interp", (PyCFunction)bpy_bmvert_copy_from_vert_interp, METH_VARARGS, bpy_bmvert_copy_from_vert_interp_doc},
- {"calc_vert_angle", (PyCFunction)bpy_bmvert_calc_edge_angle, METH_NOARGS, bpy_bmvert_calc_edge_angle_doc},
- {"calc_shell_factor", (PyCFunction)bpy_bmvert_calc_shell_factor, METH_NOARGS, bpy_bmvert_calc_shell_factor_doc},
+ {"calc_vert_angle", (PyCFunction)bpy_bmvert_calc_edge_angle, METH_NOARGS, bpy_bmvert_calc_edge_angle_doc},
+ {"calc_shell_factor", (PyCFunction)bpy_bmvert_calc_shell_factor, METH_NOARGS, bpy_bmvert_calc_shell_factor_doc},
- {"normal_update", (PyCFunction)bpy_bmvert_normal_update, METH_NOARGS, bpy_bmvert_normal_update_doc},
+ {"normal_update", (PyCFunction)bpy_bmvert_normal_update, METH_NOARGS, bpy_bmvert_normal_update_doc},
- {NULL, NULL, 0, NULL}
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmedge_methods[] = {
- {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
- {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
- {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
+ {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
+ {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
+ {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
- {"other_vert", (PyCFunction)bpy_bmedge_other_vert, METH_O, bpy_bmedge_other_vert_doc},
+ {"other_vert", (PyCFunction)bpy_bmedge_other_vert, METH_O, bpy_bmedge_other_vert_doc},
- {"calc_length", (PyCFunction)bpy_bmedge_calc_length, METH_NOARGS, bpy_bmedge_calc_length_doc},
- {"calc_face_angle", (PyCFunction)bpy_bmedge_calc_face_angle, METH_NOARGS, bpy_bmedge_calc_face_angle_doc},
- {"calc_tangent", (PyCFunction)bpy_bmedge_calc_tangent, METH_VARARGS, bpy_bmedge_calc_tangent_doc},
+ {"calc_length", (PyCFunction)bpy_bmedge_calc_length, METH_NOARGS, bpy_bmedge_calc_length_doc},
+ {"calc_face_angle", (PyCFunction)bpy_bmedge_calc_face_angle, METH_NOARGS, bpy_bmedge_calc_face_angle_doc},
+ {"calc_tangent", (PyCFunction)bpy_bmedge_calc_tangent, METH_VARARGS, bpy_bmedge_calc_tangent_doc},
- {"normal_update", (PyCFunction)bpy_bmedge_normal_update, METH_NOARGS, bpy_bmedge_normal_update_doc},
+ {"normal_update", (PyCFunction)bpy_bmedge_normal_update, METH_NOARGS, bpy_bmedge_normal_update_doc},
- {NULL, NULL, 0, NULL}
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmface_methods[] = {
- {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
- {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
+ {"select_set", (PyCFunction)bpy_bm_elem_select_set, METH_O, bpy_bm_elem_select_set_doc},
+ {"hide_set", (PyCFunction)bpy_bm_elem_hide_set, METH_O, bpy_bm_elem_hide_set_doc},
- {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
- {"copy_from_face_interp", (PyCFunction)bpy_bmface_copy_from_face_interp, METH_O, bpy_bmface_copy_from_face_interp_doc},
+ {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
+ {"copy_from_face_interp", (PyCFunction)bpy_bmface_copy_from_face_interp, METH_O, bpy_bmface_copy_from_face_interp_doc},
- {"copy", (PyCFunction)bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
+ {"copy", (PyCFunction)bpy_bmface_copy, METH_VARARGS | METH_KEYWORDS, bpy_bmface_copy_doc},
- {"calc_area", (PyCFunction)bpy_bmface_calc_area, METH_NOARGS, bpy_bmface_calc_area_doc},
- {"calc_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc},
- {"calc_center_median", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc},
- {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc},
+ {"calc_area", (PyCFunction)bpy_bmface_calc_area, METH_NOARGS, bpy_bmface_calc_area_doc},
+ {"calc_perimeter", (PyCFunction)bpy_bmface_calc_perimeter, METH_NOARGS, bpy_bmface_calc_perimeter_doc},
+ {"calc_center_median", (PyCFunction)bpy_bmface_calc_center_mean, METH_NOARGS, bpy_bmface_calc_center_mean_doc},
+ {"calc_center_bounds", (PyCFunction)bpy_bmface_calc_center_bounds, METH_NOARGS, bpy_bmface_calc_center_bounds_doc},
- {"normal_update", (PyCFunction)bpy_bmface_normal_update, METH_NOARGS, bpy_bmface_normal_update_doc},
+ {"normal_update", (PyCFunction)bpy_bmface_normal_update, METH_NOARGS, bpy_bmface_normal_update_doc},
- {NULL, NULL, 0, NULL}
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmloop_methods[] = {
- {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
- {"copy_from_face_interp", (PyCFunction)bpy_bmloop_copy_from_face_interp, METH_O, bpy_bmloop_copy_from_face_interp_doc},
+ {"copy_from", (PyCFunction)bpy_bm_elem_copy_from, METH_O, bpy_bm_elem_copy_from_doc},
+ {"copy_from_face_interp", (PyCFunction)bpy_bmloop_copy_from_face_interp, METH_O, bpy_bmloop_copy_from_face_interp_doc},
- {"calc_angle", (PyCFunction)bpy_bmloop_calc_angle, METH_NOARGS, bpy_bmloop_calc_angle_doc},
- {"calc_normal", (PyCFunction)bpy_bmloop_calc_normal, METH_NOARGS, bpy_bmloop_calc_normal_doc},
- {"calc_tangent", (PyCFunction)bpy_bmloop_calc_tangent, METH_NOARGS, bpy_bmloop_calc_tangent_doc},
- {NULL, NULL, 0, NULL}
+ {"calc_angle", (PyCFunction)bpy_bmloop_calc_angle, METH_NOARGS, bpy_bmloop_calc_angle_doc},
+ {"calc_normal", (PyCFunction)bpy_bmloop_calc_normal, METH_NOARGS, bpy_bmloop_calc_normal_doc},
+ {"calc_tangent", (PyCFunction)bpy_bmloop_calc_tangent, METH_NOARGS, bpy_bmloop_calc_tangent_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmelemseq_methods[] = {
- /* odd function, initializes index values */
- {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
- {NULL, NULL, 0, NULL}
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmvertseq_methods[] = {
- {"new", (PyCFunction)bpy_bmvertseq_new, METH_VARARGS, bpy_bmvertseq_new_doc},
- {"remove", (PyCFunction)bpy_bmvertseq_remove, METH_O, bpy_bmvertseq_remove_doc},
+ {"new", (PyCFunction)bpy_bmvertseq_new, METH_VARARGS, bpy_bmvertseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmvertseq_remove, METH_O, bpy_bmvertseq_remove_doc},
- /* odd function, initializes index values */
- {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
- {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
- {NULL, NULL, 0, NULL}
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmedgeseq_methods[] = {
- {"new", (PyCFunction)bpy_bmedgeseq_new, METH_VARARGS, bpy_bmedgeseq_new_doc},
- {"remove", (PyCFunction)bpy_bmedgeseq_remove, METH_O, bpy_bmedgeseq_remove_doc},
- /* 'bpy_bmelemseq_get' for different purpose */
- {"get", (PyCFunction)bpy_bmedgeseq_get__method, METH_VARARGS, bpy_bmedgeseq_get__method_doc},
-
- /* odd function, initializes index values */
- {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
- {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
- {NULL, NULL, 0, NULL}
+ {"new", (PyCFunction)bpy_bmedgeseq_new, METH_VARARGS, bpy_bmedgeseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmedgeseq_remove, METH_O, bpy_bmedgeseq_remove_doc},
+ /* 'bpy_bmelemseq_get' for different purpose */
+ {"get", (PyCFunction)bpy_bmedgeseq_get__method, METH_VARARGS, bpy_bmedgeseq_get__method_doc},
+
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmfaceseq_methods[] = {
- {"new", (PyCFunction)bpy_bmfaceseq_new, METH_VARARGS, bpy_bmfaceseq_new_doc},
- {"remove", (PyCFunction)bpy_bmfaceseq_remove, METH_O, bpy_bmfaceseq_remove_doc},
- /* 'bpy_bmelemseq_get' for different purpose */
- {"get", (PyCFunction)bpy_bmfaceseq_get__method, METH_VARARGS, bpy_bmfaceseq_get__method_doc},
-
- /* odd function, initializes index values */
- {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
- {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
- {NULL, NULL, 0, NULL}
+ {"new", (PyCFunction)bpy_bmfaceseq_new, METH_VARARGS, bpy_bmfaceseq_new_doc},
+ {"remove", (PyCFunction)bpy_bmfaceseq_remove, METH_O, bpy_bmfaceseq_remove_doc},
+ /* 'bpy_bmelemseq_get' for different purpose */
+ {"get", (PyCFunction)bpy_bmfaceseq_get__method, METH_VARARGS, bpy_bmfaceseq_get__method_doc},
+
+ /* odd function, initializes index values */
+ {"index_update", (PyCFunction)bpy_bmelemseq_index_update, METH_NOARGS, bpy_bmelemseq_index_update_doc},
+ {"sort", (PyCFunction)bpy_bmelemseq_sort, METH_VARARGS | METH_KEYWORDS, bpy_bmelemseq_sort_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmloopseq_methods[] = {
- /* odd function, initializes index values */
- /* no: index_update() function since we cant iterate over loops */
- /* no: sort() function since we cant iterate over loops */
- {NULL, NULL, 0, NULL}
+ /* odd function, initializes index values */
+ /* no: index_update() function since we cant iterate over loops */
+ /* no: sort() function since we cant iterate over loops */
+ {NULL, NULL, 0, NULL}
};
/* Sequences
@@ -2637,29 +2637,29 @@ static int bpy_bmelem_ass_subscript(BPy_BMElem *self, BPy_BMLayerItem *key, PyOb
}
static PySequenceMethods bpy_bmelemseq_as_sequence = {
- (lenfunc)bpy_bmelemseq_length, /* sq_length */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
- (ssizeargfunc)bpy_bmelemseq_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* sq_slice */
- (ssizeobjargproc)NULL, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)bpy_bmelemseq_contains, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc)bpy_bmelemseq_length, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ (ssizeargfunc)bpy_bmelemseq_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
+ NULL, /* sq_slice */
+ (ssizeobjargproc)NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)bpy_bmelemseq_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods bpy_bmelemseq_as_mapping = {
- (lenfunc)bpy_bmelemseq_length, /* mp_length */
- (binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */
- (objobjargproc)NULL, /* mp_ass_subscript */
+ (lenfunc)bpy_bmelemseq_length, /* mp_length */
+ (binaryfunc)bpy_bmelemseq_subscript, /* mp_subscript */
+ (objobjargproc)NULL, /* mp_ass_subscript */
};
/* for customdata access */
static PyMappingMethods bpy_bm_elem_as_mapping = {
- (lenfunc)NULL, /* mp_length */ /* keep this empty, messes up 'if elem: ...' test */
- (binaryfunc)bpy_bmelem_subscript, /* mp_subscript */
- (objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */
+ (lenfunc)NULL, /* mp_length */ /* keep this empty, messes up 'if elem: ...' test */
+ (binaryfunc)bpy_bmelem_subscript, /* mp_subscript */
+ (objobjargproc)bpy_bmelem_ass_subscript, /* mp_ass_subscript */
};
/* Iterator
@@ -3055,15 +3055,15 @@ void BPy_BM_init_types(void)
* ********************* */
static struct PyModuleDef BPy_BM_types_module_def = {
- PyModuleDef_HEAD_INIT,
- "bmesh.types", /* m_name */
- NULL, /* m_doc */
- 0, /* m_size */
- NULL, /* m_methods */
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL, /* m_free */
+ PyModuleDef_HEAD_INIT,
+ "bmesh.types", /* m_name */
+ NULL, /* m_doc */
+ 0, /* m_size */
+ NULL, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
PyObject *BPyInit_bmesh_types(void)
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index d484ad5c87e..e45a39a0643 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -175,64 +175,64 @@ static PyObject *bpy_bmlayeritem_name_get(BPy_BMLayerItem *self, void *UNUSED(fl
}
static PyGetSetDef bpy_bmlayeraccess_vert_getseters[] = {
- {(char *)"deform", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__deform_doc, (void *)CD_MDEFORMVERT},
+ {(char *)"deform", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__deform_doc, (void *)CD_MDEFORMVERT},
- {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
- {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
- {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
- {(char *)"shape", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__shape_doc, (void *)CD_SHAPEKEY},
- {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
+ {(char *)"shape", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__shape_doc, (void *)CD_SHAPEKEY},
+ {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmlayeraccess_edge_getseters[] = {
- {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
- {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
- {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
- {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
- {(char *)"crease", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__crease_doc, (void *)CD_CREASE},
+ {(char *)"bevel_weight", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__bevel_weight_doc, (void *)CD_BWEIGHT},
+ {(char *)"crease", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__crease_doc, (void *)CD_CREASE},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmlayeraccess_face_getseters[] = {
- {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
- {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
- {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
- {(char *)"tex", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__tex_doc, (void *)CD_MTEXPOLY},
+ {(char *)"tex", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__tex_doc, (void *)CD_MTEXPOLY},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmlayeraccess_loop_getseters[] = {
- {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
- {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
- {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
+ {(char *)"float", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__float_doc, (void *)CD_PROP_FLT},
+ {(char *)"int", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__int_doc, (void *)CD_PROP_INT},
+ {(char *)"string", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__string_doc, (void *)CD_PROP_STR},
- {(char *)"uv", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__uv_doc, (void *)CD_MLOOPUV},
- {(char *)"color", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__color_doc, (void *)CD_MLOOPCOL},
+ {(char *)"uv", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__uv_doc, (void *)CD_MLOOPUV},
+ {(char *)"color", (getter)bpy_bmlayeraccess_collection_get, (setter)NULL, (char *)bpy_bmlayeraccess_collection__color_doc, (void *)CD_MLOOPCOL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmlayercollection_getseters[] = {
- /* BMESH_TODO, make writeable */
- {(char *)"active", (getter)bpy_bmlayercollection_active_get, (setter)NULL, (char *)bpy_bmlayercollection_active_doc, NULL},
- {(char *)"is_singleton", (getter)bpy_bmlayercollection_is_singleton_get, (setter)NULL, (char *)bpy_bmlayercollection_is_singleton_doc, NULL},
+ /* BMESH_TODO, make writeable */
+ {(char *)"active", (getter)bpy_bmlayercollection_active_get, (setter)NULL, (char *)bpy_bmlayercollection_active_doc, NULL},
+ {(char *)"is_singleton", (getter)bpy_bmlayercollection_is_singleton_get, (setter)NULL, (char *)bpy_bmlayercollection_is_singleton_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
static PyGetSetDef bpy_bmlayeritem_getseters[] = {
- /* BMESH_TODO, make writeable */
- {(char *)"name", (getter)bpy_bmlayeritem_name_get, (setter)NULL, (char *)bpy_bmlayercollection_name_doc, NULL},
+ /* BMESH_TODO, make writeable */
+ {(char *)"name", (getter)bpy_bmlayeritem_name_get, (setter)NULL, (char *)bpy_bmlayercollection_name_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
@@ -556,20 +556,20 @@ static PyObject *bpy_bmlayercollection_get(BPy_BMLayerCollection *self, PyObject
}
static struct PyMethodDef bpy_bmlayeritem_methods[] = {
- {"copy_from", (PyCFunction)bpy_bmlayeritem_copy_from, METH_O, bpy_bmlayeritem_copy_from_doc},
- {NULL, NULL, 0, NULL}
+ {"copy_from", (PyCFunction)bpy_bmlayeritem_copy_from, METH_O, bpy_bmlayeritem_copy_from_doc},
+ {NULL, NULL, 0, NULL}
};
static struct PyMethodDef bpy_bmelemseq_methods[] = {
- {"verify", (PyCFunction)bpy_bmlayercollection_verify, METH_NOARGS, bpy_bmlayercollection_verify_doc},
- {"new", (PyCFunction)bpy_bmlayercollection_new, METH_VARARGS, bpy_bmlayercollection_new_doc},
- {"remove", (PyCFunction)bpy_bmlayercollection_remove, METH_O, bpy_bmlayercollection_remove_doc},
-
- {"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc},
- {"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc},
- {"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc},
- {"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc},
- {NULL, NULL, 0, NULL}
+ {"verify", (PyCFunction)bpy_bmlayercollection_verify, METH_NOARGS, bpy_bmlayercollection_verify_doc},
+ {"new", (PyCFunction)bpy_bmlayercollection_new, METH_VARARGS, bpy_bmlayercollection_new_doc},
+ {"remove", (PyCFunction)bpy_bmlayercollection_remove, METH_O, bpy_bmlayercollection_remove_doc},
+
+ {"keys", (PyCFunction)bpy_bmlayercollection_keys, METH_NOARGS, bpy_bmlayercollection_keys_doc},
+ {"values", (PyCFunction)bpy_bmlayercollection_values, METH_NOARGS, bpy_bmlayercollection_values_doc},
+ {"items", (PyCFunction)bpy_bmlayercollection_items, METH_NOARGS, bpy_bmlayercollection_items_doc},
+ {"get", (PyCFunction)bpy_bmlayercollection_get, METH_VARARGS, bpy_bmlayercollection_get_doc},
+ {NULL, NULL, 0, NULL}
};
/* Sequences
@@ -724,22 +724,22 @@ static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject
}
static PySequenceMethods bpy_bmlayercollection_as_sequence = {
- (lenfunc)bpy_bmlayercollection_length, /* sq_length */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
- (ssizeargfunc)bpy_bmlayercollection_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* sq_slice */
- (ssizeobjargproc)NULL, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)bpy_bmlayercollection_contains, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc)bpy_bmlayercollection_length, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ (ssizeargfunc)bpy_bmlayercollection_subscript_int, /* sq_item */ /* Only set this so PySequence_Check() returns True */
+ NULL, /* sq_slice */
+ (ssizeobjargproc)NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)bpy_bmlayercollection_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods bpy_bmlayercollection_as_mapping = {
- (lenfunc)bpy_bmlayercollection_length, /* mp_length */
- (binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */
- (objobjargproc)NULL, /* mp_ass_subscript */
+ (lenfunc)bpy_bmlayercollection_length, /* mp_length */
+ (binaryfunc)bpy_bmlayercollection_subscript, /* mp_subscript */
+ (objobjargproc)NULL, /* mp_ass_subscript */
};
/* Iterator
diff --git a/source/blender/python/bmesh/bmesh_py_types_meshdata.c b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
index 1b21f62a115..b5fee2a3e8e 100644
--- a/source/blender/python/bmesh/bmesh_py_types_meshdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_meshdata.c
@@ -91,10 +91,10 @@ static int bpy_bmtexpoly_image_set(BPy_BMTexPoly *self, PyObject *value, void *U
}
static PyGetSetDef bpy_bmtexpoly_getseters[] = {
- /* attributes match rna_def_mtpoly */
- {(char *)"image", (getter)bpy_bmtexpoly_image_get, (setter)bpy_bmtexpoly_image_set, (char *)bpy_bmtexpoly_image_doc, NULL},
+ /* attributes match rna_def_mtpoly */
+ {(char *)"image", (getter)bpy_bmtexpoly_image_get, (setter)bpy_bmtexpoly_image_set, (char *)bpy_bmtexpoly_image_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
PyTypeObject BPy_BMTexPoly_Type = {{{0}}}; /* bm.loops.layers.uv.active */
@@ -201,13 +201,13 @@ static int bpy_bmloopuv_flag_set(BPy_BMLoopUV *self, PyObject *value, void *flag
}
static PyGetSetDef bpy_bmloopuv_getseters[] = {
- /* attributes match rna_def_mloopuv */
- {(char *)"uv", (getter)bpy_bmloopuv_uv_get, (setter)bpy_bmloopuv_uv_set, (char *)bpy_bmloopuv_uv_doc, NULL},
- {(char *)"pin_uv", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__pin_uv_doc, (void *)MLOOPUV_PINNED},
- {(char *)"select", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_doc, (void *)MLOOPUV_VERTSEL},
- {(char *)"select_edge", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_edge_doc, (void *)MLOOPUV_EDGESEL},
+ /* attributes match rna_def_mloopuv */
+ {(char *)"uv", (getter)bpy_bmloopuv_uv_get, (setter)bpy_bmloopuv_uv_set, (char *)bpy_bmloopuv_uv_doc, NULL},
+ {(char *)"pin_uv", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__pin_uv_doc, (void *)MLOOPUV_PINNED},
+ {(char *)"select", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_doc, (void *)MLOOPUV_VERTSEL},
+ {(char *)"select_edge", (getter)bpy_bmloopuv_flag_get, (setter)bpy_bmloopuv_flag_set, (char *)bpy_bmloopuv_flag__select_edge_doc, (void *)MLOOPUV_EDGESEL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
PyTypeObject BPy_BMLoopUV_Type = {{{0}}}; /* bm.loops.layers.uv.active */
@@ -485,21 +485,21 @@ static int bpy_bmdeformvert_contains(BPy_BMDeformVert *self, PyObject *value)
/* only defined for __contains__ */
static PySequenceMethods bpy_bmdeformvert_as_sequence = {
- (lenfunc)bpy_bmdeformvert_len, /* sq_length */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
-
- /* note: if this is set PySequence_Check() returns True,
- * but in this case we dont want to be treated as a seq */
- NULL, /* sq_item */
-
- NULL, /* sq_slice */
- NULL, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
-};
+ (lenfunc)bpy_bmdeformvert_len, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+
+ /* note: if this is set PySequence_Check() returns True,
+ * but in this case we dont want to be treated as a seq */
+ NULL, /* sq_item */
+
+ NULL, /* sq_slice */
+ NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)bpy_bmdeformvert_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ };
static PyMappingMethods bpy_bmdeformvert_as_mapping = {
(lenfunc)bpy_bmdeformvert_len,
@@ -631,13 +631,13 @@ static PyObject *bpy_bmdeformvert_clear(BPy_BMDeformVert *self)
}
static struct PyMethodDef bpy_bmdeformvert_methods[] = {
- {"keys", (PyCFunction)bpy_bmdeformvert_keys, METH_NOARGS, bpy_bmdeformvert_keys_doc},
- {"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
- {"items", (PyCFunction)bpy_bmdeformvert_items, METH_NOARGS, bpy_bmdeformvert_items_doc},
- {"get", (PyCFunction)bpy_bmdeformvert_get, METH_VARARGS, bpy_bmdeformvert_get_doc},
- /* BMESH_TODO pop, popitem, update */
- {"clear", (PyCFunction)bpy_bmdeformvert_clear, METH_NOARGS, bpy_bmdeformvert_clear_doc},
- {NULL, NULL, 0, NULL}
+ {"keys", (PyCFunction)bpy_bmdeformvert_keys, METH_NOARGS, bpy_bmdeformvert_keys_doc},
+ {"values", (PyCFunction)bpy_bmdeformvert_values, METH_NOARGS, bpy_bmdeformvert_values_doc},
+ {"items", (PyCFunction)bpy_bmdeformvert_items, METH_NOARGS, bpy_bmdeformvert_items_doc},
+ {"get", (PyCFunction)bpy_bmdeformvert_get, METH_VARARGS, bpy_bmdeformvert_get_doc},
+ /* BMESH_TODO pop, popitem, update */
+ {"clear", (PyCFunction)bpy_bmdeformvert_clear, METH_NOARGS, bpy_bmdeformvert_clear_doc},
+ {NULL, NULL, 0, NULL}
};
PyTypeObject BPy_BMDeformVert_Type = {{{0}}}; /* bm.loops.layers.uv.active */
diff --git a/source/blender/python/bmesh/bmesh_py_types_select.c b/source/blender/python/bmesh/bmesh_py_types_select.c
index 40d39539894..c3adc8366bd 100644
--- a/source/blender/python/bmesh/bmesh_py_types_select.c
+++ b/source/blender/python/bmesh/bmesh_py_types_select.c
@@ -68,8 +68,8 @@ static PyObject *bpy_bmeditselseq_active_get(BPy_BMEditSelSeq *self, void *UNUSE
}
static PyGetSetDef bpy_bmeditselseq_getseters[] = {
- {(char *)"active", (getter)bpy_bmeditselseq_active_get, (setter)NULL, (char *)bpy_bmeditselseq_active_doc, NULL},
- {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
+ {(char *)"active", (getter)bpy_bmeditselseq_active_get, (setter)NULL, (char *)bpy_bmeditselseq_active_doc, NULL},
+ {NULL, NULL, NULL, NULL, NULL} /* Sentinel */
};
PyDoc_STRVAR(bpy_bmeditselseq_validate_doc,
@@ -159,12 +159,12 @@ static PyObject *bpy_bmeditselseq_remove(BPy_BMEditSelSeq *self, BPy_BMElem *val
}
static struct PyMethodDef bpy_bmeditselseq_methods[] = {
- {"validate", (PyCFunction)bpy_bmeditselseq_validate, METH_NOARGS, bpy_bmeditselseq_validate_doc},
- {"clear", (PyCFunction)bpy_bmeditselseq_clear, METH_NOARGS, bpy_bmeditselseq_clear_doc},
+ {"validate", (PyCFunction)bpy_bmeditselseq_validate, METH_NOARGS, bpy_bmeditselseq_validate_doc},
+ {"clear", (PyCFunction)bpy_bmeditselseq_clear, METH_NOARGS, bpy_bmeditselseq_clear_doc},
- {"add", (PyCFunction)bpy_bmeditselseq_add, METH_O, bpy_bmeditselseq_add_doc},
- {"remove", (PyCFunction)bpy_bmeditselseq_remove, METH_O, bpy_bmeditselseq_remove_doc},
- {NULL, NULL, 0, NULL}
+ {"add", (PyCFunction)bpy_bmeditselseq_add, METH_O, bpy_bmeditselseq_add_doc},
+ {"remove", (PyCFunction)bpy_bmeditselseq_remove, METH_O, bpy_bmeditselseq_remove_doc},
+ {NULL, NULL, 0, NULL}
};
@@ -313,22 +313,22 @@ static int bpy_bmeditselseq_contains(BPy_BMEditSelSeq *self, PyObject *value)
}
static PySequenceMethods bpy_bmeditselseq_as_sequence = {
- (lenfunc)bpy_bmeditselseq_length, /* sq_length */
- NULL, /* sq_concat */
- NULL, /* sq_repeat */
- (ssizeargfunc)bpy_bmeditselseq_subscript_int,/* sq_item */ /* Only set this so PySequence_Check() returns True */
- NULL, /* sq_slice */
- (ssizeobjargproc)NULL, /* sq_ass_item */
- NULL, /* *was* sq_ass_slice */
- (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc)bpy_bmeditselseq_length, /* sq_length */
+ NULL, /* sq_concat */
+ NULL, /* sq_repeat */
+ (ssizeargfunc)bpy_bmeditselseq_subscript_int,/* sq_item */ /* Only set this so PySequence_Check() returns True */
+ NULL, /* sq_slice */
+ (ssizeobjargproc)NULL, /* sq_ass_item */
+ NULL, /* *was* sq_ass_slice */
+ (objobjproc)bpy_bmeditselseq_contains, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods bpy_bmeditselseq_as_mapping = {
- (lenfunc)bpy_bmeditselseq_length, /* mp_length */
- (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */
- (objobjargproc)NULL, /* mp_ass_subscript */
+ (lenfunc)bpy_bmeditselseq_length, /* mp_length */
+ (binaryfunc)bpy_bmeditselseq_subscript, /* mp_subscript */
+ (objobjargproc)NULL, /* mp_ass_subscript */
};
diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 4417bc2ce8d..b70df53aff0 100644
--- a/source/blender/python/bmesh/bmesh_py_utils.c
+++ b/source/blender/python/bmesh/bmesh_py_utils.c
@@ -39,9 +39,7 @@
#include "../mathutils/mathutils.h"
#include "bmesh.h"
-
#include "bmesh_py_types.h"
-
#include "bmesh_py_utils.h" /* own include */
@@ -653,18 +651,18 @@ static PyObject *bpy_bm_utils_loop_separate(PyObject *UNUSED(self), BPy_BMLoop *
static struct PyMethodDef BPy_BM_utils_methods[] = {
- {"vert_collapse_edge", (PyCFunction)bpy_bm_utils_vert_collapse_edge, METH_VARARGS, bpy_bm_utils_vert_collapse_edge_doc},
- {"vert_collapse_faces", (PyCFunction)bpy_bm_utils_vert_collapse_faces, METH_VARARGS, bpy_bm_utils_vert_collapse_faces_doc},
- {"vert_dissolve", (PyCFunction)bpy_bm_utils_vert_dissolve, METH_VARARGS, bpy_bm_utils_vert_dissolve_doc}, /* could use METH_O */
- {"vert_separate", (PyCFunction)bpy_bm_utils_vert_separate, METH_VARARGS, bpy_bm_utils_vert_separate_doc},
- {"edge_split", (PyCFunction)bpy_bm_utils_edge_split, METH_VARARGS, bpy_bm_utils_edge_split_doc},
- {"edge_rotate", (PyCFunction)bpy_bm_utils_edge_rotate, METH_VARARGS, bpy_bm_utils_edge_rotate_doc},
- {"face_split", (PyCFunction)bpy_bm_utils_face_split, METH_VARARGS | METH_KEYWORDS, bpy_bm_utils_face_split_doc},
- {"face_join", (PyCFunction)bpy_bm_utils_face_join, METH_VARARGS, bpy_bm_utils_face_join_doc},
- {"face_vert_separate", (PyCFunction)bpy_bm_utils_face_vert_separate, METH_VARARGS, bpy_bm_utils_face_vert_separate_doc},
- {"face_flip", (PyCFunction)bpy_bm_utils_face_flip, METH_O, bpy_bm_utils_face_flip_doc},
- {"loop_separate", (PyCFunction)bpy_bm_utils_loop_separate, METH_O, bpy_bm_utils_loop_separate_doc},
- {NULL, NULL, 0, NULL}
+ {"vert_collapse_edge", (PyCFunction)bpy_bm_utils_vert_collapse_edge, METH_VARARGS, bpy_bm_utils_vert_collapse_edge_doc},
+ {"vert_collapse_faces", (PyCFunction)bpy_bm_utils_vert_collapse_faces, METH_VARARGS, bpy_bm_utils_vert_collapse_faces_doc},
+ {"vert_dissolve", (PyCFunction)bpy_bm_utils_vert_dissolve, METH_VARARGS, bpy_bm_utils_vert_dissolve_doc}, /* could use METH_O */
+ {"vert_separate", (PyCFunction)bpy_bm_utils_vert_separate, METH_VARARGS, bpy_bm_utils_vert_separate_doc},
+ {"edge_split", (PyCFunction)bpy_bm_utils_edge_split, METH_VARARGS, bpy_bm_utils_edge_split_doc},
+ {"edge_rotate", (PyCFunction)bpy_bm_utils_edge_rotate, METH_VARARGS, bpy_bm_utils_edge_rotate_doc},
+ {"face_split", (PyCFunction)bpy_bm_utils_face_split, METH_VARARGS | METH_KEYWORDS, bpy_bm_utils_face_split_doc},
+ {"face_join", (PyCFunction)bpy_bm_utils_face_join, METH_VARARGS, bpy_bm_utils_face_join_doc},
+ {"face_vert_separate", (PyCFunction)bpy_bm_utils_face_vert_separate, METH_VARARGS, bpy_bm_utils_face_vert_separate_doc},
+ {"face_flip", (PyCFunction)bpy_bm_utils_face_flip, METH_O, bpy_bm_utils_face_flip_doc},
+ {"loop_separate", (PyCFunction)bpy_bm_utils_loop_separate, METH_O, bpy_bm_utils_loop_separate_doc},
+ {NULL, NULL, 0, NULL}
};
@@ -672,15 +670,15 @@ PyDoc_STRVAR(BPy_BM_utils_doc,
"This module provides access to blenders bmesh data structures."
);
static struct PyModuleDef BPy_BM_utils_module_def = {
- PyModuleDef_HEAD_INIT,
- "bmesh.utils", /* m_name */
- BPy_BM_utils_doc, /* m_doc */
- 0, /* m_size */
- BPy_BM_utils_methods, /* m_methods */
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL, /* m_free */
+ PyModuleDef_HEAD_INIT,
+ "bmesh.utils", /* m_name */
+ BPy_BM_utils_doc, /* m_doc */
+ 0, /* m_size */
+ BPy_BM_utils_methods, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m
index f8b09ae8b1b..47df4c7363f 100644
--- a/source/blender/quicktime/apple/qtkit_export.m
+++ b/source/blender/quicktime/apple/qtkit_export.m
@@ -88,8 +88,8 @@ typedef struct QuicktimeExport {
AudioStreamBasicDescription audioInputFormat, audioOutputFormat;
AudioStreamPacketDescription *audioOutputPktDesc;
SInt64 audioFilePos;
- char* audioInputBuffer;
- char* audioOutputBuffer;
+ char *audioInputBuffer;
+ char *audioOutputBuffer;
UInt32 audioCodecMaxOutputPacketSize;
UInt64 audioTotalExportedFrames, audioTotalSavedFrames;
UInt64 audioLastFrame;
diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m
index 073fb31ff96..e30b8331fc0 100644
--- a/source/blender/quicktime/apple/qtkit_import.m
+++ b/source/blender/quicktime/apple/qtkit_import.m
@@ -153,8 +153,9 @@ static ImBuf * nsImageToiBuf(NSImage *sourceImage, int width, int height)
ibuf = IMB_allocImBuf (width, height, 32, IB_rect);
if (!ibuf) {
- if(QTIME_DEBUG) printf("quicktime_import: could not allocate memory for the " \
- "image.\n");
+ if (QTIME_DEBUG) {
+ printf("quicktime_import: could not allocate memory for the image.\n");
+ }
return NULL;
}
@@ -455,8 +456,7 @@ ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags)
ibuf = IMB_allocImBuf(bitmapSize.width, bitmapSize.height, 32/*RGBA*/, 0);
if (!ibuf) {
fprintf(stderr,
- "imb_cocoaLoadImage: could not allocate memory for the " \
- "image.\n");
+ "imb_cocoaLoadImage: could not allocate memory for the image.\n");
[bitmapImage release];
[pool drain];
return NULL;
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index ce20ce4ea46..7752baadff4 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -55,14 +55,14 @@ int RE_rayobject_raycast(RayObject *r, struct Isect *i);
/* Acceleration Structures */
-RayObject* RE_rayobject_octree_create(int ocres, int size);
-RayObject* RE_rayobject_instance_create(RayObject *target, float transform[][4], void *ob, void *target_ob);
-RayObject* RE_rayobject_empty_create(void);
+RayObject *RE_rayobject_octree_create(int ocres, int size);
+RayObject *RE_rayobject_instance_create(RayObject *target, float transform[][4], void *ob, void *target_ob);
+RayObject *RE_rayobject_empty_create(void);
-RayObject* RE_rayobject_blibvh_create(int size); /* BLI_kdopbvh.c */
-RayObject* RE_rayobject_vbvh_create(int size); /* raytrace/rayobject_vbvh.c */
-RayObject* RE_rayobject_svbvh_create(int size); /* raytrace/rayobject_svbvh.c */
-RayObject* RE_rayobject_qbvh_create(int size); /* raytrace/rayobject_qbvh.c */
+RayObject *RE_rayobject_blibvh_create(int size); /* BLI_kdopbvh.c */
+RayObject *RE_rayobject_vbvh_create(int size); /* raytrace/rayobject_vbvh.c */
+RayObject *RE_rayobject_svbvh_create(int size); /* raytrace/rayobject_svbvh.c */
+RayObject *RE_rayobject_qbvh_create(int size); /* raytrace/rayobject_qbvh.c */
/* Building */
@@ -85,7 +85,7 @@ typedef struct RayFace {
#define RE_rayface_isQuad(a) ((a)->quad)
-RayObject* RE_rayface_from_vlak(RayFace *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr);
+RayObject *RE_rayface_from_vlak(RayFace *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr);
/* RayObject representing faces directly from a given VlakRen structure. Thus
* allowing to save memory, but making code triangle intersection dependent on
@@ -96,7 +96,7 @@ typedef struct VlakPrimitive {
struct VlakRen *face;
} VlakPrimitive;
-RayObject* RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr);
+RayObject *RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr);
/* Bounding Box */
@@ -118,4 +118,3 @@ void RE_rayobject_hint_bb(RayObject *r, struct RayHint *hint, float *min, float
#endif
#endif
-
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 588be336afa..ff7c8cd2ea7 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -245,8 +245,8 @@ void WM_operator_py_idname(char *to, const char *from);
/* *************** menu types ******************** */
void WM_menutype_init(void);
struct MenuType *WM_menutype_find(const char *idname, int quiet);
-int WM_menutype_add(struct MenuType* mt);
-void WM_menutype_freelink(struct MenuType* mt);
+int WM_menutype_add(struct MenuType *mt);
+void WM_menutype_freelink(struct MenuType *mt);
void WM_menutype_free(void);
/* default operator callbacks for border/circle/lasso */
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 9ae2cb0c353..b600c08f4dc 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -183,7 +183,7 @@ int RE_WriteEnvmapResult(struct ReportList *reports, struct Scene *scene, struct
/* rna */
float *give_cursor(struct Scene *scene, struct View3D *v3d) {return (float *) NULL;}
void WM_menutype_free(void) {}
-void WM_menutype_freelink(struct MenuType* mt) {}
+void WM_menutype_freelink(struct MenuType *mt) {}
int WM_menutype_add(struct MenuType *mt) {return 0;}
int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width, int height) {return 0;}
int WM_operator_confirm(struct bContext *C, struct wmOperator *op, struct wmEvent *event) {return 0;}
@@ -418,7 +418,7 @@ void uiTemplateColorWheel(struct uiLayout *layout, struct PointerRNA *ptr, char
void uiTemplateHistogram(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand) {}
void uiTemplateReportsBanner(struct uiLayout *layout, struct bContext *C, struct wmOperator *op) {}
void uiTemplateWaveform(struct uiLayout *layout, struct PointerRNA *ptr, char *propname, int expand) {}
-void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char* property, int expand) {}
+void uiTemplateVectorscope(struct uiLayout *_self, struct PointerRNA *data, char *property, int expand) {}
void uiTemplateNodeLink(struct uiLayout *layout, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {}
void uiTemplateNodeView(struct uiLayout *layout, struct bContext *C, struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *input) {}
void uiTemplateTextureUser(struct uiLayout *layout, struct bContext *C) {}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 3e884d1aa38..80981c08c5e 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1274,6 +1274,10 @@ int main(int argc, const char **argv)
IMB_init();
+#ifdef WITH_FFMPEG
+ IMB_ffmpeg_init();
+#endif
+
BLI_callback_global_init();
#ifdef WITH_GAMEENGINE
diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp
index 93eeaaf05fb..9f155a6ebc3 100644
--- a/source/gameengine/Converter/KX_ConvertSensors.cpp
+++ b/source/gameengine/Converter/KX_ConvertSensors.cpp
@@ -657,19 +657,19 @@ void BL_ConvertSensors(struct Object* blenderobject,
if (gamecont) {
logicmgr->RegisterToSensor(gamecont,gamesensor);
- } else {
- printf(
- "Warning, sensor \"%s\" could not find its controller "
- "(link %d of %d) from object \"%s\"\n"
- "\tthere has been an error converting the blender controller for the game engine,"
- "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
}
- } else {
- printf(
- "Warning, sensor \"%s\" has lost a link to a controller "
- "(link %d of %d) from object \"%s\"\n"
- "\tpossible causes are partially appended objects or an error reading the file,"
- "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
+ else {
+ printf("Warning, sensor \"%s\" could not find its controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tthere has been an error converting the blender controller for the game engine,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
+ }
+ }
+ else {
+ printf("Warning, sensor \"%s\" has lost a link to a controller "
+ "(link %d of %d) from object \"%s\"\n"
+ "\tpossible causes are partially appended objects or an error reading the file,"
+ "logic may be incorrect\n", sens->name, i+1, sens->totlinks, blenderobject->id.name+2);
}
}
// special case: Keyboard sensor with no link
diff --git a/source/gameengine/Expressions/BoolValue.cpp b/source/gameengine/Expressions/BoolValue.cpp
index b3c4dc144df..40997a25be1 100644
--- a/source/gameengine/Expressions/BoolValue.cpp
+++ b/source/gameengine/Expressions/BoolValue.cpp
@@ -139,7 +139,7 @@ this object
default:
{
ret = new CErrorValue(val->GetText() + op2str(op) +
- "[operator not allowed on booleans]");
+ "[operator not allowed on booleans]");
break;
}
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 63f2988e259..41f641b4368 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -194,7 +194,7 @@ void usage(const char* program, bool isBlenderPlayer)
}
printf("usage: %s [-w [w h l t]] [-f [fw fh fb ff]] %s[-g gamengineoptions] "
- "[-s stereomode] [-m aasamples] %s\n", program, consoleoption, example_filename);
+ "[-s stereomode] [-m aasamples] %s\n", program, consoleoption, example_filename);
printf(" -h: Prints this command summary\n\n");
printf(" -w: display in a window\n");
printf(" --Optional parameters--\n");
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index a9602d16430..ac17adaf052 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -1048,7 +1048,9 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, getScreenRay,
{
Py_DECREF(argValue);
PyErr_SetString(PyExc_TypeError,
- "Error in getScreenRay. Invalid 2D coordinate. Expected a normalized 2D screen coordinate, a distance and an optional property argument");
+ "Error in getScreenRay. Invalid 2D coordinate. "
+ "Expected a normalized 2D screen coordinate, "
+ "a distance and an optional property argument");
return NULL;
}
Py_DECREF(argValue);
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 5d4b9ae40c2..f9fa0ae65f1 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -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);
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 4586a50e6a9..1ba944aa955 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -52,8 +52,6 @@ const long timeScale = 1000;
#define CATCH_EXCP catch (Exception & exp) \
{ exp.report(); m_status = SourceError; }
-extern "C" void do_init_ffmpeg();
-
// class RenderVideo
// constructor
@@ -521,8 +519,6 @@ void VideoFFmpeg::releaseFrame(AVFrame* frame)
// open video file
void VideoFFmpeg::openFile (char * filename)
{
- do_init_ffmpeg();
-
if (openStream(filename, NULL, NULL) != 0)
return;
@@ -586,8 +582,6 @@ void VideoFFmpeg::openCam (char * file, short camIdx)
char filename[28], rateStr[20];
char *p;
- do_init_ffmpeg();
-
#ifdef WIN32
// video capture on windows only through Video For Windows driver
inputFormat = av_find_input_format("vfwcap");