Blender Git Commit Log

Git Commits -> Revision d6940e4

March 12, 2018, 16:22 (GMT)
Heavy refactor of weighted normals code, especially 'keep sharp' part.

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. :)

Commit Details:

Full Hash: d6940e4e896457bab83aceb7588342054ad0892b
Parent Commit: ec58cbb
Lines Changed: +193, -341

2 Modified Paths:

/source/blender/makesrna/intern/rna_modifier.c (+9, -4) (Diff)
/source/blender/modifiers/intern/MOD_weighted_normal.c (+184, -337) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021