Commit Graph

1430 Commits

Author SHA1 Message Date
Campbell Barton
f32079d4b9 BLI_stackdefines
Bounds check the stack while debugging, also add STACK_PEEK
2014-06-29 05:57:48 +10:00
Campbell Barton
beedb0b274 BMesh: more edits to vertex dissolve, handle mixing wire edges with faces better 2014-06-27 22:06:49 +10:00
Campbell Barton
d6ab81809e BMesh: tweaks to dissolve, remove wire edges before other calculations
also avoid feedback loop when checking topology giving nondeterministic results.
2014-06-27 20:28:36 +10:00
Campbell Barton
e947dd8cd7 BMesh: add BM_vert_is_edge_pair(), faster then checking (BM_vert_edge_count(v) == 2) 2014-06-27 20:28:32 +10:00
Campbell Barton
c3deb16c16 BMesh: add ability not to delete vertex when collapsing 2014-06-27 20:28:02 +10:00
Campbell Barton
07a5caad5f BMesh: use slightly faster method of stepping over edge-disks 2014-06-27 20:28:02 +10:00
Campbell Barton
2aca720bff Fix T40813: Dissolve verts with adjacent regions, removes the dividing edge 2014-06-27 05:39:39 +10:00
Campbell Barton
0ea7302349 Fix for dissolve faces iterating over verts while removing 2014-06-26 23:29:45 +10:00
Campbell Barton
0529766f32 Use api function for flipping button list & rename to BLI_listbase_reverse 2014-06-25 19:33:35 +10:00
Campbell Barton
c5ccbacdaa move STACK_* macros into BLI_stackdefines.h 2014-06-25 00:01:33 +10:00
Bastien Montagne
b82e84f179 BMesh: we actually can set loop indices too while converting from Mesh to BMesh... 2014-06-23 16:21:53 +02:00
Campbell Barton
3a75381505 Apply fix for T40745 to extrude_face_region too 2014-06-23 00:12:06 +10:00
Campbell Barton
728041019e Editmesh: extruding end-point verts now maintains edge-direction
Resolves T40745, where faces from extruded edges had flipped normals.
2014-06-22 18:41:07 +10:00
Campbell Barton
f2a0062042 Use ARRAY_SIZE to replace (sizeof(a) / sizeof(*a)) 2014-06-17 02:47:57 +10:00
Howard Trickey
b5213b2dea Fix T40007 Bevel tool resets after getting to 1.
If the side of a beveled edge hit another vertex, the offset
amount reset to zero. This was the result of commit rB1582dd5e4d7c
which clamped the amount to zero to avoid creating spikes with
obtuse angles. Now we clamp the amount to the closest end of
the edge to where the amount wants to be.
Also fixes the first part of T40365.
2014-06-14 17:47:44 -04:00
Campbell Barton
d6287b213b BLI_gsqueue: use size_t for elem_size (was casting all over) 2014-06-15 03:49:25 +10:00
Campbell Barton
b54793ef02 Editmesh: remove redundant normal calculation call for subdivide 2014-06-14 17:55:07 +10:00
Campbell Barton
19b1da2b7b Polyfill2d: avoid calculating polygon winding (its known in all cases) 2014-06-14 08:21:52 +10:00
Campbell Barton
365ff66987 GSet, GHash: Add BLI_gset_add, since its common to add members to a set
also rename BLI_edgeset_reinsert -> BLI_edgeset_add, in this case its the same.
2014-06-14 00:47:12 +10:00
Campbell Barton
9f0466fb6b Quiet double promotion warning & ws edit 2014-06-13 02:22:40 +10:00
Howard Trickey
8c2b5ffb11 Fix Bevel bug T39746, small scale gives flat profile.
With very small meshes or very small bevel amounts, the bevel
profile would be flat even if a round one was requested.
Problem was that the code was checking the length of a cross
product for closeness to zero to test coplanarity. Needed
to normalize things before making that test to account for scale.
2014-06-12 10:22:10 -04:00
Howard Trickey
84767a29f1 Fix Bevel multisegment profile bugs T39184, T37502 and last part of T40365.
When doing a 'weld' type join where there are two non-beveled edges
in the same plane one beveled one but not the other, then there
should be a curved profile; bug was creating a straight one.
2014-06-10 11:21:52 -04:00
Campbell Barton
c6ea6e368b BMesh: avoid recursion for BM_mesh_edgenet, runs out stack memory on large nets 2014-06-08 22:20:03 +10:00
Campbell Barton
d53ed58c57 BMesh: avoid OpenMP use for low poly meshes (counting selection)
also use schedule(static) for simple for loops.
2014-06-06 23:54:15 +10:00
Campbell Barton
0b0bac846c Fix T40508: Calculating normals crashes 2014-06-06 11:27:09 +10:00
Campbell Barton
8355955058 Avoid openmp sections in BM_mesh_elem_index_ensure 2014-06-05 18:50:10 +10:00
Campbell Barton
6f47d054ff Code cleanup: mixup hflag/htype 2014-06-05 18:37:53 +10:00
Campbell Barton
df94a773b6 BMesh: avoid using OpenMP when nothing to do
Gave slowdown drawing on high poly meshes
2014-06-05 08:13:55 +10:00
Howard Trickey
d504b325fb Fix T37618 Bevel mismatched offsets and bad profile plane.
Used a different technique to resolve "impossible" offset cases
that makes more consistency. Also changed the plane in which
the profile lies for the case with only one beveled edge and
more than 3 other edges.
2014-05-30 16:07:45 -04:00
Howard Trickey
6bde9a52f9 Fix T39174 Bevel didn't maintain edge attributes.
When rebuilding the polygons that touch bevel-involved vertices,
need to copy the edge attributes from corresponding original edges.
Special treatment of corner segments, to maintain continuity of
smooth and seam attributes.
Another fix: if have four meeting edges, two opposite ones beveled
and the other two not, propgate the non-beveled-edges attributes
across the line that joins them (perpendicular to the bevel).
2014-05-29 07:32:16 -04:00
Bastien Montagne
74cc3974fe Fix T40405: Blender crashes on FBX export instantly.
Better fix than rBbef5cb3aa2e5a: consider edges between faces with opposed normals as sharp.

