Commit Graph

671 Commits

Author SHA1 Message Date
Campbell Barton
b0378440ce Fix missing adjacent UV check for recent UV path select
Path selection could cross UV islands if the destination element was
on an island boundary.
2020-07-10 12:19:30 +10:00
Campbell Barton
a0d3b60015 Cleanup: use FLT_MAX for the maximum path selection cost
A large number below FLT_MAX was used to avoid overflow,
however this doesn't cause any problems.
2020-07-10 11:49:46 +10:00
Campbell Barton
0b77e2f4c4 Cleanup: variable names, use define for maximum path cost 2020-07-10 11:49:46 +10:00
Campbell Barton
ea5fe7abc1 UV: path selection support
This adds support for path selection for vertex edge & face selection
modes, matching mesh editing behavior, useful with the UV rip tool.

Region select & edge tagging are currently not supported,
although they could be added eventually.
2020-07-09 18:43:23 +10:00
Campbell Barton
6e609f0eb0 Cleanup: use doxy comments 2020-07-07 17:52:05 +10:00
Campbell Barton
99feb10b8b Cleanup: warning, spelling 2020-07-06 23:07:18 +10:00
Germano Cavalcante
073c426900 Fix faces disappearing when AutoMerge & Split 2020-07-06 09:03:33 -03:00
Hans Goudey
a33756d783 Cleanup: Unused variables in non-debug build 2020-07-03 10:09:19 -04:00
Sybren A. Stüvel
20869065b8 Cleanup: BMesh, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/bmesh` module.

No functional changes.
2020-07-03 14:48:37 +02:00
Campbell Barton
26ffed7466 Cleanup: spelling 2020-07-02 13:03:46 +10:00
Campbell Barton
36d6aa428f Cleanup: spelling 2020-07-01 13:12:24 +10:00
Sergey Sharybin
9c1d85117c Cleanup: Fix strict compiler warning about variable shadowing
Thanks Howard for double-checking!
2020-06-26 17:29:50 +02:00
Howard Trickey
e1da4f09fc Fixed typo in previous commit (UV fix); had nonsensical self-test. 2020-06-26 07:35:50 -04:00
Howard Trickey
e3a420c477 Fix T76199 Bevel materials "bleed" over faces.
When there is an odd number of segments, bevel has an ambiguous
choice as to which side face to use to copy face attributes from
and to use for UV (and other loops that have math function) interpolation.
We used to make choice arbitrarily, which led to visually inconsistent
results. Now there is tie-breaking code, face with lexicographic lowest
value in vector with these elements:
  (1) connected component (in math-layer space) id
  (2) selected (0) vs unselected (1)
  (3) material index
  (4,5,6): z,x,y components of face center, in that order.
2020-06-26 06:43:01 -04:00
Hans Goudey
fd65055b69 Cleanup: A few small comment & naming changes in bevel 2020-06-22 22:41:02 -04:00
Hans Goudey
6703c7f7f1 Bevel: Refactor profile type input to use an enum
This will allow the easier addition of a constant radius mode in the
future and some changes in the UI to mirror the recent similar change
from "Only Vertices" to the "Affect" enum.
2020-06-22 22:25:55 -04:00
Howard Trickey
466e716495 Bevel: add new 'Absolute' mode for interpreting 'amount' value.
This mode is like Percent, but measures absolute distance along
adjacent edges instead of a percentage.
So, for example, if you use this mode with 2 segments and profile=1,
you will see the length that the bevel moves along unbeveled edges
between beveled ones will match the value specified.
Many users seem to expect this behavior, even though it means the
bevel width is uneven, so this option is for them.
2020-06-19 17:56:01 -04:00
Jacques Lucke
a58dc25b07 Cleanup: improve custom data type names
This is related to T76659.

This just renames data type names to `CD_PROP_STRING`, `CD_PROP_FLOAT`
and `CD_PROP_INT32`. It makes them a bit more specific and removes
unnecessary abbreviations.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7980
2020-06-10 15:47:31 +02:00
Campbell Barton
1a60aba46f Merge branch 'blender-v2.83-release' 2020-05-25 21:01:34 +10:00
Bastien Montagne
baa1886791 Fix T76990: Crash shortest path select with 'face stepping' when no faces.
Note that this sometimes gives no solution when there is a mix of edges
with and without faces... But at leat this should be safe fix.
2020-05-25 12:44:10 +02:00
Campbell Barton
8d648e0972 Cleanup: spelling 2020-05-21 16:22:37 +10:00
Hans Goudey
20c30534aa Fix T75383:Bevel weird behaviour when using bevel weights
Don't use the cube corner special case when the offsets are different
for the three edges involved. The generic VMesh for this situation isn't
perfect, but it's much better than a failed cube corner VMesh.

Tests pass.
2020-05-19 16:54:05 -04:00
Hans Goudey
8e0a57f9bd Merge branch 'blender-v2.83-release' 2020-05-19 16:40:53 -04:00
Hans Goudey
c554f4e14f Fix T75383:Bevel weird behaviour when using bevel weights
Don't use the cube corner special case when the offsets are different
for the three edges involved. The generic VMesh for this situation isn't
perfect, but it's much better than a failed cube corner VMesh.

Tests pass.
2020-05-19 16:40:40 -04:00
Campbell Barton
d06384aa41 Cleanup: spelling 2020-05-09 17:19:28 +10:00
Jacques Lucke
6f985574b7 Cleanup: take includes out of 'extern "C"' blocks
Surrounding includes with an 'extern "C"' block is not necessary anymore.
Also that made it harder to add any C++ code to some headers, or include headers
that have "optional" C++ code like `MEM_guardedalloc.h`.

I tested compilation on linux and windows (and got help from @LazyDodo).
If this still breaks compilation due to some linker error, the header containing
the symbol in question is probably missing an 'extern "C"' block.

Differential Revision: https://developer.blender.org/D7653
2020-05-08 18:22:41 +02:00
Campbell Barton
c1e4b369b0 Merge branch 'blender-v2.83-release' 2020-04-24 13:28:11 +10:00
Campbell Barton
001629a362 Fix T75946: Intersect (knife) doesn't cut all intersections 2020-04-24 13:26:17 +10:00
Campbell Barton
d2aa4ada50 Merge branch 'blender-v2.83-release' 2020-04-24 12:27:12 +10:00
Campbell Barton
d428cca124 Fix T63787: Knife intersect crashes 2020-04-24 12:18:29 +10:00
Campbell Barton
9667f89e82 Cleanup: correct printf warnings for bmesh interesect debugging 2020-04-24 11:47:41 +10:00
Germano Cavalcante
f9649e2bf1 Fix T75994: Crash with 'Split Edges and Faces' | Auto-Merge
It occurred when an edge was collapsed into a vert that was not part of it.
This is common when the distance for merging is relatively large.
2020-04-22 12:53:19 -03:00
Germano Cavalcante
f5b540593c Fix T75994: Crash with 'Split Edges and Faces' | Auto-Merge
It occurred when an edge was collapsed into a vert that was not part of it.
This is common when the distance for merging is relatively large.
2020-04-22 12:48:16 -03:00
Campbell Barton
ab93e568eb Cleanup: use colon after doxygen parameters, spelling 2020-04-17 11:15:00 +10:00
Germano Cavalcante
765c82e92d Fix possible endless loop in Auto Merge & Split 2020-03-23 17:40:08 -03:00
Campbell Barton
cb560c01b6 Cleanup: clang-format, comment indentation 2020-03-20 12:23:04 +11:00
Dalai Felinto
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
Campbell Barton
b8feef59c8 Cleanup: add parens for clarity 2020-03-15 21:53:57 +11:00
Sergey Sharybin
598ab525da Cleanup: Replace ABS/SQUARE/CUBE with function calls
While it might be handy to have type-less functionality which is
similar to how C++ math is implemented it can not be easily achieved
with just preprocessor in a way which does not have side-effects on
wrong usage.

There macros where often used on a non-trivial expression, and there
was at least one usage where it was causing an actual side effect/bug
on Windows (see change around square_f(sh[index++]) in studiolight.c).

For such cases it is handy to have a function which is guaranteed to
have zero side-effects. The motivation behind actually removing the
macros is that there is already a way to do similar calculation. Also,
not having such macros is a way to guarantee that its usage is not
changed in a way which have side-effects and that it's not used as an
inspiration for cases where it should not be used.

Differential Revision: https://developer.blender.org/D7051
2020-03-09 14:47:59 +01:00
Campbell Barton
bba4a09b2f Cleanup: use 'BKE_' prefix for BKE_deform API calls
- Use 'BKE_object_defgroup' prefix for object functions.

- Rename 'defvert_verify_index' to 'defvert_ensure_index'
  since this adds the group if it isn't found.
2020-03-06 12:56:44 +11:00
Hans Goudey
f78ca97cfc Bevel: Z-Up Custom Profile Orientation
When beveling architectural objects like baseboards or crown mouldings that
may consist of multiple	islands, it's useful if	the orientation	is at least
conistent.

This changes the arbitrary decision of how the orientation should start	at a
chain beginning to use the highest side of the profile in the Z direction.

Reviewed By: howardt

Differential Revision: https://developer.blender.org/D6946
2020-03-01 22:21:51 -06:00
Howard Trickey
30158b6ed0 Fix T74256, crash in bmesh.ops.bevel if segments not set.
Also changed signature of bevel function to take integer
for segments instead of float, which is just wrong.
2020-02-27 16:36:17 -05:00
Campbell Barton
d936f6977f Fix T58571: Limited dissolve ignores boundaries between delimited faces
When a vertex between two edges is being collapsed,
it's important that edges between delimiting faces use the
angle between edges without scaling it down.

While faces with different materials wont ever be merged into a single
face, all the detail between the two faces may be removed.
2020-02-15 17:55:58 +11:00
Campbell Barton
68a52a7fa9 Cleanup: define use 2020-02-15 10:40:41 +11:00
Hans Goudey
b05651199b Code Quality Day: Comment formatting in bmesh_bevel.c 2020-02-07 13:32:02 -05:00
Campbell Barton
6f3e498e7d Cleanup: use of 'unsigned'
- Replace 'unsigned' used on it's own with 'uint'.
- Replace 'unsigned const char' with 'const uchar'.
2020-02-08 01:02:18 +11:00
Howard Trickey
30963eecfb Fix T73450, crash when adding segments on bevel.
Needed to protect against a case where clamp overlap limited
the offset to approximately zero, and the snap-to-pipe code
would therefore encounter an almost degenerate profile and
fail in matrix inversion.
2020-01-30 07:56:00 -05:00
Campbell Barton
ddda73b98a Cleanup: warnings, clang-format 2020-01-28 11:43:42 +11:00
mano-wii
5df494d75c bmesh_intersect_edges: Don't detect faces if an edge already exists
For optimization.
2020-01-27 18:31:15 -03:00
mano-wii
944956aba8 bmesh_intersect_edges: Improve detection of the best_face
`lambda_a` made it more restricted than it should be.
2020-01-27 17:43:12 -03:00