[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49020] branches/soc-2011-tomato: Merging r49005 through r49019 from trunk into soc-2011-tomato
Sergey Sharybin
sergey.vfx at gmail.com
Wed Jul 18 12:24:47 CEST 2012
Revision: 49020
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49020
Author: nazgul
Date: 2012-07-18 10:24:47 +0000 (Wed, 18 Jul 2012)
Log Message:
-----------
Merging r49005 through r49019 from trunk into soc-2011-tomato
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49005
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49019
Modified Paths:
--------------
branches/soc-2011-tomato/release/scripts/modules/bpy/path.py
branches/soc-2011-tomato/source/blender/blenkernel/BKE_object.h
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c
branches/soc-2011-tomato/source/blender/blenkernel/intern/object.c
branches/soc-2011-tomato/source/blender/blenlib/intern/noise.c
branches/soc-2011-tomato/source/blender/editors/mask/mask_ops.c
branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_loopcut.c
branches/soc-2011-tomato/source/blender/editors/object/object_group.c
branches/soc-2011-tomato/source/blender/editors/object/object_relations.c
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_texture.c
branches/soc-2011-tomato/source/blender/modifiers/intern/MOD_edgesplit.c
branches/soc-2011-tomato/source/blender/python/mathutils/mathutils_noise.c
branches/soc-2011-tomato/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
Property Changed:
----------------
branches/soc-2011-tomato/
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
branches/soc-2011-tomato/source/blender/editors/space_outliner/
Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49004
+ /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49019
Modified: branches/soc-2011-tomato/release/scripts/modules/bpy/path.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/modules/bpy/path.py 2012-07-18 10:22:56 UTC (rev 49019)
+++ branches/soc-2011-tomato/release/scripts/modules/bpy/path.py 2012-07-18 10:24:47 UTC (rev 49020)
@@ -133,9 +133,6 @@
mixed case names are kept as is. Intended for use with
filenames and module names.
"""
-
- name = _os.path.splitext(name)[0]
-
# string replacements
name = name.replace("_colon_", ":")
@@ -154,7 +151,6 @@
ensured to be utf8 compatible.
"""
- name = _os.path.splitext(basename(name))[0]
name = _clean_utf8(name)
return name
Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_object.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_object.h 2012-07-18 10:22:56 UTC (rev 49019)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_object.h 2012-07-18 10:24:47 UTC (rev 49020)
@@ -177,6 +177,8 @@
} eObjectSet;
struct LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet objectSet, eObRelationTypes includeFilter);
+struct LinkNode *BKE_object_groups(struct Object *ob);
+void BKE_object_groups_clear(struct Scene *scene, struct Base *base, struct Object *object);
#ifdef __cplusplus
}
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-07-18 10:22:56 UTC (rev 49019)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-07-18 10:24:47 UTC (rev 49020)
@@ -579,6 +579,13 @@
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;
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c 2012-07-18 10:22:56 UTC (rev 49019)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c 2012-07-18 10:24:47 UTC (rev 49020)
@@ -57,7 +57,38 @@
#define TRI_TERMINATOR_ID ((unsigned int) -1)
#define TRI_VERT ((unsigned int) -1)
+/* for debugging add... */
+/* printf("%u %u %u %u\n", _t[0], _t[1], _t[2], _t[3]); \ */
+#define FACE_ASSERT(face, vert_max) \
+{ \
+ unsigned int *_t = face; \
+ BLI_assert(_t[0] < vert_max); \
+ BLI_assert(_t[1] < vert_max); \
+ BLI_assert(_t[2] < vert_max || _t[2] == TRI_VERT); \
+} (void)0
+void rotate_point(const float cent[2], const float angle, float p[2], const float asp[2])
+{
+ const float s = sinf(angle);
+ const float c = cosf(angle);
+ float p_new[2];
+
+ /* translate point back to origin */
+ p[0] -= cent[0];
+ p[1] -= cent[1];
+
+ p[0] /= asp[0];
+ p[1] /= asp[1];
+
+ /* rotate point */
+ p_new[0] = ((p[0] * c) - (p[1] * s)) * asp[0];
+ p_new[1] = ((p[0] * s) + (p[1] * c)) * asp[1];
+
+ /* translate point back */
+ p[0] = p_new[0] + cent[0];
+ p[1] = p_new[1] + cent[1];
+}
+
/* --------------------------------------------------------------------- */
/* local structs for mask rasterizeing */
/* --------------------------------------------------------------------- */
@@ -690,11 +721,54 @@
tot_feather_quads -= 2;
}
- /* ack these are infact tris, but they are extra faces so no matter,
- * +1 becausing adding one vert results in 2 tris (joining the existing endpoints)
- */
- // tot_feather_quads + ((SPLINE_RESOL_CAP + 1) * 2);
+ /*cap ends */
+ if (!is_cyclic) {
+ unsigned int k;
+ float asp[2] = {1.0f, 1.0f};
+
+ if (do_aspect_correct) {
+ if (width != height) {
+ if (width < height) {
+ asp[1] = (float)width / (float)height;
+ }
+ else {
+ asp[0] = (float)height / (float)width;
+ }
+ }
+ }
+
+ for (k = 1; k < SPLINE_RESOL_CAP; k++) {
+ const float angle = (float)k * (1.0f / SPLINE_RESOL_CAP) * (float)M_PI;
+ copy_v2_v2(co_feather, diff_feather_points[0]);
+ rotate_point(diff_points[0], angle, co_feather, asp);
+
+ sf_vert = BLI_scanfill_vert_add(&sf_ctx, co_feather);
+ sf_vert->tmp.u = sf_vert_tot;
+ sf_vert->keyindex = SF_KEYINDEX_TEMP_ID;
+ sf_vert_tot++;
+ }
+
+ tot_feather_quads += SPLINE_RESOL_CAP;
+
+ for (k = 1; k < SPLINE_RESOL_CAP; k++) {
+ const float angle = (float)k * (1.0f / SPLINE_RESOL_CAP) * (float)M_PI;
+ copy_v2_v2(co_feather, diff_feather_points[tot_diff_point - 1]);
+ rotate_point(diff_points[tot_diff_point - 1], -angle, co_feather, asp);
+
+ sf_vert = BLI_scanfill_vert_add(&sf_ctx, co_feather);
+ sf_vert->tmp.u = sf_vert_tot;
+ sf_vert->keyindex = SF_KEYINDEX_TEMP_ID;
+ sf_vert_tot++;
+ }
+
+ tot_feather_quads += SPLINE_RESOL_CAP;
+
+
+ }
+
+ /* end capping */
+
}
}
}
@@ -742,14 +816,17 @@
sf_tri_tot = BLI_scanfill_calc_ex(&sf_ctx, FALSE, zvec);
face_array = MEM_mallocN(sizeof(*face_array) * (sf_tri_tot + tot_feather_quads), "maskrast_face_index");
+ face_index = 0;
/* tri's */
face = (unsigned int *)face_array;
- for (sf_tri = sf_ctx.fillfacebase.first, face_index = 0; sf_tri; sf_tri = sf_tri->next, face_index++) {
+ for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
*(face++) = sf_tri->v3->tmp.u;
*(face++) = sf_tri->v2->tmp.u;
*(face++) = sf_tri->v1->tmp.u;
*(face++) = TRI_VERT;
+ face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
}
/* start of feather faces... if we have this set,
@@ -766,8 +843,8 @@
*(face++) = sf_edge->v2->tmp.u;
*(face++) = sf_edge->v2->keyindex;
*(face++) = sf_edge->v1->keyindex;
-
face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
}
}
}
@@ -789,15 +866,15 @@
*(face++) = j + 0; /* z 1 */
*(face++) = j + 1; /* z 0 */
*(face++) = j + 4; /* next span */ /* z 0 */
-
face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
*(face++) = j + 0; /* z 1 */
*(face++) = j + 3; /* next span */ /* z 1 */
*(face++) = j + 5; /* next span */ /* z 0 */
*(face++) = j + 2; /* z 0 */
-
face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
}
if (open_spline_ranges[open_spline_index].is_cyclic) {
@@ -805,15 +882,84 @@
*(face++) = j + 0; /* z 1 */
*(face++) = j + 1; /* z 0 */
*(face++) = start_vidx + 1; /* next span */ /* z 0 */
-
face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
*(face++) = j + 0; /* z 1 */
*(face++) = start_vidx + 0; /* next span */ /* z 1 */
*(face++) = start_vidx + 2; /* next span */ /* z 0 */
*(face++) = j + 2; /* z 0 */
+ face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
+ }
+ else {
+ unsigned int midvidx = start_vidx;
+ /***************
+ * cap end 'a' */
+ j = midvidx + (open_spline_ranges[open_spline_index].vertex_total * 3);
+
+ for (k = 0; k < SPLINE_RESOL_CAP - 2; k++, j++) {
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = j + 0; /* z 0 */
+ *(face++) = j + 1; /* z 0 */
+ face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
+ }
+
+ j = start_vidx + (open_spline_ranges[open_spline_index].vertex_total * 3);
+
+ /* 2 tris that join the original */
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = midvidx + 1; /* z 0 */
+ *(face++) = j + 0; /* z 0 */
face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
+
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = midvidx + 0; /* z 1 */
+ *(face++) = j + SPLINE_RESOL_CAP - 2; /* z 0 */
+ *(face++) = midvidx + 2; /* z 0 */
+ face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
+
+
+ /***************
+ * cap end 'b' */
+ /* ... same as previous but v 2-3 flipped, and different initial offsets */
+
+ j = start_vidx + (open_spline_ranges[open_spline_index].vertex_total * 3) + (SPLINE_RESOL_CAP - 1);
+
+ midvidx = start_vidx + (open_spline_ranges[open_spline_index].vertex_total * 3) - 3;
+
+ for (k = 0; k < SPLINE_RESOL_CAP - 2; k++, j++) {
+ *(face++) = midvidx; /* z 1 */
+ *(face++) = midvidx; /* z 1 */
+ *(face++) = j + 1; /* z 0 */
+ *(face++) = j + 0; /* z 0 */
+ face_index++;
+ FACE_ASSERT(face - 4, sf_vert_tot);
+ }
+
+ j = start_vidx + (open_spline_ranges[open_spline_index].vertex_total * 3) + (SPLINE_RESOL_CAP - 1);
+
+ /* 2 tris that join the original */
+ *(face++) = midvidx + 0; /* z 1 */
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list