In fact, previous code was broken more deeply in this case (inconsistent normals across
a 'smooth fan') - some loop normals would even never be computed!

Fixing this is possible (even wrote it, actually), but this adds more complexity
to a piece of code that is already awfully complicated, *and* normals in that kind
of smooth fan do not make much sense anyway. So simpler and nicer results with
assuming sharp edges between such 'opposed' faces!

Note that there is some face (loop) ordering black magic at work here, added more comments
to try to explain how and why all this works.

As a bonus, we do not need to check for already computed loop normals anymore, since we
know each 'smooth fan' will be walked once, and only once.
2014-05-28 18:55:46 +02:00
Bastien Montagne
9913da2b7f Found another bmesh func that invalidates loop indices... 2014-05-28 18:55:45 +02:00
Campbell Barton
fad267bf57 BMesh Walker: add face-shell walker 2014-05-23 20:50:27 +10:00
Campbell Barton
7e78322eef BMesh Walker: rename BMW_SHELL -> BMW_VERT_SHELL 2014-05-23 20:50:27 +10:00
Campbell Barton
d82cd4d5ef BMesh Walker: typecheck args for walker->begin() 2014-05-23 20:50:27 +10:00
Bastien Montagne
a217db0d63 Fix T40297: Crash while ripping an edge when autosmooth is activated.
Turned out there was still quite a few cases were indices were set dirty,
but elem_index_dirty was not tagged accordingly (mostly for BM_LOOP,
but a few others as well). So probably this crash was not the only one
hidden here.

Hopefully all possible cases were catched this time!
2014-05-21 22:37:50 +02:00
Campbell Barton
d9dd29054f Style cleanup 2014-05-20 00:11:16 +10:00
Howard Trickey
758bdcd6c2 Fix Bevel bugs T39726 and T39108, bevels with wire edges.
This updates the fix in rB27db75363, which had to be undone
because it broke other bevels.
It also fixes cases where edges went away went doing vertex
bevel on vertices with some wire edges.
2014-05-16 10:28:15 -04:00
Campbell Barton
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
Antony Riakiotakis
33df6aa12e Fix T39196, Dynamic Topology Undo Applied to Wrong Mesh
Undoing nodes that do not belong to the current object will cause the
saved bmesh log entry to be reverted instead. This entry can belong to
another object though.
This is easy to fix by enforcing name matching (this was borrowed by
edit mode but can definitely be improved) between current object name
and undo node name and deleting older entries.

However there are complications. Deleting dyntopo entries in this way
can leave a brush stroke as first dyntopo log entry. This can present
issues if we attempt to delete that entry since it's deleted mesh
elements may now have had their ids (which would still be valid at the
time) cleaned up. This can result in crashing if we attempt to resculpt
on the mesh. To fix this I have disabled releasing the deleted entries.

This entanglement between bm_log and undo is quite volatile but I hope
the system works better now.

Also minor cleanup, fix unneeded check warning
2014-05-13 22:05:23 +03:00
Campbell Barton
b12bf2216f Correct last commit, check not to split along edges already used 2014-05-13 18:41:04 +10:00
Campbell Barton
dd8a9eee3b Fix T40162: Vert connect creates extra face cutting across concave NGon.
We need to support cutting degenerate ngons, see: T39418
This commit disallows cuts across faces where the same vertices can create better cuts on different faces.
2014-05-13 17:56:26 +10:00
Campbell Barton
46bd759964 Code cleanup: rename BM_face_legal_splits -> BM_face_splits_check_legal 2014-05-13 17:48:25 +10:00
Campbell Barton
bdf477d19a BMesh: add check to BM_vert_pair_share_face to allow adjacent loops
Add BM_vert_pair_share_face_by_angle to avoid selecting concave splits.
2014-05-13 16:49:57 +10:00
Campbell Barton
f14df29777 BMesh: make BM_face_calc_normal_subset apart of the bmesh api
also make face normal calculation functions return normal length
2014-05-13 14:58:05 +10:00
Campbell Barton
c3a3664e8c Utility macros for linklist stack & asserts for bmesh 2014-05-10 09:29:34 +10:00
Campbell Barton
65d54f34b1 Code cleanup: spelling/indentation 2014-05-08 04:53:05 +10:00
Campbell Barton
95b93b5d46 Add BLI_compiler_compat.h to help with portability 2014-05-02 01:14:15 +10:00
Campbell Barton
af86b008b2 Include removal gave problems with windows, ifdef some back in for windows only 2014-05-01 07:21:08 +10:00
Campbell Barton
cb48c0ceea Revert "Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc7a."
This reverts commit a47a4ef82f.
2014-05-01 07:20:46 +10:00