Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-02-22 08:09:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-22 08:09:04 +0400
commitb00c3b801bf07a67b98b604ee834e2d93dff0f39 (patch)
treecb7c4c4aacdec65b6d5ee2b79891f64bffc34f08 /source/blender/blenkernel/intern/deform.c
parent6bac47f8544a6bdc66d439d1d61b4a850d4ad20a (diff)
new weight paint draw option to display unweighted vertices with the option to check on the active group or all groups.
notes: - vertices with zero weights are considered the same as vertices outside of a group. - currently these show black but this can be made a theme color. - multi-paint overrides this option (noted in description)
Diffstat (limited to 'source/blender/blenkernel/intern/deform.c')
-rw-r--r--source/blender/blenkernel/intern/deform.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index de15100de0b..439180e8d76 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -41,14 +41,13 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
-#include "BKE_deform.h"
-
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
+#include "BKE_deform.h" /* own include */
void defgroup_copy_list(ListBase *outbase, ListBase *inbase)
{
@@ -787,6 +786,24 @@ int defvert_find_shared(const MDeformVert *dvert_a, const MDeformVert *dvert_b)
return -1;
}
+/**
+ * return true if has no weights
+ */
+bool defvert_is_weight_zero(const struct MDeformVert *dvert, const int defgroup_tot)
+{
+ MDeformWeight *dw = dvert->dw;
+ unsigned int i;
+ for (i = dvert->totweight; i != 0; i--, dw++) {
+ if (dw->weight != 0.0f) {
+ /* check the group is in-range, happens on rare situations */
+ if (LIKELY(dw->def_nr < defgroup_tot)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
/* -------------------------------------------------------------------- */
/* Defvert Array functions */