diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-09 16:29:07 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-09 16:29:47 +0300 |
commit | 291c313f80b4cccc8fcce3035584caeaa654844f (patch) | |
tree | cdc3469c825babf773c3c2cc9de678d193bec9db /source/blender/makesdna/DNA_meshdata_types.h | |
parent | 21f2bacad977d3fd83d9e4730f2a14dc9932f043 (diff) |
Mesh: Move bevel weight out of MVert and MEdge
As described in T95966, the goal is to move to a "struct of arrays"
approach rather than gathering an arbitrary set of data in hard-coded
structs. This has performance benefits, but also code complexity
benefits (this patch removes plenty of code, though the boilerplate
for the new operators outweighs that here).
To mirror the internal change, the options for storing mesh bevel
weights are converted into operators that add or remove the layer,
like for some other layers.
The most complex change is to the solidify modifier, where bevel
weights had special handling. Other than that, most changes are
removing clearing of the weights, boilerplate for the add/remove
operators, and removing the manual transfer of bevel weights
in bmesh - mesh conversion.
Eventually bevel weights can become a fully generic attribute,
but for now this patch aims to avoid most functional changes.
Bevel weights are still written and read from the mesh in the old way,
so neither forward nor backward compatibility are affected. As described
in T95965, writing in the old format will be done until 4.0.
Differential Revision: https://developer.blender.org/D14077
Diffstat (limited to 'source/blender/makesdna/DNA_meshdata_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index e0333f3ef03..e621343b818 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -25,7 +25,11 @@ extern "C" { */ typedef struct MVert { float co[3]; - char flag, bweight; + char flag; + /** + * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. + */ + char bweight DNA_DEPRECATED; char _pad[2]; } MVert; @@ -47,7 +51,11 @@ enum { typedef struct MEdge { /** Un-ordered vertex indices (cannot match). */ unsigned int v1, v2; - char crease, bweight; + char crease; + /** + * Deprecated bevel weight storage, now located in #CD_BWEIGHT, except for file read and write. + */ + char bweight DNA_DEPRECATED; short flag; } MEdge; |