Commit Graph

159 Commits

Author SHA1 Message Date
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
75a5eab8d1 code cleanup 2012-07-08 21:37:59 +00:00
ae2f3a4e5e Fix for #31581, UVs shrink on edge slide.
Issue is that all loops of a face adjacent to the sliding verts were 
getting project-corrected. Introduced a test to only project the
affected loops. 

The projection code introduces a small offset to the boundaries so that
any boundary tests can work as expected, but this leads to shrinking of
the barycentric coordinates of the projection, causing a shrink of the
uvs in turn. This even affects the uvs that -should- be affected though
the unfixed behavior works strangely in a correctish way (my guess is
because the projection uses the same face as the opposite sliding loop).

I fixed the behaviour by taking the mean value of the uvs. This won't
support seams but current code doesn't either. Also, all CustomData to
exhibit this unfixed behaviour. I only fixed the uv case, other data
(Vcolors, etc) will have discontinuities when edge sliding. I expect
that the CorrectUV code I am working on may address some of these
issues.

Also, added NULL checks for utility function (was intended for this bug
but wasn't needed after all)
2012-06-27 17:08:12 +00:00
df201548ea Utility function to get the first loop of a vert. Behaves identical to
the iterator initialization function.
2012-06-27 15:39:14 +00:00
113968aa15 quiet warning 2012-06-10 20:20:37 +00:00
405f6a7c77 code cleanup:
style and remove BM_face_find_longest/shortest_edge functions,
... instead use BM_face_find_longest/shortest_loop()->e
2012-05-27 11:10:27 +00:00
cdba862223 use faces longest edge when orienting the manipulator to the active face
also small speedup for finding the longest edge
2012-05-22 15:49:41 +00:00
5e22802fae Add new BMesh length query functions.
BMEdge *BM_face_find_shortest_edge(BMFace *f);
BMEdge *BM_face_find_longest_edge(BMFace *f);

Reviewed by Campbell Barton.
2012-05-22 15:19:33 +00:00
c230ce0ac6 fix for error pointed out by Nicholas Bishop, BM_edge_face_pair & BM_edge_loop_pair returned TRUE for single face user edges. 2012-05-21 06:44:46 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
2a1ba8c85b style cleanup: formatting and some float/double promotion 2012-05-03 19:57:24 +00:00
41a5e731a2 bmesh: new wireframe tool
- makes wireframe from faces.
- options similar to inset (even offset, relative scale)
- copies face settings and loops (uvs, vcolors)
- optionally replaces the existing geometry.
2012-04-29 10:44:00 +00:00
16ff7e40e6 code cleanup: change C naming convention (so py and C api match), eg:
C: BM_face_calc_area(f), Py: BMFace.calc_area()
2012-04-23 01:19:50 +00:00
ed81982049 knife tool alpha values where being set to zero (intersection points weren't visible), error made when converting to theme colors.
also minor bmesh style cleanup.
2012-04-20 13:45:38 +00:00
741a177a74 bmesh: improve rip tool
- When the rip extends into a fan, pick the opposite edge in the fan (rather then 2 along)
- When stepping over the fan to find the rip edge, walk in the direction closest to the mouse (generally works nicer)
2012-04-19 21:47:32 +00:00
e387ccdb42 bmesh inset: add depth option (make use of relative and even offset options) 2012-04-19 19:03:15 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
db2edfcfde bmesh api function: BM_edge_face_tangent()
was used by inset but make into an api function since scripts can use this too.
2012-04-19 11:25:05 +00:00
f1ececaabb code cleanup: replace use of BM_edge_face_count with BM_edge_is_manifold and BM_edge_is_boundary 2012-04-18 06:44:48 +00:00
27696ddae1 fix error in last commit. Misunderstood BM_vert_is_manifold(), added some comments. 2012-04-18 06:36:47 +00:00
a1337caac0 bmesh api: minor simplify & cleanup
- add BM_face_edge_share_loop(f, e) -- edge version of existing BM_face_vert_share_loop(f, v)
- simplify BM_edge_ordered_verts_ex(), check could be reduced.
- use BM_ELEM_INTERNAL_TAG for bmesh_jfke(), not BM_ELEM_TAG to avoid clobbering tagged data tools might use.
2012-04-18 04:32:55 +00:00
8fa17c5362 code cleanup: no functional changes
- memset(..., -1) is used incorrectly even though it worked: MOD_solidify.c - thanks Halley from IRC for noticing this. use fill_vn_i() instead.
- quiet warnings in editmesh_slide.c
- cleanup comments in bmesh and some other minor comment additions.
2012-04-07 12:37:15 +00:00
b44ae0c387 Fix #30791: BMEdge.is_manifold also returned true for edges with only one face
attached to it. A manifold edge should have exactly 2 faces attached to it,
sticking to the standard definition for "manifold".
2012-04-03 17:09:47 +00:00
fffe342d87 bmesh inset: another small improvement - use the shared edge vector rather then the cross product between 2 faces if the faces infact share an edge - works best for non planer faces.
also added utility function - BM_loop_other_vert_loop
2012-03-25 14:44:48 +00:00
7044d80639 code cleanup: remove BMesh * args from query functions which don't need it 2012-03-22 07:53:11 +00:00
be116242d4 style cleanup 2012-03-20 04:27:14 +00:00
753056d4e8 BMesh utility functions, not used yet,
- BM_edge_loop_pair incase you need the loops rather then the faces.
- BM_edge_ordered_verts_ex() - accepts a loop argument.
- BM_edge_length_calc() - simple length calc, useful if the edge is in some array, saves assigning a var and using len_v3v2().
2012-03-19 01:57:42 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
ac24d98e24 bmesh: edge loop select
add support for loop selecting boundry edges only - handy for loop selecting the side of an ngon.
2012-03-11 21:47:14 +00:00
33d8104716 Fix edge loop selection. Now boundary selection checks only for filled edges to determine when to stop and stops at vertices shared by only 2 edges. 2012-03-11 20:45:58 +00:00
7fa7e4ba1f bmesh python api additions:
- BMesh.is_wrapped
- BMesh.copy()
- BMesh.clear()
- BMesh.free()
- BMesh.from_object(obj, apply_modifiers=True)
- BMEdge.calc_length()
- BMLoop.calc_normal()
- BMLoop.calc_tangent()
2012-03-11 05:58:22 +00:00
c82c456247 bmesh py api, new functions:
* bmesh.utils.face_vert_rip(f, v)
* bmesh.utils.loop_rip(l)
2012-03-08 20:00:37 +00:00
17786b3b3e building without python works again, cleanup bmesh include paths (cmake and scons). 2012-03-08 03:25:53 +00:00
5ba020da4f bmesh: speedup for deselecting all, (avoid topology loops since all get deselected anyway).
& some ascii art to explain BM_face_other_vert_loop() behavior.
2012-03-06 16:17:55 +00:00
a0ab2eefb9 * rename BM_face_other_loop --> BM_face_other_edge_loop
* optimize BM_face_other_edge_loop to do about half as many iterations for quad heavy meshes, with ngons the gain is much more since searching around the entire ngon when the edge already stores its loop is silly.
 ... also nicer in cases where edge has no face users it avoids a loop on all face corners.
2012-03-04 16:36:31 +00:00
76e9f91d1c switch arg order for BM_face_other_* funcs (make face come first), and add nice ascii art for BM_face_other_vert_loop since this stuff is hard to grasp as text. 2012-03-04 16:01:02 +00:00
9c18ade898 bmesh edge rotate
* improve check to see if edge rotate can be done,
  was checking if both edges verts have an edge count of 2, which is really a meaningless test since the verts can have stray edges connected and the result wont work right.
  instead check if the next verts in both faces share a vertex.

* add utility function BM_face_other_vert_loop() which gets the next loop in a face.
* add convenience function BM_edge_face_pair() which returns 2 faces for edges that have exactly 2 face users. (saves ugly e->l->radial_next ... in code) and is more readable.
2012-03-03 12:35:37 +00:00
1f473a78b8 Code Cleanup: remove bmesh_radial_loop_next() function,
just access l->radial_next
2012-03-01 17:13:02 +00:00
e89f09a774 fast-path for BM_edge_is_manifold, BM_edge_is_boundary functions. 2012-03-01 16:56:42 +00:00
a6f420b828 update doxygen comments for bmesh. 2012-02-29 06:55:10 +00:00
dcfd1dd7e2 code cleanup: de-duplicate bmesh face creation code, 2012-02-28 19:30:44 +00:00
2a7f1af61e Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
2012-02-28 19:10:53 +00:00
d1d11bbe9b more header re-arranging.
Some function comments were in headers, some in the C files, some in both.
Moved function comments from headers into the C files.
2012-02-28 18:28:30 +00:00
e828b10251 Code Cleanup
* remove one the changes to fix #30374, instead just check if the face exists.
* remove some unneeded edge checks in BM_face_create_quad_tri_v().
2012-02-28 08:17:53 +00:00
7536bcbe70 Code Cleanup: bmesh
* remove unneeded struct's from headers.
* give argument names for return ** pointers r_ prefix.
2012-02-28 07:42:48 +00:00
94f171f2c6 fix [#30374] Can't Fill Triangular Face
the problem was a triangle couldnt be made when there was a quad that used 3 of the verts.

* now check if overlapping face has same length as the one to be created.
* an unrelated fix - the output of a triangle was not being flagged by the bmesh_contextual_create operator.
2012-02-28 07:19:28 +00:00
e17bf02c2d Code Cleanup:
* made bmesh_structure.h function names more consistant.
* remove unused code in bmesh_structure.c
* removed 'Edge Flip' operator (missing from bmesh but looked into trunk feature and dont think its worth keeping).
* tagged  some BMESH_TODO's
2012-02-27 13:47:53 +00:00
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00