[Bf-blender-cvs] [172143d] master: Cleanup: use doxy comments for deform.c
Campbell Barton
noreply at git.blender.org
Mon Feb 8 14:29:49 CET 2016
Commit: 172143d4f8f570068ad7de6f86a2c184b50cf094
Author: Campbell Barton
Date: Mon Feb 8 22:40:57 2016 +1100
Branches: master
https://developer.blender.org/rB172143d4f8f570068ad7de6f86a2c184b50cf094
Cleanup: use doxy comments for deform.c
===================================================================
M source/blender/blenkernel/BKE_deform.h
M source/blender/blenkernel/intern/deform.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index e716a7b..284080a 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -73,24 +73,29 @@ float BKE_defvert_multipaint_collective_weight(
const bool *defbase_sel, int defbase_tot_sel, bool do_autonormalize);
void defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src);
-void defvert_copy_subset(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
- const bool *vgroup_subset, const int vgroup_tot);
+void defvert_copy_subset(
+ struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
+ const bool *vgroup_subset, const int vgroup_tot);
void defvert_copy_index(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const int defgroup);
void defvert_sync(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const bool use_verify);
-void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
- const int *flip_map, const int flip_map_len, const bool use_verify);
+void defvert_sync_mapped(
+ struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src,
+ const int *flip_map, const int flip_map_len, const bool use_verify);
void defvert_remap(struct MDeformVert *dvert, int *map, const int map_len);
void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
void defvert_flip_merged(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
void defvert_normalize(struct MDeformVert *dvert);
-void defvert_normalize_subset(struct MDeformVert *dvert,
- const bool *vgroup_subset, const int vgroup_tot);
-void defvert_normalize_lock_single(struct MDeformVert *dvert,
- const bool *vgroup_subset, const int vgroup_tot,
- const int def_nr_lock);
-void defvert_normalize_lock_map(struct MDeformVert *dvert,
- const bool *vgroup_subset, const int vgroup_tot,
- const bool *lock_flags, const int defbase_tot);
+void defvert_normalize_subset(
+ struct MDeformVert *dvert,
+ const bool *vgroup_subset, const int vgroup_tot);
+void defvert_normalize_lock_single(
+ struct MDeformVert *dvert,
+ const bool *vgroup_subset, const int vgroup_tot,
+ const int def_nr_lock);
+void defvert_normalize_lock_map(
+ struct MDeformVert *dvert,
+ const bool *vgroup_subset, const int vgroup_tot,
+ const bool *lock_flags, const int defbase_tot);
/* Utilities to 'extract' a given vgroup into a simple float array, for verts, but also edges/polys/loops. */
void BKE_defvert_extract_vgroup_to_vertweights(
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 135bf3e..574aa49 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -107,12 +107,14 @@ bDeformGroup *defgroup_duplicate(bDeformGroup *ingroup)
return outgroup;
}
-/* overwrite weights filtered by vgroup_subset
+/**
+ * Overwrite weights filtered by vgroup_subset.
* - do nothing if neither are set.
* - add destination weight if needed
*/
-void defvert_copy_subset(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
- const bool *vgroup_subset, const int vgroup_tot)
+void defvert_copy_subset(
+ MDeformVert *dvert_dst, const MDeformVert *dvert_src,
+ const bool *vgroup_subset, const int vgroup_tot)
{
int defgroup;
for (defgroup = 0; defgroup < vgroup_tot; defgroup++) {
@@ -141,7 +143,8 @@ void defvert_copy(MDeformVert *dvert_dst, const MDeformVert *dvert_src)
}
}
-/* copy an index from one dvert to another
+/**
+ * Copy an index from one dvert to another.
* - do nothing if neither are set.
* - add destination weight if needed.
*/
@@ -166,7 +169,8 @@ void defvert_copy_index(MDeformVert *dvert_dst, const MDeformVert *dvert_src, co
}
}
-/* only sync over matching weights, don't add or remove groups
+/**
+ * Only sync over matching weights, don't add or remove groups
* warning, loop within loop.
*/
void defvert_sync(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool use_verify)
@@ -186,9 +190,12 @@ void defvert_sync(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bo
}
}
-/* be sure all flip_map values are valid */
-void defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
- const int *flip_map, const int flip_map_len, const bool use_verify)
+/**
+ * be sure all flip_map values are valid
+ */
+void defvert_sync_mapped(
+ MDeformVert *dvert_dst, const MDeformVert *dvert_src,
+ const int *flip_map, const int flip_map_len, const bool use_verify)
{
if (dvert_src->totweight && dvert_dst->totweight) {
int i;
@@ -207,7 +214,9 @@ void defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src,
}
}
-/* be sure all flip_map values are valid */
+/**
+ * be sure all flip_map values are valid
+ */
void defvert_remap(MDeformVert *dvert, int *map, const int map_len)
{
MDeformWeight *dw = dvert->dw;
@@ -291,10 +300,13 @@ void defvert_normalize(MDeformVert *dvert)
}
}
-/* Same as defvert_normalize() if the locked vgroup is not a member of the subset */
-void defvert_normalize_lock_single(MDeformVert *dvert,
- const bool *vgroup_subset, const int vgroup_tot,
- const int def_nr_lock)
+/**
+ * Same as defvert_normalize() if the locked vgroup is not a member of the subset
+ */
+void defvert_normalize_lock_single(
+ MDeformVert *dvert,
+ const bool *vgroup_subset, const int vgroup_tot,
+ const int def_nr_lock)
{
if (dvert->totweight == 0) {
/* nothing */
@@ -345,7 +357,9 @@ void defvert_normalize_lock_single(MDeformVert *dvert,
}
}
-/* Same as defvert_normalize() if no locked vgroup is a member of the subset */
+/**
+ * Same as defvert_normalize() if no locked vgroup is a member of the subset
+ */
void defvert_normalize_lock_map(
MDeformVert *dvert,
const bool *vgroup_subset, const int vgroup_tot,
@@ -449,7 +463,9 @@ int defgroup_name_index(Object *ob, const char *name)
return (name) ? BLI_findstringindex(&ob->defbase, name, offsetof(bDeformGroup, name)) : -1;
}
-/* note, must be freed */
+/**
+ * \note caller must free.
+ */
int *defgroup_flip_map(Object *ob, int *flip_map_len, const bool use_default)
{
int defbase_tot = *flip_map_len = BLI_listbase_count(&ob->defbase);
@@ -488,7 +504,9 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, const bool use_default)
}
}
-/* note, must be freed */
+/**
+ * \note caller must free.
+ */
int *defgroup_flip_map_single(Object *ob, int *flip_map_len, const bool use_default, int defgroup)
{
int defbase_tot = *flip_map_len = BLI_listbase_count(&ob->defbase);
@@ -573,8 +591,10 @@ static bool is_char_sep(const char c)
return ELEM(c, '.', ' ', '-', '_');
}
-/* based on BLI_split_dirfile() / os.path.splitext(), "a.b.c" -> ("a.b", ".c") */
-
+/**
+ * based on `BLI_split_dirfile()` / `os.path.splitext()`,
+ * `"a.b.c"` -> (`"a.b"`, `".c"`).
+ */
void BKE_deform_split_suffix(const char string[MAX_VGROUP_NAME], char body[MAX_VGROUP_NAME], char suf[MAX_VGROUP_NAME])
{
size_t len = BLI_strnlen(string, MAX_VGROUP_NAME);
@@ -593,7 +613,9 @@ void BKE_deform_split_suffix(const char string[MAX_VGROUP_NAME], char body[MAX_V
memcpy(body, string, len + 1);
}
-/* "a.b.c" -> ("a.", "b.c") */
+/**
+ * `"a.b.c"` -> (`"a."`, `"b.c"`)
+ */
void BKE_deform_split_prefix(const char string[MAX_VGROUP_NAME], char pre[MAX_VGROUP_NAME], char body[MAX_VGROUP_NAME])
{
size_t len = BLI_strnlen(string, MAX_VGROUP_NAME);
@@ -613,9 +635,13 @@ void BKE_deform_split_prefix(const char string[MAX_VGROUP_NAME], char pre[MAX_VG
BLI_strncpy(body, string, len);
}
-/* finds the best possible flipped name. For renaming; check for unique names afterwards */
-/* if strip_number: removes number extensions
- * note: don't use sizeof() for 'name' or 'from_name' */
+/**
+ * Finds the best possible flipped name. For renaming; check for unique names afterwards.
+ *
+ * if strip_number: removes number extensions
+ *
+ * \note don't use sizeof() for 'name' or 'from_name'.
+ */
void BKE_deform_flip_side_name(char name[MAX_VGROUP_NAME], const char from_name[MAX_VGROUP_NAME],
const bool strip_number)
{
@@ -745,7 +771,8 @@ float defvert_find_weight(const struct MDeformVert *dvert, const int defgroup)
return dw ? dw->weight : 0.0f;
}
-/* take care with this the rationale is:
+/**
+ * Take care with this the rationale is:
* - if the object has no vertex group. act like vertex group isn't set and return 1.0,
* - if the vertex group exists but the 'defgroup' isn't found on this vertex, _still_ return 0.0
*
@@ -779,8 +806,11 @@ MDeformWeight *defvert_find_index(const MDeformVert *dvert, const int defgroup)
return NULL;
}
-/* Ensures that mv has a deform weight entry for the specified defweight group */
-/* Note this function is mirrored in editmesh_tools.c, for use for editvertices */
+/**
+ * Ensures that mv has a deform weight entry for the specified defweight group.
+ *
+ * \note this function is mirrored in editmesh_tools.c, for use for editvertices.
+ */
MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
{
MDeformWeight *dw_new;
@@ -813,8 +843,11 @@ MDeformWeight *defvert_verify_index(MDeformVert *dvert, const int defgroup)
/* TODO. merge with code above! */
-/* Adds the given vertex to the specified vertex group, with given weight.
- * warning, this does NOT check for existing, assume caller already knows its not there */
+/**
+ * Adds the given vertex to the specified vertex group, with given weight.
+ *
+ * \warning this does NOT check for existing, assume caller already knows its not there.
+ */
void defvert_add_index_notest(MDeformVert *dvert,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list