diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-08 09:12:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-08 09:12:33 +0300 |
commit | 00f3957b8edd74f901cb52af1d2353e5b8df7437 (patch) | |
tree | 1ef2ae4486621851394238cdd48559493c95095d /source/blender/modifiers/intern/MOD_weightvg_util.h | |
parent | c1279768a77d093e1747f4954c9c0a959feefdf0 (diff) |
Cleanup: move public doc-strings into headers for 'modifiers'
Ref T92709
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvg_util.h')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvg_util.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h index 796603289ca..00aecd7342c 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.h +++ b/source/blender/modifiers/intern/MOD_weightvg_util.h @@ -46,13 +46,21 @@ struct uiLayout; * Util functions. * **************************************/ -/* We cannot divide by zero (what a surprise...). - * So if -MOD_WEIGHTVGROUP_DIVMODE_ZEROFLOOR < weightf < MOD_WEIGHTVGROUP_DIVMODE_ZEROFLOOR, +/** + * We cannot divide by zero (what a surprise...). + * So if `-MOD_WEIGHTVGROUP_DIVMODE_ZEROFLOOR < weightf < MOD_WEIGHTVGROUP_DIVMODE_ZEROFLOOR`, * we clamp weightf to this value (or its negative version). * Also used to avoid null power factor. */ #define MOD_WVG_ZEROFLOOR 1.0e-32f +/** + * Maps new_w weights in place, using either one of the predefined functions, or a custom curve. + * Return values are in new_w. + * If indices is not NULL, it must be a table of same length as org_w and new_w, + * mapping to the real vertex index (in case the weight tables do not cover the whole vertices...). + * cmap might be NULL, in which case curve mapping mode will return unmodified data. + */ void weightvg_do_map(int num, float *new_w, short falloff_type, @@ -60,6 +68,14 @@ void weightvg_do_map(int num, struct CurveMapping *cmap, struct RNG *rng); +/** + * Applies new_w weights to org_w ones, using either a texture, vgroup or constant value as factor. + * Return values are in org_w. + * If indices is not NULL, it must be a table of same length as org_w and new_w, + * mapping to the real vertex index (in case the weight tables do not cover the whole vertices...). + * XXX The standard "factor" value is assumed in [0.0, 1.0] range. + * Else, weird results might appear. + */ void weightvg_do_mask(const ModifierEvalContext *ctx, const int num, const int *indices, @@ -78,6 +94,13 @@ void weightvg_do_mask(const ModifierEvalContext *ctx, const char *tex_uvlayer_name, const bool invert_vgroup_mask); +/** + * Applies weights to given vgroup (defgroup), and optionally add/remove vertices from the group. + * If dws is not NULL, it must be an array of #MDeformWeight pointers of same length as weights + * (and defgrp_idx can then have any value). + * If indices is not NULL, it must be an array of same length as weights, mapping to the real + * vertex index (in case the weight array does not cover the whole vertices...). + */ void weightvg_update_vg(struct MDeformVert *dvert, int defgrp_idx, struct MDeformWeight **dws, @@ -90,4 +113,7 @@ void weightvg_update_vg(struct MDeformVert *dvert, const float rem_thresh, const bool do_normalize); +/** + * Common vertex weight mask interface elements for the modifier panels. + */ void weightvg_ui_common(const bContext *C, PointerRNA *ob_ptr, PointerRNA *ptr, uiLayout *layout); |