diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-20 14:20:30 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-20 14:21:34 +0300 |
commit | 4425e0cd64ff23b77c553041858a150665a32ba3 (patch) | |
tree | 45c76d67d99499377dc719679c22e87effc86d8f /source/blender/makesdna/DNA_customdata_types.h | |
parent | 9b4c017031f94237d75320349e933462772d773e (diff) |
Subdivision: add support for vertex creasing
This adds vertex creasing support for OpenSubDiv for modeling, rendering,
Alembic and USD I/O.
For modeling, vertex creasing follows the edge creasing implementation with an
operator accessible through the Vertex menu in Edit Mode, and some parameter in
the properties panel. The option in the Subsurf and Multires to use edge
creasing also affects vertex creasing.
The vertex crease data is stored as a CustomData layer, unlike edge creases
which for now are stored in `MEdge`, but will in the future also be moved to
a `CustomData` layer. See comments for details on the difference in behavior
for the `CD_CREASE` layer between egdes and vertices.
For Cycles this adds sockets on the Mesh node to hold data about which vertices
are creased (one socket for the indices, one for the weigths).
Viewport rendering of vertex creasing reuses the same color scheme as for edges
and creased vertices are drawn bigger than uncreased vertices.
For Alembic and USD, vertex crease support follows the edge crease
implementation, they are always read, but only exported if a `Subsurf` modifier
is present on the Mesh.
Reviewed By: brecht, fclem, sergey, sybren, campbellbarton
Differential Revision: https://developer.blender.org/D10145
Diffstat (limited to 'source/blender/makesdna/DNA_customdata_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 787dbc23515..e1ec061f2f9 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -139,6 +139,10 @@ typedef enum CustomDataType { CD_SHAPE_KEYINDEX = 27, CD_SHAPEKEY = 28, CD_BWEIGHT = 29, + /* Usage of CD_CREASE depends on where on the Mesh the layer is added: + * - for vertex creasing, this is persistent data accross all modes and is stored in the file, + * - for egde creasing, it is runtime data which is only used in edit-mode before being copied to + * MEdge when exiting edit-mode. */ CD_CREASE = 30, CD_ORIGSPACE_MLOOP = 31, CD_PREVIEW_MLOOPCOL = 32, |