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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-09-30 17:16:55 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-09-30 17:16:55 +0400
commite91f33101ff0999e07f7ce941f31dca793d954e7 (patch)
tree83c0d933f2ac1d063e2c57aaded58fd09d8d5712 /source/blender/bmesh
parenta42ba82f638e481d7fd3c3ed2ba05c331ef6717e (diff)
parent818b2e81da7d5f3e04439e3b4fef5c7ce5263b5b (diff)
Merged changes in the trunk up to revision 50956.
Conflicts resolved: source/blender/editors/interface/resources.c
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c20
-rw-r--r--source/blender/bmesh/operators/bmo_connect.c10
-rw-r--r--source/blender/bmesh/operators/bmo_create.c2
-rw-r--r--source/blender/bmesh/operators/bmo_join_triangles.c4
-rw-r--r--source/blender/bmesh/operators/bmo_primitive.c10
-rw-r--r--source/blender/bmesh/operators/bmo_subdivide.c9
6 files changed, 28 insertions, 27 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 734f08142b1..0d072da5327 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -665,7 +665,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
/* Verts' pointers, only edge pointers... */
if (eptr_map) {
BM_ITER_MESH (ve, &iter, bm, BM_VERTS_OF_MESH) {
-/* printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, (const void*)ve->e));*/
+/* printf("Vert e: %p -> %p\n", ve->e, BLI_ghash_lookup(eptr_map, (const void *)ve->e));*/
ve->e = BLI_ghash_lookup(eptr_map, (const void *)ve->e);
}
}
@@ -675,20 +675,20 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
if (vptr_map || eptr_map) {
BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) {
if (vptr_map) {
-/* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void*)ed->v1));*/
-/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void*)ed->v2));*/
+/* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void *)ed->v1));*/
+/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void* )ed->v2));*/
ed->v1 = BLI_ghash_lookup(vptr_map, (const void *)ed->v1);
ed->v2 = BLI_ghash_lookup(vptr_map, (const void *)ed->v2);
}
if (eptr_map) {
/* printf("Edge v1_disk_link prev: %p -> %p\n", ed->v1_disk_link.prev,*/
-/* BLI_ghash_lookup(eptr_map, (const void*)ed->v1_disk_link.prev));*/
+/* BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.prev));*/
/* printf("Edge v1_disk_link next: %p -> %p\n", ed->v1_disk_link.next,*/
-/* BLI_ghash_lookup(eptr_map, (const void*)ed->v1_disk_link.next));*/
+/* BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.next));*/
/* printf("Edge v2_disk_link prev: %p -> %p\n", ed->v2_disk_link.prev,*/
-/* BLI_ghash_lookup(eptr_map, (const void*)ed->v2_disk_link.prev));*/
+/* BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.prev));*/
/* printf("Edge v2_disk_link next: %p -> %p\n", ed->v2_disk_link.next,*/
-/* BLI_ghash_lookup(eptr_map, (const void*)ed->v2_disk_link.next));*/
+/* BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.next));*/
ed->v1_disk_link.prev = BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.prev);
ed->v1_disk_link.next = BLI_ghash_lookup(eptr_map, (const void *)ed->v1_disk_link.next);
ed->v2_disk_link.prev = BLI_ghash_lookup(eptr_map, (const void *)ed->v2_disk_link.prev);
@@ -701,15 +701,15 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx)
BM_ITER_MESH (fa, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (lo, &iterl, fa, BM_LOOPS_OF_FACE) {
if (vptr_map) {
-/* printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, (const void*)lo->v));*/
+/* printf("Loop v: %p -> %p\n", lo->v, BLI_ghash_lookup(vptr_map, (const void *)lo->v));*/
lo->v = BLI_ghash_lookup(vptr_map, (const void *)lo->v);
}
if (eptr_map) {
-/* printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, (const void*)lo->e));*/
+/* printf("Loop e: %p -> %p\n", lo->e, BLI_ghash_lookup(eptr_map, (const void *)lo->e));*/
lo->e = BLI_ghash_lookup(eptr_map, (const void *)lo->e);
}
if (fptr_map) {
-/* printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, (const void*)lo->f));*/
+/* printf("Loop f: %p -> %p\n", lo->f, BLI_ghash_lookup(fptr_map, (const void *)lo->f));*/
lo->f = BLI_ghash_lookup(fptr_map, (const void *)lo->f);
}
}
diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c
index 1987294fc42..bb2e49d043c 100644
--- a/source/blender/bmesh/operators/bmo_connect.c
+++ b/source/blender/bmesh/operators/bmo_connect.c
@@ -380,8 +380,9 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
/* compute summed length between vertices in forward direction */
len = 0.0f;
- for (j = 0; j < lenv2; j++)
- len += len_v3v3(vv1[clamp_index(i+j, lenv1)]->co, vv2[j]->co);
+ for (j = 0; j < lenv2; j++) {
+ len += len_v3v3(vv1[clamp_index(i + j, lenv1)]->co, vv2[j]->co);
+ }
if (len < min) {
min = len;
@@ -390,8 +391,9 @@ void bmo_bridge_loops_exec(BMesh *bm, BMOperator *op)
/* compute summed length between vertices in backward direction */
len = 0.0f;
- for (j = 0; j < lenv2; j++)
- len += len_v3v3(vv1[clamp_index(i-j, lenv1)]->co, vv2[j]->co);
+ for (j = 0; j < lenv2; j++) {
+ len += len_v3v3(vv1[clamp_index(i - j, lenv1)]->co, vv2[j]->co);
+ }
if (len < min) {
min = len;
diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c
index 1567455e354..519778cb638 100644
--- a/source/blender/bmesh/operators/bmo_create.c
+++ b/source/blender/bmesh/operators/bmo_create.c
@@ -1223,7 +1223,7 @@ void bmo_edgenet_prepare(BMesh *bm, BMOperator *op)
v4 = BM_vert_in_edge(edges2[i - 1], edges2[i]->v1) ? edges2[i]->v2 : edges2[i]->v1;
}
- /* if there is ever bowtie quads between two edges the problem is here! [#30367] */
+ /* if there is ever bow-tie quads between two edges the problem is here! [#30367] */
#if 0
normal_tri_v3(dvec1, v1->co, v2->co, v4->co);
normal_tri_v3(dvec2, v1->co, v4->co, v3->co);
diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c
index 0d8b397110e..7191aa7a7b6 100644
--- a/source/blender/bmesh/operators/bmo_join_triangles.c
+++ b/source/blender/bmesh/operators/bmo_join_triangles.c
@@ -163,8 +163,8 @@ static int bm_edge_faces_cmp(BMesh *bm, BMEdge *e, const int do_uv, const int do
};
if (lcol[0]) {
- if (!compare_rgb_uchar((unsigned char*)&lcol[0]->r, (unsigned char*)&lcol[2]->r, T2QCOL_LIMIT) ||
- !compare_rgb_uchar((unsigned char*)&lcol[1]->r, (unsigned char*)&lcol[3]->r, T2QCOL_LIMIT))
+ if (!compare_rgb_uchar((unsigned char *)&lcol[0]->r, (unsigned char *)&lcol[2]->r, T2QCOL_LIMIT) ||
+ !compare_rgb_uchar((unsigned char *)&lcol[1]->r, (unsigned char *)&lcol[3]->r, T2QCOL_LIMIT))
{
return FALSE;
}
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index 70173d942a1..30561e47d20 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -309,7 +309,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
phid /= 2;
for (a = 0; a <= tot; a++) {
/* Going in this direction, then edge extruding, makes normals face outward */
- vec[0] = -dia *sinf(phi);
+ vec[0] = -dia * sinf(phi);
vec[1] = 0.0;
vec[2] = dia * cosf(phi);
eve = BM_vert_create(bm, vec, NULL);
@@ -354,7 +354,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
{
float len, len2, vec2[3];
- len = 2 *dia *sinf(phid / 2.0f);
+ len = 2 *dia * sinf(phid / 2.0f);
/* length of one segment in shortest parallen */
vec[0] = dia * sinf(phid);
@@ -517,16 +517,16 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
phi = 0;
if (cap_ends) {
- vec[0] = vec[1] = 0.0f;
- vec[2] = 0.0;
+ zero_v3(vec);
mul_m4_v3(mat, vec);
cent1 = BM_vert_create(bm, vec, NULL);
+ BMO_elem_flag_enable(bm, cent1, VERT_MARK);
}
for (a = 0; a < segs; a++, phi += phid) {
/* Going this way ends up with normal(s) upward */
- vec[0] = -dia *sinf(phi);
+ vec[0] = -dia * sinf(phi);
vec[1] = dia * cosf(phi);
vec[2] = 0.0f;
mul_m4_v3(mat, vec);
diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c
index b239be1c83b..4ec3d3471e6 100644
--- a/source/blender/bmesh/operators/bmo_subdivide.c
+++ b/source/blender/bmesh/operators/bmo_subdivide.c
@@ -53,6 +53,9 @@
#define ELE_INNER 8
#define ELE_SPLIT 16
+/* see bug [#32665], 0.00005 means a we get face splits at a little under 1.0 degrees */
+#define FLT_FACE_SPLIT_EPSILON 0.00005
+
/*
* NOTE: beauty has been renamed to flag!
*/
@@ -823,16 +826,12 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
/* make sure the two edges have a valid angle to each other */
if (totesel == 2 && BM_edge_share_vert_count(e1, e2)) {
- float angle;
-
sub_v3_v3v3(vec1, e1->v2->co, e1->v1->co);
sub_v3_v3v3(vec2, e2->v2->co, e2->v1->co);
normalize_v3(vec1);
normalize_v3(vec2);
- angle = dot_v3v3(vec1, vec2);
- angle = fabsf(angle);
- if (fabsf(angle - 1.0f) < 0.01f) {
+ if (fabsf(dot_v3v3(vec1, vec2)) > 1.0f - FLT_FACE_SPLIT_EPSILON) {
totesel = 0;
}
}