136 for (
int i = 0; i < dvert_tot; i++) {
138 for (
int j = 0; j < dv->
totweight; j++) {
151 const bool use_vert_sel)
169 if (cd_dvert_offset == -1) {
175 *dvert_arr =
MEM_mallocN(
sizeof(
void *) * i,
"vgroup parray from me");
204 for (
int i = 0; i < me->
totvert; i++) {
209 for (
int i = 0; i < me->
totvert; i++) {
210 (*dvert_arr)[i] = me->
dvert + i;
225 *dvert_arr =
MEM_mallocN(
sizeof(
void *) * (*dvert_tot),
"vgroup parray from me");
228 for (
int i = 0; i < *dvert_tot; i++) {
233 for (
int i = 0; i < *dvert_tot; i++) {
234 (*dvert_arr)[i] = lt->
dvert + i;
254 const bool *vgroup_validmap,
255 const int vgroup_tot)
273 for (
int i_src = 0; i_src < dvert_tot; i_src++) {
274 if (dvert_array[i_src] !=
NULL) {
277 if (i_dst != -1 && dvert_array_all[i_dst] !=
NULL) {
283 dv_dst, dv_src, vgroup_validmap, vgroup_tot, flip_map, flip_map_len);
285 dvert_array[i_dst] = dvert_array_all[i_dst];
310 for (
int i = 0; i < dvert_tot; i++) {
311 if (dvert_array[i] ==
NULL) {
314 if ((i_sel != -1) && (i_sel != i) && (dvert_array[i_sel])) {
316 dvert_array[i] = dvert_array_all[i];
326 const bool *vgroup_validmap,
327 const int vgroup_tot,
329 const bool keep_single)
333 for (
int i = 0; i < dvert_tot; i++) {
335 if (!(dv = dvert_array[i])) {
349 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
370 bool new_vgroup =
false;
384 if ((dvert_array ==
NULL) && (dvert_array_from !=
NULL) &&
390 if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from ==
NULL ||
391 dvert_array ==
NULL) {
395 if (dvert_array_from) {
399 if (new_vgroup ==
true) {
405 return (dvert_tot == dvert_tot_from);
414 if (defbase_tot_from < defbase_tot) {
416 int *remap =
MEM_mallocN(
sizeof(
int) * (defbase_tot + 1), __func__);
417 for (i = 0; i <= defbase_tot_from; i++) {
420 for (; i <= defbase_tot; i++) {
428 if (dvert_array_from !=
NULL && dvert_array !=
NULL) {
429 dvf = dvert_array_from;
432 for (i = 0; i < dvert_tot; i++, dvf++, dv++) {
450 float *dvert_weights,
453 for (
int i = 0; i < dvert_tot; i++) {
461 const float *dvert_weights,
463 const bool remove_zero)
467 for (i = 0; i < dvert_tot; i++) {
470 if (dvert_weights[i] > 0.0f) {
473 dw->
weight = dvert_weights[i];
514 Object *ob,
BMVert *eve,
int def_nr,
int vidx,
const int cd_dvert_offset)
523 if (eve_mirr && eve_mirr != eve) {
542 if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
592 int subset_count, vgroup_tot;
593 const bool *vgroup_validmap;
602 if (dvert_act ==
NULL) {
607 ob, subset_type, &vgroup_tot, &subset_count);
629 int i, vgroup_tot, subset_count;
631 ob, subset_type, &vgroup_tot, &subset_count);
658 for (i = 0; i < me->
totvert; i++, dv++) {
683 "Selected Pose Bones",
684 "All Vertex Groups assigned to Selection"},
689 "All Vertex Groups assigned to Deform Bones"},
690 {
WT_VGROUP_ALL,
"ALL", 0,
"All Groups",
"All Vertex Groups"},
698 const uint selection_mask)
772 "Define which subset of groups shall be used");
797 Object *ob,
const int def_nr,
const int vertnum,
const float weight,
const int assignmode)
811 if ((vertnum < 0) || (vertnum >= tot)) {
822 switch (assignmode) {
844 switch (assignmode) {
931 if (cd_dvert_offset != -1 && vertnum < em->
bm->
totvert) {
946 dv = &me->
dvert[vertnum];
957 dv = <->
dvert[vertnum];
1013 if (cd_dvert_offset != -1) {
1044 for (i = 0; i < me->
totvert; i++,
mv++, dv++) {
1072 for (
a = 0, bp = lt->
def;
a < tot;
a++, bp++, dv++) {
1079 if (actbp && bp == actbp) {
1092 char name[
sizeof(dg->
name)];
1095 int i, idg, icdg, dvert_tot = 0;
1104 if (!strstr(dg->
name,
"_copy")) {
1125 for (i = 0; i < dvert_tot; i++) {
1130 const float weight = dw_org->weight;
1132 dw_cpy->weight = weight;
1157 float weight_max = 0.0f;
1159 for (
int i = 0; i < dvert_tot; i++) {
1162 if (!(dv = dvert_array[i])) {
1172 if (weight_max > 0.0f) {
1173 for (
int i = 0; i < dvert_tot; i++) {
1176 if (!(dv = dvert_array[i])) {
1182 dw->
weight /= weight_max;
1214 int first_l = mp->
totloop - 1;
1219 if (ml->
v == vert) {
1239 while (k-- && !(
a ==
b &&
a == -1)) {
1243 else if (
verts[k] ==
b) {
1275 for (i = 0; i <
count; i++) {
1287 const float coord[3],
1288 const float start[3],
1291 float (*changes)[2],
1297 float projA[3], projB[3];
1308 changes[index][0] = dists[index] - distToStart;
1311 changes[index][1] =
len_v3v3(projA, projB);
1328 const float norm[3],
1329 const float coord[3],
1346 float oldPos[3] = {0};
1347 float vc, hc, dist = 0.0f;
1349 float(*changes)[2] =
MEM_mallocN(
sizeof(
float[2]) * totweight,
"vertHorzChange");
1350 float *dists =
MEM_mallocN(
sizeof(
float) * totweight,
"distance");
1353 bool *upDown =
MEM_callocN(
sizeof(
bool) * totweight,
"upDownTracker");
1355 int *dwIndices =
MEM_callocN(
sizeof(
int) * totweight,
"dwIndexTracker");
1361 float originalDistToBe = distToBe;
1365 m = me_deform->mvert[index];
1369 if (distToBe == originalDistToBe) {
1370 distToBe += distToStart - distToStart * strength;
1372 for (i = 0; i < totweight; i++) {
1374 dw = (dvert->dw + i);
1375 dw_eval = (dvert_eval->dw + i);
1380 dists[i] = distToStart;
1383 for (k = 0; k < 2; k++) {
1391 dw->weight *= 1 + cp;
1394 dw->weight /= 1 + cp;
1396 if (dw->weight == oldw) {
1399 dists[i] = distToStart;
1402 if (dw->weight > 1) {
1405 dw_eval->weight = dw->weight;
1407 m = me_deform->mvert[index];
1409 norm, d, coord, oldPos, distToStart, m.co, changes, dists, i);
1411 dw_eval->weight = oldw;
1418 if (
fabsf(dist - distToBe) <
fabsf(dists[i] - distToBe)) {
1427 if (
fabsf(dists[i] - distToBe) >
fabsf(distToStart - distToBe)) {
1430 dists[i] = distToStart;
1436 for (k = 0; k < totweight; k++) {
1438 for (i = k + 1; i < totweight; i++) {
1446 if (bestIndex != k) {
1447 SWAP(
bool, upDown[k], upDown[bestIndex]);
1448 SWAP(
int, dwIndices[k], dwIndices[bestIndex]);
1450 SWAP(
float, dists[k], dists[bestIndex]);
1455 for (i = 0; i < totweight; i++) {
1456 if (
fabsf(changes[i][0]) >
fabsf(changes[i][1] * 2.0f)) {
1461 if (bestIndex != -1) {
1465 if (lastIndex != -1) {
1466 if (wasUp != upDown[bestIndex]) {
1470 lastIndex = bestIndex;
1471 wasUp = upDown[bestIndex];
1472 dw = (dvert->dw + dwIndices[bestIndex]);
1474 if (upDown[bestIndex]) {
1475 dw->weight *= 1 + cp;
1478 dw->weight /= 1 + cp;
1480 if (dw->weight > 1) {
1483 if (oldw == dw->weight) {
1492 }
while (wasChange && ((distToStart - distToBe) /
fabsf(distToStart - distToBe) ==
1493 (dists[bestIndex] - distToBe) /
fabsf(dists[bestIndex] - distToBe)));
1517 for (i = 0; i < me->
totvert && mvert; i++, mvert++) {
1537 m = me_deform->
mvert[i];
1544 depsgraph, scene_eval, object_eval, me, i,
norm, coord, d, distToBe, strength, cp);
1556 const bool *vgroup_validmap,
1557 const int vgroup_tot,
1558 const int UNUSED(subset_count),
1575 for (
int i = 0; i < dvert_tot; i++) {
1577 if (!(dv = dvert_array[i])) {
1583 if (vgroup_validmap[j]) {
1594 if (use_mirror && use_vert_sel) {
1603 const bool *vgroup_validmap,
1604 const int vgroup_tot,
1605 const int subset_count,
1606 const bool lock_active,
1610 int i, dvert_tot = 0;
1615 if (subset_count == 0) {
1626 bool changed =
false;
1628 if ((lock_active ==
true) && (lock_flags !=
NULL) && (def_nr < defbase_tot)) {
1629 lock_flags[def_nr] =
true;
1633 for (i = 0; i < defbase_tot; i++) {
1634 if (lock_flags[i] ==
false) {
1639 if (i == defbase_tot) {
1645 for (i = 0; i < dvert_tot; i++) {
1647 if ((dv = dvert_array[i])) {
1651 else if (lock_active) {
1687 "Unlock all vertex groups if there is at least one locked group, lock all in other case"},
1688 {
VGROUP_LOCK,
"LOCK", 0,
"Lock",
"Lock all vertex groups"},
1689 {
VGROUP_UNLOCK,
"UNLOCK", 0,
"Unlock",
"Unlock all vertex groups"},
1690 {
VGROUP_INVERT,
"INVERT", 0,
"Invert",
"Invert the lock state of all vertex groups"},
1702 {
VGROUP_MASK_ALL,
"ALL", 0,
"All",
"Apply action to all vertex groups"},
1706 "INVERT_UNSELECTED",
1708 "Invert Unselected",
1709 "Apply the opposite of Lock/Unlock to unselected vertex groups"},
1733 if (sel_count == 0 && actdef >= 1 && actdef <= defbase_tot) {
1734 mask[actdef - 1] =
true;
1743 bool *selected =
NULL;
1754 for (dg = defbase->
first, i = 0; dg; dg = dg->
next, i++) {
1777 for (dg = defbase->
first, i = 0; dg; dg = dg->
next, i++) {
1815 const bool *vgroup_validmap,
1816 const int vgroup_tot,
1817 const int UNUSED(subset_count),
1818 const bool auto_assign,
1819 const bool auto_remove)
1832 for (
int i = 0; i < dvert_tot; i++) {
1834 if (!(dv = dvert_array[i])) {
1841 if (vgroup_validmap[j]) {
1857 if (use_mirror && use_vert_sel) {
1863 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot, 0.0f,
false);
1871 const bool *vgroup_validmap,
1872 const int vgroup_tot,
1873 const int subset_count,
1876 const float fac_expand)
1878 const float ifac = 1.0f - fac;
1881 int *vgroup_subset_map =
BLI_array_alloca(vgroup_subset_map, subset_count);
1882 float *vgroup_subset_weights =
BLI_array_alloca(vgroup_subset_weights, subset_count);
1887 const bool use_hide = use_select;
1889 const int expand_sign =
signum_i(fac_expand);
1890 const float expand =
fabsf(fac_expand);
1891 const float iexpand = 1.0f - expand;
1900 float *weight_accum_prev;
1901 float *weight_accum_curr;
1911 memset(vgroup_subset_weights, 0,
sizeof(*vgroup_subset_weights) * subset_count);
1924 weight_accum_prev =
MEM_mallocN(
sizeof(*weight_accum_prev) * dvert_tot, __func__);
1925 weight_accum_curr =
MEM_mallocN(
sizeof(*weight_accum_curr) * dvert_tot, __func__);
1927 verts_used =
MEM_mallocN(
sizeof(*verts_used) * dvert_tot, __func__);
1930 #define IS_BM_VERT_READ(v) (use_hide ? (BM_elem_flag_test(v, BM_ELEM_HIDDEN) == 0) : true)
1931 #define IS_BM_VERT_WRITE(v) (use_select ? (BM_elem_flag_test(v, BM_ELEM_SELECT) != 0) : true)
1933 #define IS_ME_VERT_READ(v) (use_hide ? (((v)->flag & ME_HIDE) == 0) : true)
1934 #define IS_ME_VERT_WRITE(v) (use_select ? (((v)->flag & SELECT) != 0) : true)
1938 for (
int i = 0; i < dvert_tot; i++) {
1954 for (
int i = 0; i < dvert_tot; i++) {
1957 for (
int j = 0; j < emap[i].
count; j++) {
1959 const MVert *v_other = &me->
mvert[(
e->v1 == i) ?
e->v2 :
e->v1];
1969 for (subset_index = 0; subset_index < subset_count; subset_index++) {
1970 const int def_nr = vgroup_subset_map[subset_index];
1974 (
const MDeformVert **)dvert_array, dvert_tot, weight_accum_prev, def_nr);
1975 memcpy(weight_accum_curr, weight_accum_prev,
sizeof(*weight_accum_curr) * dvert_tot);
1977 for (iter = 0; iter < repeat; iter++) {
1982 for (vi_step = verts_used; vi_step != vi_end; vi_step++) {
1983 const uint i = *vi_step;
1984 float weight_tot = 0.0f;
1985 float weight = 0.0f;
1987 #define WEIGHT_ACCUMULATE \
1989 float weight_other = weight_accum_prev[i_other]; \
1990 float tot_factor = 1.0f; \
1991 if (expand_sign == 1) { \
1992 if (weight_other < weight_accum_prev[i]) { \
1993 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1994 tot_factor = iexpand; \
1997 else if (expand_sign == -1) { \
1998 if (weight_other > weight_accum_prev[i]) { \
1999 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
2000 tot_factor = iexpand; \
2003 weight += tot_factor * weight_other; \
2004 weight_tot += tot_factor; \
2031 for (j = 0; j < emap[i].
count; j++) {
2033 const int i_other = (
e->v1 == i ?
e->v2 :
e->v1);
2042 #undef WEIGHT_ACCUMULATE
2044 if (weight_tot != 0.0f) {
2045 weight /= weight_tot;
2046 weight = (weight_accum_prev[i] * ifac) + (weight * fac);
2049 CLAMP(weight, 0.0f, 1.0f);
2050 weight_accum_curr[i] = weight;
2054 SWAP(
float *, weight_accum_curr, weight_accum_prev);
2060 #undef IS_BM_VERT_READ
2061 #undef IS_BM_VERT_WRITE
2062 #undef IS_ME_VERT_READ
2063 #undef IS_ME_VERT_WRITE
2101 if (dw1->
weight < dw2->weight) {
2104 if (dw1->
weight > dw2->weight) {
2118 const bool *vgroup_validmap,
2119 const int vgroup_tot,
2120 const int subset_count,
2121 const int max_weights)
2124 int i, dvert_tot = 0;
2131 int num_to_drop = 0;
2133 for (i = 0; i < dvert_tot; i++) {
2136 int bone_count = 0, non_bone_count = 0;
2140 if (!(dv = dvert_array[i])) {
2144 num_to_drop = subset_count - max_weights;
2147 if (num_to_drop > 0) {
2155 dw_temp[dv->
totweight - 1 - bone_count] = dv->
dw[j];
2159 dw_temp[non_bone_count] = dv->
dw[j];
2160 non_bone_count += 1;
2164 num_to_drop = bone_count - max_weights;
2165 if (num_to_drop > 0) {
2166 qsort(&dw_temp[non_bone_count],
2174 remove_tot += num_to_drop;
2188 const bool *vgroup_validmap,
2189 const int vgroup_tot,
2190 const int UNUSED(subset_count),
2192 const bool keep_single)
2204 if (use_mirror && use_vert_sel) {
2212 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot,
epsilon, keep_single);
2219 const bool *vgroup_validmap,
2220 const int vgroup_tot,
2221 const int UNUSED(subset_count),
2233 const float steps_fl =
steps;
2236 if (use_mirror && use_vert_sel) {
2240 for (
int i = 0; i < dvert_tot; i++) {
2244 if (!(dv = dvert_array[i])) {
2249 for (j = 0, dw = dv->
dw; j < dv->totweight; j++, dw++) {
2250 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
2264 const char sel_mirr,
2265 const int *flip_map,
2266 const int flip_map_len,
2267 const bool mirror_weights,
2268 const bool flip_vgroups,
2269 const bool all_vgroups,
2270 const int act_vgroup)
2274 if (sel_mirr && sel) {
2276 if (mirror_weights) {
2284 if (dw && dw_mirr) {
2311 if (mirror_weights) {
2328 const bool mirror_weights,
2329 const bool flip_vgroups,
2330 const bool all_vgroups,
2331 const bool use_topology,
2338 #define VGROUP_MIRR_OP \
2339 dvert_mirror_op(dvert, \
2353 int *flip_map =
NULL, flip_map_len;
2355 int totmirr = 0, totfail = 0;
2357 *r_totmirr = *r_totfail = 0;
2361 if ((mirror_weights ==
false && flip_vgroups ==
false) ||
2372 if (flip_map ==
NULL) {
2391 if (cd_dvert_offset == -1) {
2403 if (eve_mirr != eve) {
2408 if ((sel || sel_mirr) && (eve != eve_mirr)) {
2432 int vidx, vidx_mirr;
2439 if (!use_vert_sel) {
2440 sel = sel_mirr =
true;
2445 for (vidx = 0,
mv = me->
mvert; vidx < me->totvert; vidx++,
mv++) {
2448 if (vidx != vidx_mirr) {
2449 mv_mirr = &me->
mvert[vidx_mirr];
2457 if (sel || sel_mirr) {
2458 dvert = &me->
dvert[vidx];
2459 dvert_mirr = &me->
dvert[vidx_mirr];
2493 pntsu_half = lt->
pntsu / 2;
2497 for (u = 0; u < pntsu_half; u++) {
2498 int u_inv = (lt->
pntsu - 1) - u;
2506 bp_mirr = <->
def[i2];
2511 if (sel || sel_mirr) {
2513 dvert_mirr = <->
dvert[i2];
2527 if (flip_vgroups && flip_map[
def_nr] >= 0) {
2528 ob->actdef = flip_map[
def_nr] + 1;
2533 *r_totmirr = totmirr;
2534 *r_totfail = totfail;
2540 #undef VGROUP_MIRR_OP
2569 int cd_dvert_offset;
2601 for (
int i = 0; i < me->
totvert; i++,
mv++, dv++) {
2625 for (
a = 0, bp = lt->
def;
a < tot;
a++, bp++, dv++) {
2736 const bool needs_select,
2737 const short ob_type_flag)
2745 if (ob_type_flag && (((1 << ob->
type) & ob_type_flag)) == 0) {
2766 static bool vertex_group_vert_poll(
bContext *
C)
2783 static bool vertex_group_mesh_vert_select_poll(
bContext *
C)
2851 ot->
name =
"Add Vertex Group";
2852 ot->
idname =
"OBJECT_OT_vertex_group_add";
2853 ot->
description =
"Add a new vertex group to the active object";
2894 ot->
name =
"Remove Vertex Group";
2895 ot->
idname =
"OBJECT_OT_vertex_group_remove";
2896 ot->
description =
"Delete the active or all vertex groups from the active object";
2912 ot->
srna,
"all_unlocked", 0,
"All Unlocked",
"Remove all unlocked vertex groups");
2937 ot->
name =
"Assign to Vertex Group";
2938 ot->
idname =
"OBJECT_OT_vertex_group_assign";
2939 ot->
description =
"Assign the selected vertices to the active vertex group";
2972 ot->
name =
"Assign to New Group";
2973 ot->
idname =
"OBJECT_OT_vertex_group_assign_new";
2974 ot->
description =
"Assign the selected vertices to a new vertex group";
3000 if (use_all_groups) {
3023 ot->
name =
"Remove from Vertex Group";
3024 ot->
idname =
"OBJECT_OT_vertex_group_remove_from";
3025 ot->
description =
"Remove the selected vertices from active or all vertex group(s)";
3068 ot->
name =
"Select Vertex Group";
3069 ot->
idname =
"OBJECT_OT_vertex_group_select";
3070 ot->
description =
"Select all the vertices assigned to the active vertex group";
3100 ot->
name =
"Deselect Vertex Group";
3101 ot->
idname =
"OBJECT_OT_vertex_group_deselect";
3102 ot->
description =
"Deselect all selected vertices assigned to the active vertex group";
3134 ot->
name =
"Copy Vertex Group";
3135 ot->
idname =
"OBJECT_OT_vertex_group_copy";
3160 int subset_count, vgroup_tot;
3163 ob, subset_type, &vgroup_tot, &subset_count);
3177 ot->
name =
"Vertex Group Levels";
3178 ot->
idname =
"OBJECT_OT_vertex_group_levels";
3180 "Add some offset and multiply with some gain the weights of the active vertex group";
3191 ot->
srna,
"offset", 0.0f, -1.0, 1.0,
"Offset",
"Value to add to weights", -1.0f, 1.0f);
3193 ot->
srna,
"gain", 1.0f, 0.0f, FLT_MAX,
"Gain",
"Value to multiply weights by", 0.0f, 10.0f);
3222 ot->
name =
"Normalize Vertex Group";
3223 ot->
idname =
"OBJECT_OT_vertex_group_normalize";
3225 "Normalize weights of the active vertex group, so that the highest ones are now 1.0";
3247 int subset_count, vgroup_tot;
3249 ob, subset_type, &vgroup_tot, &subset_count);
3252 ob, vgroup_validmap, vgroup_tot, subset_count, lock_active, op->
reports);
3270 ot->
name =
"Normalize All Vertex Groups";
3271 ot->
idname =
"OBJECT_OT_vertex_group_normalize_all";
3273 "Normalize all weights of all vertex groups, "
3274 "so that for each vertex, the sum of all weights is 1.0";
3288 "Keep the values of the active group while normalizing others");
3317 "This operator does not support an active mirror modifier");
3332 ot->
name =
"Fix Vertex Group Deform";
3333 ot->
idname =
"OBJECT_OT_vertex_group_fix";
3335 "Modify the position of selected vertices by changing only their respective "
3336 "groups' weights (this tool may be slow for many vertices)";
3350 "The distance to move to",
3359 "The distance moved can be changed by this multiplier",
3368 "Change Sensitivity",
3369 "Change the amount weights are altered with each iteration: lower values are slower",
3401 const char *action_str, *target_str;
3405 action_str =
TIP_(
"Lock");
3408 action_str =
TIP_(
"Unlock");
3411 action_str =
TIP_(
"Toggle locks of");
3414 action_str =
TIP_(
"Invert locks of");
3422 target_str =
TIP_(
"all");
3425 target_str =
TIP_(
"selected");
3428 target_str =
TIP_(
"unselected");
3433 target_str =
TIP_(
"selected");
3436 target_str =
TIP_(
"selected and unlock unselected");
3439 target_str =
TIP_(
"selected and lock unselected");
3442 target_str =
TIP_(
"all and invert unselected");
3449 return BLI_sprintfN(
TIP_(
"%s %s vertex groups of the active object"), action_str, target_str);
3455 ot->
name =
"Change the Lock On Vertex Groups";
3456 ot->
idname =
"OBJECT_OT_vertex_group_lock";
3457 ot->
description =
"Change the lock state of all or some vertex groups of active object";
3472 "Lock action to execute on vertex groups");
3479 "Apply the action based on vertex group selection");
3496 int subset_count, vgroup_tot;
3499 ob, subset_type, &vgroup_tot, &subset_count);
3513 ot->
name =
"Invert Vertex Group";
3514 ot->
idname =
"OBJECT_OT_vertex_group_invert";
3529 "Add vertices from groups that have zero weight before inverting");
3534 "Remove vertices from groups that have zero weight after inverting");
3553 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3554 Object *ob = objects[ob_index];
3556 int subset_count, vgroup_tot;
3559 ob, subset_type, &vgroup_tot, &subset_count);
3576 ot->
name =
"Smooth Vertex Weights";
3577 ot->
idname =
"OBJECT_OT_vertex_group_smooth";
3597 "Expand/contract weights",
3617 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3618 Object *ob = objects[ob_index];
3620 int subset_count, vgroup_tot;
3623 ob, subset_type, &vgroup_tot, &subset_count);
3640 ot->
name =
"Clean Vertex Group Weights";
3641 ot->
idname =
"OBJECT_OT_vertex_group_clean";
3642 ot->
description =
"Remove vertex group assignments which are not required";
3658 "Remove vertices which weight is below or equal to this limit",
3665 "Keep verts assigned to at least one group when cleaning");
3681 int subset_count, vgroup_tot;
3684 ob, subset_type, &vgroup_tot, &subset_count);
3698 ot->
name =
"Quantize Vertex Weights";
3699 ot->
idname =
"OBJECT_OT_vertex_group_quantize";
3710 RNA_def_int(
ot->
srna,
"steps", 4, 1, 1000,
"Steps",
"Number of steps between 0 and 1", 1, 100);
3723 int remove_multi_count = 0;
3727 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3728 Object *ob = objects[ob_index];
3730 int subset_count, vgroup_tot;
3732 ob, subset_type, &vgroup_tot, &subset_count);
3734 ob, vgroup_validmap, vgroup_tot, subset_count, limit);
3737 if (remove_count != 0) {
3742 remove_multi_count += remove_count;
3746 if (remove_multi_count) {
3749 "%d vertex weights limited",
3750 remove_multi_count);
3763 ot->
name =
"Limit Number of Weights per Vertex";
3764 ot->
idname =
"OBJECT_OT_vertex_group_limit_total";
3766 "Limit deform weights associated with a vertex to a specified number by removing lowest "
3777 RNA_def_int(
ot->
srna,
"limit", 4, 1, 32,
"Limit",
"Maximum number of deform weights", 1, 32);
3789 int totmirr = 0, totfail = 0;
3812 ot->
name =
"Mirror Vertex Group";
3813 ot->
idname =
"OBJECT_OT_vertex_group_mirror";
3815 "Mirror vertex group, flip weights and/or names, editing only selected vertices, "
3816 "flipping when both sides are selected otherwise copy from unselected";
3828 ot->
srna,
"flip_group_names",
true,
"Flip Group Names",
"Flip vertex group names");
3835 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
3847 int changed_tot = 0;
3865 if ((changed_tot == 0 && fail == 0) || fail) {
3868 "Copy vertex groups to selected: %d done, %d failed (object data must support "
3869 "vertex groups and have matching indices)",
3880 ot->
name =
"Copy Vertex Group to Selected";
3881 ot->
idname =
"OBJECT_OT_vertex_group_copy_to_selected";
3882 ot->
description =
"Replace vertex groups of selected objects by vertex groups of active object";
3932 for (
a = 0, def = defbase->
first; def; def = def->
next,
a++) {
3934 tmp.
icon = ICON_GROUP_VERTEX;
3951 ot->
name =
"Set Active Vertex Group";
3952 ot->
idname =
"OBJECT_OT_vertex_group_set_active";
4003 int *sort_map_update =
MEM_mallocN(
sizeof(
int) * (defbase_tot + 1),
"sort vgroups");
4004 int *sort_map = sort_map_update + 1;
4010 for (def = defbase->
first, i = 0; def; def = def->
next, i++) {
4022 if (cd_dvert_offset != -1) {
4050 dvert_tot = gps->totpoints;
4052 while (dvert_tot--) {
4068 while (dvert_tot--) {
4079 for (i = 0; i < defbase_tot; i++) {
4083 sort_map_update[0] = 0;
4109 if (bonebase ==
NULL) {
4111 if (armobj !=
NULL) {
4118 if (bonebase !=
NULL) {
4120 for (bone = bonebase->
last; bone; bone = bone->
prev) {
4150 switch (sort_type) {
4182 ot->
name =
"Sort Vertex Groups";
4183 ot->
idname =
"OBJECT_OT_vertex_group_sort";
4238 {-1,
"UP", 0,
"Up",
""},
4239 {1,
"DOWN", 0,
"Down",
""},
4244 ot->
name =
"Move Vertex Group";
4245 ot->
idname =
"OBJECT_OT_vertex_group_move";
4246 ot->
description =
"Move the active vertex group up/down in the list";
4260 "Direction to move the active vertex group towards");
4283 if (dvert_act ==
NULL) {
4308 if (dvert_act ==
NULL) {
4313 for (i = 0; i < me->
totvert; i++, dv++) {
4369 ot->
name =
"Paste Weight to Selected";
4370 ot->
idname =
"OBJECT_OT_vertex_weight_paste";
4372 "Copy this group's weight to other selected vertices (disabled if vertex group is locked)";
4387 "Index of source weight in active vertex group",
4420 ot->
name =
"Delete Weight";
4421 ot->
idname =
"OBJECT_OT_vertex_weight_delete";
4422 ot->
description =
"Delete this weight from the vertex (disabled if vertex group is locked)";
4437 "Index of source weight in active vertex group",
4454 if (wg_index != -1) {
4467 ot->
name =
"Set Active Group";
4468 ot->
idname =
"OBJECT_OT_vertex_weight_set_active";
4484 "Index of source weight in active vertex group",
4517 ot->
name =
"Normalize Active";
4518 ot->
idname =
"OBJECT_OT_vertex_weight_normalize_active_vertex";
4552 ot->
name =
"Copy Active";
4553 ot->
idname =
"OBJECT_OT_vertex_weight_copy";
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
#define CTX_DATA_BEGIN(C, Type, instance, member)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const struct CustomData *data, int type)
const CustomData_MeshMasks CD_MASK_BAREMESH
int CustomData_get_offset(const struct CustomData *data, int type)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
struct BPoint * BKE_lattice_active_point_get(struct Lattice *lt)
int BKE_lattice_index_from_uvw(struct Lattice *lt, int u, int v, int w)
struct Mesh * BKE_mesh_from_object(struct Object *ob)
void BKE_mesh_vert_edge_map_create(MeshElemMap **r_map, int **r_mem, const struct MEdge *medge, int totvert, int totedge)
struct Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Object * BKE_modifiers_is_deformed_by_armature(struct Object *ob)
General operations, lookup, etc. for blender objects.
struct Object * BKE_object_pose_armature_get(struct Object *ob)
bool BKE_object_is_in_wpaint_select_vert(const struct Object *ob)
bool BKE_object_is_in_editmode_vgroup(const struct Object *ob)
void BKE_object_free_derived_caches(struct Object *ob)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
#define BLI_array_alloca(arr, realsize)
A (mainly) macro array library.
#define BLI_array_append(arr, item)
#define BLI_array_reserve(arr, num)
#define BLI_array_declare(arr)
#define BLI_array_len(arr)
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findstringindex(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
MINLINE int signum_i(float a)
void plane_from_point_normal_v3(float r_plane[4], const float plane_co[3], const float plane_no[3])
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void swap_v2_v2(float a[2], float b[2])
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define UNUSED_FUNCTION(x)
#define IN_RANGE_INCL(a, b, c)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me)
Object is a sort of wrapper for general info.
#define OB_TYPE_SUPPORT_VGROUP(_type)
#define WT_VGROUP_MASK_ALL
@ RPT_ERROR_INVALID_CONTEXT
struct MDeformVert * ED_mesh_active_dvert_get_ob(struct Object *ob, int *r_index)
struct BMVert * editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index, bool use_topology)
struct MDeformVert * ED_mesh_active_dvert_get_em(struct Object *ob, struct BMVert **r_eve)
void paintvert_flush_flags(struct Object *ob)
void EDBM_select_flush(struct BMEditMesh *em)
struct BMVert * EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v)
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em)
void ED_mesh_report_mirror(struct wmOperator *op, int totmirr, int totfail)
struct MDeformVert * ED_mesh_active_dvert_get_only(struct Object *ob)
int ED_mesh_mirror_get_vert(struct Object *ob, int index)
void EDBM_deselect_flush(struct BMEditMesh *em)
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, bool use_topology)
struct Object * ED_object_context(const struct bContext *C)
Object ** ED_object_array_in_mode_or_selected(struct bContext *C, bool(*filter_fn)(const struct Object *ob, void *user_data), void *filter_user_data, uint *r_objects_len)
bool ED_operator_object_active_local_editable_ex(struct bContext *C, const Object *ob)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_elem_index_get(ele)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
const Depsgraph * depsgraph
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static int vertex_group_levels_exec(bContext *C, wmOperator *op)
void ED_vgroup_parray_remove_zero(MDeformVert **dvert_array, const int dvert_tot, const bool *vgroup_validmap, const int vgroup_tot, const float epsilon, const bool keep_single)
static bool vertex_group_poll_ex(bContext *C, Object *ob)
static int vertex_group_select_exec(bContext *C, wmOperator *UNUSED(op))
static int vertex_group_assign_new_exec(bContext *C, wmOperator *op)
static void getVerticalAndHorizontalChange(const float norm[3], float d, const float coord[3], const float start[3], float distToStart, float *end, float(*changes)[2], float *dists, int index)
void OBJECT_OT_vertex_group_limit_total(wmOperatorType *ot)
static int set_active_group_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
@ VGROUP_MASK_INVERT_UNSELECTED
static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
static int vertex_group_invert_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem vgroup_lock_actions[]
void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
static int vertex_group_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_assign_new(wmOperatorType *ot)
static bool vertex_group_vert_select_mesh_poll(bContext *C)
float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum)
void ED_vgroup_data_clamp_range(ID *id, const int total)
void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
static void vgroup_assign_verts(Object *ob, const float weight)
static const EnumPropertyItem vgroup_lock_mask[]
void OBJECT_OT_vertex_group_add(wmOperatorType *ot)
void OBJECT_OT_vertex_group_quantize(wmOperatorType *ot)
static void vgroup_sort_bone_hierarchy(Object *ob, ListBase *bonebase)
void OBJECT_OT_vertex_group_select(wmOperatorType *ot)
void OBJECT_OT_vertex_weight_copy(wmOperatorType *ot)
static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_active)
static void moveCloserToDistanceFromPlane(Depsgraph *depsgraph, Scene *UNUSED(scene), Object *ob, Mesh *me, int index, const float norm[3], const float coord[3], float d, float distToBe, float strength, float cp)
#define IS_BM_VERT_READ(v)
void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
static bool vertex_group_mesh_vert_poll(bContext *C)
void OBJECT_OT_vertex_group_move(wmOperatorType *ot)
static bool vertex_group_supported_poll_ex(bContext *C, const Object *ob)
static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr, const char sel, const char sel_mirr, const int *flip_map, const int flip_map_len, const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups, const int act_vgroup)
static void vgroup_fix(const bContext *C, Scene *UNUSED(scene), Object *ob, float distToBe, float strength, float cp)
static void vgroup_remove_weight(Object *ob, const int def_nr)
static Lattice * vgroup_edit_lattice(Object *ob)
static bool check_vertex_group_accessible(wmOperator *op, Object *ob, int def_nr)
static bool vertex_group_poll(bContext *C)
void ED_vgroup_mirror(Object *ob, const bool mirror_weights, const bool flip_vgroups, const bool all_vgroups, const bool use_topology, int *r_totmirr, int *r_totfail)
void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
void ED_vgroup_parray_mirror_sync(Object *ob, MDeformVert **dvert_array, const int dvert_tot, const bool *vgroup_validmap, const int vgroup_tot)
void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot)
static int vgroup_limit_total_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int subset_count, const int max_weights)
void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
static int vertex_weight_set_active_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
static bool vertex_group_mesh_poll_ex(bContext *C, Object *ob)
void ED_vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
static void getSingleCoordinate(MVert *points, int count, float coord[3])
static float get_vert_def_nr(Object *ob, const int def_nr, const int vertnum)
static void vgroup_lock_all(Object *ob, int action, int mask)
#define IS_ME_VERT_READ(v)
void ED_vgroup_parray_to_weight_array(const MDeformVert **dvert_array, const int dvert_tot, float *dvert_weights, const int def_nr)
static bool * vgroup_selected_get(Object *ob)
static bool UNUSED_FUNCTION() vertex_group_poll_edit(bContext *C)
void OBJECT_OT_vertex_group_sort(wmOperatorType *ot)
static int vertex_weight_delete_exec(bContext *C, wmOperator *op)
static int vertex_weight_copy_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
static void ED_mesh_defvert_mirror_update_ob(Object *ob, int def_nr, int vidx)
static const EnumPropertyItem * rna_vertex_group_select_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static int vertex_group_normalize_exec(bContext *C, wmOperator *UNUSED(op))
static void vgroup_clean_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), const float epsilon, const bool keep_single)
void OBJECT_OT_vertex_group_copy(wmOperatorType *ot)
static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
static bool vertex_group_mesh_with_dvert_poll(bContext *C)
static int vertex_group_remove_exec(bContext *C, wmOperator *op)
static void ED_vgroup_nr_vert_add(Object *ob, const int def_nr, const int vertnum, const float weight, const int assignmode)
static int vertex_group_fix_exec(bContext *C, wmOperator *op)
static char * vertex_group_lock_description(struct bContext *UNUSED(C), struct wmOperatorType *UNUSED(op), struct PointerRNA *params)
static bool object_array_for_wpaint_filter(const Object *ob, void *user_data)
#define IS_ME_VERT_WRITE(v)
static const EnumPropertyItem * rna_vertex_group_with_single_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static void mesh_defvert_mirror_update_internal(Object *ob, MDeformVert *dvert_dst, MDeformVert *dvert_src, const int def_nr)
static int vertex_weight_normalize_active_vertex_exec(bContext *C, wmOperator *UNUSED(op))
void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
static int vertex_group_deselect_exec(bContext *C, wmOperator *UNUSED(op))
@ SORT_TYPE_BONEHIERARCHY
static int vertex_group_normalize_all_exec(bContext *C, wmOperator *op)
#define IS_BM_VERT_WRITE(v)
void OBJECT_OT_vertex_group_smooth(wmOperatorType *ot)
static char * vgroup_init_remap(Object *ob)
void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
static int vgroup_sort_name(const void *def_a_ptr, const void *def_b_ptr)
static bool vertex_group_vert_select_poll(bContext *C)
bool ED_vgroup_array_copy(Object *ob, Object *ob_from)
static void vgroup_select_verts(Object *ob, int select)
bool ED_vgroup_parray_alloc(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, const bool use_vert_sel)
static void vgroup_quantize_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), const int steps)
static int vertex_group_remove_from_exec(bContext *C, wmOperator *op)
static bool vertex_group_vert_select_unlocked_poll(bContext *C)
void ED_vgroup_vert_active_mirror(Object *ob, int def_nr)
static int vertex_group_add_exec(bContext *C, wmOperator *UNUSED(op))
bool ED_vgroup_sync_from_pose(Object *ob)
static const EnumPropertyItem WT_vertex_group_select_item[]
static void vgroup_delete_active(Object *ob)
static int vertex_group_limit_total_exec(bContext *C, wmOperator *op)
static bool vgroup_normalize_all(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int subset_count, const bool lock_active, ReportList *reports)
static int vertex_group_smooth_exec(bContext *C, wmOperator *op)
void ED_vgroup_parray_from_weight_array(MDeformVert **dvert_array, const int dvert_tot, const float *dvert_weights, const int def_nr, const bool remove_zero)
static int vertex_group_quantize_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot)
static int vertex_group_sort_exec(bContext *C, wmOperator *op)
static Object ** object_array_for_wpaint(bContext *C, uint *r_objects_len)
static bool vertex_group_supported_poll(bContext *C)
static int * getSurroundingVerts(Mesh *me, int vert, int *count)
static void ED_mesh_defvert_mirror_update_em(Object *ob, BMVert *eve, int def_nr, int vidx, const int cd_dvert_offset)
void ED_vgroup_select_by_name(Object *ob, const char *name)
static bool vertex_group_vert_poll_ex(bContext *C, const bool needs_select, const short ob_type_flag)
void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot)
static int vgroup_move_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem * vgroup_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
static bool vertex_group_use_vert_sel(Object *ob)
void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
#define WEIGHT_ACCUMULATE
static int vertex_group_lock_exec(bContext *C, wmOperator *op)
static int vertex_weight_paste_exec(bContext *C, wmOperator *op)
static void vgroup_levels_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), const float offset, const float gain)
static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
static bool vgroup_normalize_active_vertex(Object *ob, eVGroupSelect subset_type)
static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op)
static int vertex_group_assign_exec(bContext *C, wmOperator *UNUSED(op))
void ED_vgroup_parray_mirror_assign(Object *ob, MDeformVert **dvert_array, const int dvert_tot)
static int vertex_group_mirror_exec(bContext *C, wmOperator *op)
static void vgroup_invert_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int UNUSED(subset_count), const bool auto_assign, const bool auto_remove)
static void vgroup_duplicate(Object *ob)
void OBJECT_OT_vertex_group_normalize(wmOperatorType *ot)
void ED_vgroup_vert_add(Object *ob, bDeformGroup *dg, int vertnum, float weight, int assignmode)
static int vertex_group_clean_exec(bContext *C, wmOperator *op)
const EnumPropertyItem * ED_object_vgroup_selection_itemf_helper(const bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *prop, bool *r_free, const uint selection_mask)
static bool vgroup_normalize(Object *ob)
static void vgroup_smooth_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int subset_count, const float fac, const int repeat, const float fac_expand)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem DummyRNA_NULL_items[]
struct MDeformVert * dvert
struct EditLatt * editlatt
struct BMEditMesh * edit_mesh
struct MDeformVert * dvert
struct ModifierData * next
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))