Commit Graph

1600 Commits

Author SHA1 Message Date
Campbell Barton
4c58cb8bd9 Correct assert 2015-03-16 13:39:27 +11:00
Campbell Barton
d49eeabae7 Cleanup: warnings 2015-03-16 09:37:00 +11:00
Howard Trickey
2140cb60cb Fix T39184: Multisegment bevel profiles should curve in-plane sometimes.
When the multisegment profile joins two unbeveled edges, all in the same
plane, users desire that rather than the current behavior of linear
interpolation between those edges, the profile should curve.
This changes behavior to do that.  The old behavior can be obtained
by setting the profile parameter to 0.25, if desired.
2015-03-15 18:24:36 -04:00
Campbell Barton
6b610500b9 Cleanup: indentation 2015-03-11 13:14:24 +11:00
Campbell Barton
36df8cc1e5 Fix T43421: bisect_edges returns insufficient data 2015-03-09 18:33:24 +11:00
Campbell Barton
7df60becb9 BMesh: Add extended BM_vert_calc_edge_angle that takes a fallback value 2015-03-06 18:45:00 +11:00
Antony Riakiotakis
a7d292394e Fix T43898, correct all uv layers in bevel, not only the active one 2015-03-05 18:50:44 +01:00
Campbell Barton
8c6073db11 BMesh: BM_loop/edge_point_side_of_loop_test
change behavior to use a negative number when outside,
and return the signed, squared distance.
2015-03-03 00:26:13 +11:00
Campbell Barton
3281c3f3ce error in last commit 2015-03-02 16:51:01 +11:00
Campbell Barton
6373078321 Fix T43848: Wrong direction recalculating normals
Face islands furthest faces could face towards the center point when connected to sharp edges.

Now check the furthest edge of the furthest face, to test for face winding.
2015-03-02 15:51:07 +11:00
Campbell Barton
9d85e32ee3 BMesh: calc normals, use area weighted center
Prevents many small faces skewing center calculation.
2015-03-02 13:04:46 +11:00
Campbell Barton
831a111353 Fix T43792: Connect faces fails with ngons
Complex ngons that intersected the path multiple times would fail to connect.

Now find closest intersections in both directions.
2015-02-25 00:08:39 +11:00
Campbell Barton
cdd14ea96d Cleanup: use bit-shift for bmesh_elem_check 2015-02-24 13:10:15 +11:00
Bastien Montagne
ced19783fd Fix mismatch (missing 'const' to mactch funcs declarations).
Was breaking windows compile, reported by bdancer over IRC, thanks.

Also, quite some annoying 'unused vars' warnings (debug-only vars).
2015-02-23 13:57:02 +01:00
Campbell Barton
7c03ef295b CustomData: const correctness 2015-02-23 16:17:16 +11:00
Campbell Barton
64b328f22b Edge/Vert Slide: avoid redundant loop angle calls
No need to calculate loop angle for each layer
2015-02-23 15:44:28 +11:00
Campbell Barton
bc876f9ea4 Error in last commit
Accidentally left in malloc/free
2015-02-23 15:40:43 +11:00
Campbell Barton
5a372dbd89 Fix error in recent vert/edge-slide commits
`CustomData_bmesh_interp_n` was expecting the 'dest' arg not to have its offset applied.

This was a bit confusing since the source args have it applied,
and in some cases we only have the destination with the offset.
2015-02-23 13:57:06 +11:00
Campbell Barton
d580c90469 CustomData: const correctness for interp() 2015-02-23 13:54:33 +11:00
Campbell Barton
58652301de Vert/Edge Slide: better UV interpolation
Ignore faces which the sliding vert is outside of.
2015-02-16 18:49:18 +11:00
Campbell Barton
7a977df6d4 Refactor array_utils out of BLI_array
BLI_array.h is for resizing array macros, where as array_utils can operate on any arrays.
2015-02-14 08:00:41 +11:00
Campbell Barton
29e19cecd8 BMesh: avoid ugly macro for loop interpolation
Compiler optimizes to practically the same output
2015-02-13 11:06:16 +11:00
Howard Trickey
dce59530d0 Fix part 1 of T43239, multisegment vertex bevel on 2-edge vertices.
Implemented multisegment rounding of vertices with two edges.
Works both with wire edges and edges that have one or two faces
attached.
2015-02-12 06:55:30 -05:00
Campbell Barton
2d1e072686 UV Island support for vertex & edge slide
This ensures slide with `Correct UVs` enabled, keeps UV's (any loop custom-data) contiguous.

Adds 2 key functions `BM_vert_loop_groups_data_layer_create` and `BM_vert_loop_groups_data_layer_merge`

They work by collecting matching loop custom-data around the vertices loop-fan,
and merging the custom-data after edits are made.

Thanks to @mont29 for review!
2015-02-11 21:30:13 +11:00
Campbell Barton
d4934f8f6d cleanup: style/indentation 2015-02-11 18:39:28 +11:00
Bastien Montagne
a42553f986 Fix T43579: FBX Export shading issue (Broken normals?)
Error in custom split normals work, non-autosmooth normals != vertex normals!
Loops from flat faces shall take normal of their face, not their vertex.

