Age | Commit message (Collapse) | Author |
|
'degenerated too short normals' check was probably a bit too aggressive,
moved it back to more common 1e-6 value.
|
|
Same issue & same fix as with edit normals modifier some times ago...
|
|
|
|
Before, 'keep sharp' was bsically:
* Overwriting everything just computed by 'single nor per vertex' code,
leading to a nice share of computations being tossed to nowhere.
* Re-implementing most of core clnor computaion code, only skipping all
'sharp edge' cases but the one defined by shapr edge tags. This was not
only bad for code maintenance and (reasonable) simplicity, it was also
introducing inconsistencies in how we define sharp edges, since
everwhere else in code we take into account sharp edge tag, flat face
tag, and 'smooth threshold' value (aka split angle) of mesh.
At first I though 'keep sharp' would need its own totally separated code
path, but thanks to some data structure tricks, it was possible to merge
most of both cases into single code. So this commit:
* Heavily factorizes and simplifies code, especially the 'keep sharp' case.
* Makes use of clnor spaces as generated by core BKE code to define
'smooth fans' that should have the same weighted normals, just like
anywhere else in Blender.
Note that since code is now using same functions in all cases, it also
naturally brings back vgroup support in keep_sharp case.
Also, this has been a fairly involved change, basic testing seems to be
OK, but more would be welcomed here. :)
|
|
modifier."
This reverts some changes from commit a7a4beecb208d12a00d550e3ebf4e2a37730fa6b.
|
|
Also fixed some other trivial issues.
|
|
WARNING! this will break files saved with this branch and using face
strength feature (no crash or data corruption, but face strength values
will become invalid and will produce weird results)!
Rationals for this change are:
* Having strength values in natural order simplifies existing code
already, not to mention any future potential addition to strengthes.
* Now, code will work as-is, even if we decide to add more stength
values in the future.
|
|
New memory allocator was added a few months ago as an attempt to make
our memory management more secure, still have to go over rest of this
patch's code for same thing. ;)
|
|
We now pass most common parameters to processing functions using a
single struct, this is much cleaner.
Also, factorized code aggregating poly nors into vertex nors in new
aggregate_vertex_normal function, and optimized expensive powf calls
(exponential inverse weight...) by computing once and caching most
common values (since weight is static all-over processing, and nearly
all vertices will only have a few faces or loops using them...).
Note that am still very unhapy with 'keep sharp edges' case, that one
seems to copy a lot of code we already have in BKE_mesh_evaluate, and
(if I followed code correctly) recompute everything, essentially
ditching the whole first computations of weighted normals!
|
|
Also, better to avoid binary XOR on booleans, you never know how those
are actually stored internally (or how they were generated), and may get
surprising results depending on compiler etc., though with modern
compilers I’d expect this to be safe now?
|
|
Style and naming, arg positons (all loops data together, etc.),
const values and args, and so on...
Also, avoid allocating unused memory, avoid extra loops when possible, etc.
|
|
|
|
Did not check code itself in deep yet...
|
|
Those types are generic, specific usages should always use named layers
with a specific 'id name'.
Also, make weightednormals modifier to show edited normals in 3DView in
edit mode.
|
|
|
|
|
|
Mostly styling, and some minor/harmless errors.
|
|
Also removed redundant function and replaced its definition to BKE_mesh.h
|
|
|
|
mistake with weighting in modifier making it work differently from average.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also added proper weights to sharp edges
|
|
|
|
1) Now correctly splits loop normal according to sharp edges
2) Modifier now only acts on active vertex group
3) Added a check to use smooth/sharp flags as boolean weights
|
|
1) Modifier now respects sharp edges, requires bool value to be checked.
2) Can now use vertex groups to apply modifier to only selected vgroup
3) Added boolean (0-1) weights in the form of Smooth/Sharp flags. Smooth flag means the face will hold 0 weight.
|
|
|
|
Has a weight int which specifies the weights with which face area/corner angle will be exponentially divided. Threshold provides the limit in values which will be weighted equally.
|