Commit Graph

478 Commits

Author SHA1 Message Date
Bastien Montagne
9009622b54 Merge branch 'master' into blender2.8 2018-03-14 18:10:31 +01:00
Campbell Barton
342593f124 Cleanup: rename BLI_array_count -> len
Match naming convention used everywhere else.
Count should only be used when this isn't directly accessible.
2018-03-15 01:53:20 +11:00
Campbell Barton
2bc952fdb6 Merge branch 'master' into blender2.8 2018-02-18 22:33:05 +11:00
Campbell Barton
deacb3d6b8 Cleanup: add 2d suffix to BLI files
Some of these API's can have 3D versions, explicitly name them 2D.
2018-02-18 21:27:33 +11:00
Sergey Sharybin
df1c88b652 Merge branch 'master' into blender2.8 2018-02-15 14:15:55 +01:00
Campbell Barton
ccdacf1c9b Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
  (hint this isn't a simple getter).

See P611 to apply instead of manually resolving conflicts.
2018-02-15 23:39:08 +11:00
Tamito Kajiyama
3b61d2bb68 Merge branch 'master' into blender2.8
Conflicts:
	intern/cycles/blender/addon/ui.py
2018-02-09 03:00:20 +09:00
Howard Trickey
d3248bb50b Disable fast adjust code. Add other end spec matching.
This fixes a few caess where new width adjustment code

was less than ideal.
2018-02-08 10:48:24 -05:00
Campbell Barton
5376c739f5 Merge branch 'master' into blender2.8 2018-02-06 23:06:23 +11:00
Howard Trickey
bd9ed0228b Fix bevel profile=1 problems, see T39132, T38458, T40278, T51010,
T53783.

Before, profile=1 ("square outside") only worked well in a few cases
(some "pipes", cube corners). This makes it work well pretty much
everywhere.
2018-02-05 14:21:43 -05:00
Campbell Barton
e4c9cf7088 Merge branch 'master' into blender2.8 2018-02-01 14:02:33 +11:00
Campbell Barton
078e012cd9 Cleanup: rename BLI_*_empty() -> clear()
Consistent with other BLI API's
2018-02-01 13:40:53 +11:00
Sergey Sharybin
0d64857c3f Merge branch 'master' into blender2.8 2018-01-30 14:32:27 +01:00
Howard Trickey
cebc7bb198 Fix nan problem in previous bevel commit.
For chains, access to g_prod[0] was undefined.
And two minor style (whitespace) changes.
2018-01-29 10:01:19 -05:00
Campbell Barton
da885b922c Merge branch 'master' into blender2.8 2018-01-29 17:32:20 +11:00
Howard Trickey
561d738eaa Fix T53459, inconsistent bevel on identical edges.
The old algorithm depended on vertex order.
The new one uses a global least squares solution on chains
and cycles of edges where loop slide induces a dependency.

See https://wiki.blender.org/index.php/Dev:Source/Modeling/Bevel
in the "Consistent Widths for Even Bevels" for derivation of
the new algorithm.
2018-01-28 19:19:02 -05:00
Campbell Barton
dfbe415372 Merge branch 'master' into blender2.8 2018-01-28 17:18:56 +11:00
Campbell Barton
bff1dae767 Cleanup: style, spelling 2018-01-28 17:00:39 +11:00
Campbell Barton
c850320b35 Merge branch 'master' into blender2.8 2018-01-19 17:21:15 +11:00
Campbell Barton
7a24e0d175 Cleanup: typos 2018-01-19 15:34:54 +11:00
Campbell Barton
2b56faebe5 Merge branch 'master' into blender2.8 2018-01-10 19:58:05 +11:00
Campbell Barton
18f53d8822 Cleanup: comment block alignment 2018-01-10 19:57:02 +11:00
Campbell Barton
cfd1b48492 Merge branch 'master' into blender2.8 2017-12-19 14:15:19 +11:00
Howard Trickey
bb30ce0f0b Fix T53474, bevel glitchy with big objects.
A comparison should have not just have been against an epsilon,
but relative to the edge length involved.
Thanks to mano-wii for patch on which this is based.
2017-12-18 12:24:42 -05:00
Bastien Montagne
deaeee8e4d Merge branch 'master' into blender2.8 2017-12-05 11:48:37 +01:00
Howard Trickey
bdc15061fc Better bevel profile at extreme values of profile.
Patch from Richard Erhardt, with some additions & modifications.
Changes bevel profile shape parameter so that can get arbitrarily
near square profile as parameter -> 1.
Adds code to make profile=0 case work, at least for cube corners,
so changed hard min of profile parameter to 0 from 0.15.
2017-12-04 09:36:14 -05:00
Sybren A. Stüvel
7530c54c3c Merge branch 'master' into blender2.8 2017-10-29 15:14:04 +01:00
Campbell Barton
ab2d1f61a8 BMesh: use heap update for dissolve-decimate 2017-10-30 00:39:00 +11:00
Campbell Barton
3425732926 BLI_heap: minor changes to the API
Recent addition of 'reinsert' didn't match logic for ghash API.

Rename to BLI_heap_node_value_update,
also add BLI_heap_insert_or_update since it's a common operation.
2017-10-29 15:47:06 +11:00
Campbell Barton
336885beba Use BLI_heap_reinsert for decimate and beautify
Improves performance for high poly meshes,
~70% faster for decimate, only ~10% for beautify.
2017-10-29 05:28:00 +11:00
Julian Eisel
147f9585db Merge branch 'master' into blender2.8 2017-10-23 00:04:20 +02:00
Campbell Barton
6dfe4cbc6b Polyfill Beautify: half-edge optimization
Was using an edge hash for triangle -> edge lookups,
updating triangle indices for each edge-rotation.

Replace this with half-edge which can rotate edges much more simply,
writing triangles back once the solution has been calculated.

Gives ~33% speedup in own tests.
2017-10-23 01:40:03 +11:00
Campbell Barton
24b083c8f3 Merge branch 'master' into blender2.8 2017-09-26 14:52:21 +10:00
Campbell Barton
aba2f8ea67 Beauty fill was skipping small faces 2017-09-26 12:59:23 +10:00
Sergey Sharybin
af170839af Merge branch 'master' into blender2.8 2017-09-19 21:08:14 +05:00
Campbell Barton
60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
Campbell Barton
4fae536f60 Merge branch 'master' into blender2.8 2017-09-15 22:44:07 +10:00
Campbell Barton
c594087488 Polyfill Beautify: option to rotate out of degenerate state
Needed for 3D iterative edge-rotation to avoid flipping when projected
from different angles,
but could keep zero area faces in 2D polygons.
2017-09-15 18:14:17 +10:00
Sergey Sharybin
028c5592cd Merge branch 'master' into blender2.8 2017-09-15 12:35:20 +05:00
Campbell Barton
fc7ac0bc49 Correct error in last commit 2017-09-14 23:04:01 +10:00
Campbell Barton
8c21003248 Fix T52748: Select shortest face path fails 2017-09-14 23:01:07 +10:00
Campbell Barton
7d7741d25f Merge branch 'master' into blender2.8 2017-09-11 16:52:53 +10:00
Campbell Barton
f56fea3d6b Fix T52701: Mesh shortest path fails at boundaries 2017-09-11 16:45:19 +10:00
Campbell Barton
9567529b8f Merge branch 'master' into blender2.8 2017-08-12 00:23:49 +10:00
Howard Trickey
b2392afc50 Fix bevel clamping bugs T51247 and T50819.
Old bevel 'Clamp overlap' code was very naive: just limit amount
to half edge length. This uses more accurate (but not perfect)
calculations for the max amount before (many) geometry collisions
happen. This is not a backward compatible change - meshes that
have modifiers with 'Clamp overlap' will likely have larger allowed
bevel widths now. But that can be fixed by turning off clamp overlap
and setting the amount to the desired value.
2017-08-11 09:13:27 -04:00
Campbell Barton
8ddaa6a4e2 Merge branch 'master' into blender2.8 2017-08-01 10:38:36 +10:00
Brecht Van Lommel
66110c6b98 Code cleanup: fix warning with clang. 2017-07-31 19:07:29 +02:00
Campbell Barton
346619159a Merge branch 'master' into blender2.8 2017-06-09 07:21:43 +10:00
Howard Trickey
ed84388e7d Bevel Op (internal and API) now returns new edges and verts as well as
faces.

This was requested by script writers. Especially needed if beveling
wire edges with vertex_only.
Should be backward compatible as just adds two new keys to returned
dict in python ('edges' and 'verts').
2017-06-07 08:53:10 -04:00
Sergey Sharybin
f32a18994a Merge branch 'master' into blender2.8 2017-05-31 15:52:11 +02:00