diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-21 14:58:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-09-21 16:31:43 +0300 |
commit | b32832a7e8f6a12eee658ff1eb1be7e18d2e6eef (patch) | |
tree | 305a9a0b8efa8b5480414d1533416bc948fb693b /source/blender/blenkernel/BKE_subdiv_ccg.h | |
parent | da800621ed2e65fdf5b6ad665a96b360a51e83fc (diff) |
Subdiv: CCG, initialize grid mask from paint mask
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_ccg.h')
-rw-r--r-- | source/blender/blenkernel/BKE_subdiv_ccg.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h b/source/blender/blenkernel/BKE_subdiv_ccg.h index cee7bce7f05..fa3782bbd0f 100644 --- a/source/blender/blenkernel/BKE_subdiv_ccg.h +++ b/source/blender/blenkernel/BKE_subdiv_ccg.h @@ -43,6 +43,31 @@ struct DMFlagMat; struct Mesh; struct Subdiv; +/* ============================================================================= + * Masks. + */ + +/* Functor which evaluates mask value at a given (u, v) of given ptex face. */ +typedef struct SubdivCCGMask { + float (*eval_mask)(struct SubdivCCGMask *mask, + const int ptex_face_index, + const float u, const float v); + + /* Free the data, not the evaluator itself. */ + void (*free)(struct SubdivCCGMask *mask); + + void *user_data; +} SubdivCCGMask; + +/* Return true if mesh has mask and evaluator can be used. */ +bool BKE_subdiv_ccg_mask_init_from_paint( + SubdivCCGMask *mask_evaluator, + const struct Mesh *mesh); + +/* ============================================================================= + * SubdivCCG. + */ + typedef struct SubdivToCCGSettings { /* Resolution at which regular ptex (created for quad polygon) are being * evaluated. This defines how many vertices final mesh will have: every @@ -190,7 +215,8 @@ typedef struct SubdivCCG { */ struct SubdivCCG *BKE_subdiv_to_ccg( struct Subdiv *subdiv, - const SubdivToCCGSettings *settings); + const SubdivToCCGSettings *settings, + SubdivCCGMask *mask_evaluator); /* Destroy CCG representation of subdivision surface. */ void BKE_subdiv_ccg_destroy(SubdivCCG *subdiv_ccg); |