Tsst...
2015-02-06 20:14:18 +01:00
Bastien Montagne
138c9dba9b Add Custom Loop Normals.
This is the core code for it, tools (datatransfer and modifier) will come in next commits).
RNA api is already there, though.

See the code for details, but basically, we define, for each 'smooth fan'
(which is a set of adjacent loops around a same vertex that are smooth, i.e. have a single same normal),
a 'loop normal space' (or lnor space), using auto-computed normal and relevant edges, and store
custom normal as two angular factors inside that space. This allows to have custom normals
'following' deformations of the geometry, and to only save two shorts per loop in new clnor CDLayer.

Normal manipulation (editing, mixing, interpolating, etc.) shall always happen with plain 3D vectors normals,
and be converted back into storage format at the end.

Clnor computation has also been threaded (at least for Mesh case, not for BMesh), since the process can
be rather heavy with high poly meshes.

Also, bumping subversion, and fix mess in 2.70 versioning code.
2015-02-05 14:32:57 +01:00
Campbell Barton
488b342741 BMesh: optimize selection flushing
De-selecting a face would do flushing checks on each vertex 3 times, now only do once.
2015-02-03 19:59:39 +11:00
Campbell Barton
af2d75b9a7 cleanup: inconsistent BMesh select checks 2015-02-03 19:08:25 +11:00
Campbell Barton
75249259f4 BMesh: optimize edge select
It's called a lot, so avoid using a generic iterator for edges of vert.
2015-02-03 09:33:04 +11:00
Campbell Barton
81f97692ae cleanup: style/spelling 2015-02-02 23:29:53 +11:00
Campbell Barton
8cd106f12a minor edits to last commit 2015-02-02 19:21:26 +11:00
Campbell Barton
64124ba904 BMesh: tool to ensure all faces are convex
Access from Mesh -> Cleanup
2015-02-02 09:23:44 +11:00
Campbell Barton
d655a8f168 BMesh: BM_face_triangulate take edge array
To access edges created between the tris.
2015-02-02 09:22:54 +11:00
Campbell Barton
fd75796afe cleanup: use const 2015-02-02 01:23:08 +11:00
Campbell Barton
01ec66423c BMesh: remove redundant connect-nonplanar loop 2015-02-01 19:18:39 +11:00
Campbell Barton
9e9cd77b8d Compiler warning: double-promotion 2015-02-01 01:17:21 +11:00
Bastien Montagne
0af11a1742 Make use/computation of lnors consistant.
Issue was, when requesting (building) lnors for a mesh that has
autosmooth disabled, one would expect to simply get vnors as lnors.

Until now, it wasn't the case, which was bad e.g. for normal projections
of loops in recent remap code (projecting along split loop normals
when you would expect projection along vertex normals...).

Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`.
This should *always* use mesh settings (both autosmooth and smoothresh),
otherwise once again we'd get inconsistencies in some cases.
Will update fbx and obj addons too.
2015-01-19 15:51:20 +01:00
Campbell Barton
b09563ca8c Cleanup: fixes for building with recent clang 2015-01-14 05:11:20 +11:00
Campbell Barton
a97c5d1f9f Fix T42459: Knife fails at small scale
Occluding geometry failed when near overlapping (or cutting small objects).
2015-01-14 01:36:03 +11:00
Campbell Barton
bd00770715 Cleanup: consistent arg order in bmesh 2015-01-14 01:36:03 +11:00
Campbell Barton
3debcc8b51 Math Lib: improve area calculation
- area_quad_v3 now works correctly with concave quads.
- add area_squared_*** functions, to use when comparing to avoid a sqrt().
2015-01-13 19:10:15 +11:00
Campbell Barton
dcd662c695 BMesh: Tweak behavior for select more/less
Stepping over faces gives overall nice results but it stopped wire edges from working.
Now step over wire too.
2015-01-13 02:36:51 +11:00
Campbell Barton
dec523da87 Fix for regression in bmesh connect-pair
T42563 fix wasn't right, fortunately this doesn't fail in most cases.
2015-01-10 12:32:14 +11:00
Campbell Barton
9fadacfd0f cleanup: style 2015-01-08 19:57:50 +11:00
Howard Trickey
bf168f0600 Fix T43137: vertex bevel percent mode wasn't implemented. 2015-01-06 09:13:38 -05:00
Campbell Barton
fd9b25df75 cleanup: create cube, use index lookups 2015-01-04 14:21:16 +11:00
Campbell Barton
4abe548527 cleanup: style 2015-01-02 19:29:00 +11:00
Campbell Barton
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
Bastien Montagne
c79c48cc93 Fix T40930: Add a new option to select faces by smooth/flat shading.
Org code by robschia (Roberto Schiavone), first review by campbellbarton (Campbell Barton),
final review and minor changes by mont29 (Bastien Montagne).

Reviewers: cambellbarton, mont29

Subscribers: mont29, campbellbarton

Maniphest Tasks: T40930

Differential Revision: https://developer.blender.org/D638
2014-12-28 19:08:43 +01:00