diff options
author | Jacques Lucke <jacques@blender.org> | 2022-05-04 10:51:32 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-05-04 10:51:32 +0300 |
commit | 7dc94155f62025248e8c111efa8bf0561b3bb492 (patch) | |
tree | a940d5e0588ef93afc336cbda8a6c44bfe019e6c /source/blender/makesdna | |
parent | aa21087d5655deccb6e5ff05c13b30ab9ecec69c (diff) |
Curves: support symmetry in curves sculpting brushes
This adds support for X/Y/Z symmetry for all brushes in curves
sculpt mode. In theory this can be extended to support radial
symmetry, but that's not part of this patch.
It works by essentially applying a brush stroke multiple with
different transforms. This is similiar to how symmetry works in
mesh sculpt mode, but is quite different from how it worked in
the old hair system (there it tried to find matching hair strands
on both sides of the surface; if none was found, symmetry did
not work).
Differential Revision: https://developer.blender.org/D14795
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_curves_types.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_curves_types.h b/source/blender/makesdna/DNA_curves_types.h index bb53dbafdc8..e909abc70cb 100644 --- a/source/blender/makesdna/DNA_curves_types.h +++ b/source/blender/makesdna/DNA_curves_types.h @@ -9,6 +9,8 @@ #include "DNA_ID.h" #include "DNA_customdata_types.h" +#include "BLI_utildefines.h" + #ifdef __cplusplus extern "C" { #endif @@ -130,7 +132,13 @@ typedef struct Curves { /* Materials. */ struct Material **mat; short totcol; - short _pad2[3]; + + /** + * User-defined symmetry flag (#eCurvesSymmetryType) that causes editing operations to maintain + * symmetrical geometry. + */ + char symmetry; + char _pad2[5]; /** * Used as base mesh when curves represent e.g. hair or fur. This surface is used in edit modes. @@ -150,6 +158,14 @@ enum { HA_DS_EXPAND = (1 << 0), }; +/** #Curves.symmetry */ +typedef enum eCurvesSymmetryType { + CURVES_SYMMETRY_X = 1 << 0, + CURVES_SYMMETRY_Y = 1 << 1, + CURVES_SYMMETRY_Z = 1 << 2, +} eCurvesSymmetryType; +ENUM_OPERATORS(eCurvesSymmetryType, CURVES_SYMMETRY_Z) + /* Only one material supported currently. */ #define CURVES_MATERIAL_NR 1 |