150 for (
int i = 0; i < dvert_tot; i++) {
152 for (
int j = 0; j < dv->
totweight; j++) {
165 const bool use_vert_sel)
183 if (cd_dvert_offset == -1) {
189 *dvert_arr =
MEM_mallocN(
sizeof(
void *) * i,
"vgroup parray from me");
218 for (
int i = 0; i < me->
totvert; i++) {
223 for (
int i = 0; i < me->
totvert; i++) {
224 (*dvert_arr)[i] = me->
dvert + i;
239 *dvert_arr =
MEM_mallocN(
sizeof(
void *) * (*dvert_tot),
"vgroup parray from me");
242 for (
int i = 0; i < *dvert_tot; i++) {
247 for (
int i = 0; i < *dvert_tot; i++) {
248 (*dvert_arr)[i] = lt->
dvert + i;
275 const bool *vgroup_validmap,
276 const int vgroup_tot)
294 for (
int i_src = 0; i_src < dvert_tot; i_src++) {
295 if (dvert_array[i_src] !=
NULL) {
298 if (i_dst != -1 && dvert_array_all[i_dst] !=
NULL) {
304 dv_dst, dv_src, vgroup_validmap, vgroup_tot, flip_map, flip_map_len);
306 dvert_array[i_dst] = dvert_array_all[i_dst];
336 for (
int i = 0; i < dvert_tot; i++) {
337 if (dvert_array[i] ==
NULL) {
340 if ((i_sel != -1) && (i_sel != i) && (dvert_array[i_sel])) {
342 dvert_array[i] = dvert_array_all[i];
352 const bool *vgroup_validmap,
353 const int vgroup_tot,
355 const bool keep_single)
359 for (
int i = 0; i < dvert_tot; i++) {
361 if (!(dv = dvert_array[i])) {
375 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
394 bool new_vgroup =
false;
406 if ((dvert_array ==
NULL) && (dvert_array_from !=
NULL) &&
412 if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from ==
NULL ||
413 dvert_array ==
NULL) {
417 if (dvert_array_from) {
421 if (new_vgroup ==
true) {
427 return (dvert_tot == dvert_tot_from);
436 if (defbase_tot_from < defbase_tot) {
438 int *remap =
MEM_mallocN(
sizeof(
int) * (defbase_tot + 1), __func__);
439 for (i = 0; i <= defbase_tot_from; i++) {
442 for (; i <= defbase_tot; i++) {
450 if (dvert_array_from !=
NULL && dvert_array !=
NULL) {
451 dvf = dvert_array_from;
454 for (i = 0; i < dvert_tot; i++, dvf++, dv++) {
472 float *dvert_weights,
475 for (
int i = 0; i < dvert_tot; i++) {
483 const float *dvert_weights,
485 const bool remove_zero)
489 for (i = 0; i < dvert_tot; i++) {
492 if (dvert_weights[i] > 0.0f) {
495 dw->
weight = dvert_weights[i];
536 Object *ob,
BMVert *eve,
int def_nr,
int vidx,
const int cd_dvert_offset)
545 if (eve_mirr && eve_mirr != eve) {
564 if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
617 int subset_count, vgroup_tot;
618 const bool *vgroup_validmap;
627 if (dvert_act ==
NULL) {
632 ob, subset_type, &vgroup_tot, &subset_count);
654 int i, vgroup_tot, subset_count;
656 ob, subset_type, &vgroup_tot, &subset_count);
683 for (i = 0; i < me->
totvert; i++, dv++) {
708 "Selected Pose Bones",
709 "All Vertex Groups assigned to Selection"},
714 "All Vertex Groups assigned to Deform Bones"},
715 {
WT_VGROUP_ALL,
"ALL", 0,
"All Groups",
"All Vertex Groups"},
723 const uint selection_mask)
791 "Define which subset of groups shall be used");
816 Object *ob,
const int def_nr,
const int vertnum,
const float weight,
const int assignmode)
830 if ((vertnum < 0) || (vertnum >= tot)) {
841 switch (assignmode) {
863 switch (assignmode) {
950 if (cd_dvert_offset != -1 && vertnum < em->
bm->
totvert) {
965 dv = &me->
dvert[vertnum];
976 dv = <->
dvert[vertnum];
1017 const int def_nr = ob->
actdef - 1;
1030 if (cd_dvert_offset != -1) {
1061 for (i = 0; i < me->
totvert; i++,
mv++, dv++) {
1089 for (
a = 0, bp = lt->
def;
a < tot;
a++, bp++, dv++) {
1096 if (actbp && bp == actbp) {
1109 char name[
sizeof(dg->
name)];
1112 int i, idg, icdg, dvert_tot = 0;
1119 if (!strstr(dg->
name,
"_copy")) {
1140 for (i = 0; i < dvert_tot; i++) {
1145 const float weight = dw_org->weight;
1147 dw_cpy->weight = weight;
1160 const int def_nr = ob->
actdef - 1;
1171 float weight_max = 0.0f;
1173 for (
int i = 0; i < dvert_tot; i++) {
1176 if (!(dv = dvert_array[i])) {
1186 if (weight_max > 0.0f) {
1187 for (
int i = 0; i < dvert_tot; i++) {
1190 if (!(dv = dvert_array[i])) {
1196 dw->
weight /= weight_max;
1228 int first_l = mp->
totloop - 1;
1233 if (ml->
v == vert) {
1253 while (k-- && !(
a == b &&
a == -1)) {
1257 else if (
verts[k] == b) {
1289 for (i = 0; i <
count; i++) {
1301 const float coord[3],
1302 const float start[3],
1305 float (*changes)[2],
1311 float projA[3], projB[3];
1322 changes[index][0] = dists[index] - distToStart;
1325 changes[index][1] =
len_v3v3(projA, projB);
1342 const float norm[3],
1343 const float coord[3],
1360 float oldPos[3] = {0};
1361 float vc, hc, dist = 0.0f;
1363 float(*changes)[2] =
MEM_mallocN(
sizeof(
float *) * totweight * 2,
"vertHorzChange");
1364 float *dists =
MEM_mallocN(
sizeof(
float) * totweight,
"distance");
1367 int *upDown =
MEM_callocN(
sizeof(
int) * totweight,
"upDownTracker");
1369 int *dwIndices =
MEM_callocN(
sizeof(
int) * totweight,
"dwIndexTracker");
1375 float originalDistToBe = distToBe;
1379 m = me_deform->mvert[index];
1383 if (distToBe == originalDistToBe) {
1384 distToBe += distToStart - distToStart * strength;
1386 for (i = 0; i < totweight; i++) {
1388 dw = (dvert->dw + i);
1389 dw_eval = (dvert_eval->dw + i);
1394 dists[i] = distToStart;
1397 for (k = 0; k < 2; k++) {
1405 dw->weight *= 1 + cp;
1408 dw->weight /= 1 + cp;
1410 if (dw->weight == oldw) {
1413 dists[i] = distToStart;
1416 if (dw->weight > 1) {
1419 dw_eval->weight = dw->weight;
1421 m = me_deform->mvert[index];
1423 norm, d, coord, oldPos, distToStart, m.co, changes, dists, i);
1425 dw_eval->weight = oldw;
1432 if (
fabsf(dist - distToBe) <
fabsf(dists[i] - distToBe)) {
1441 if (
fabsf(dists[i] - distToBe) >
fabsf(distToStart - distToBe)) {
1444 dists[i] = distToStart;
1450 for (k = 0; k < totweight; k++) {
1454 for (i = k + 1; i < totweight; i++) {
1462 if (bestIndex != k) {
1464 upDown[k] = upDown[bestIndex];
1465 upDown[bestIndex] = ti;
1468 dwIndices[k] = dwIndices[bestIndex];
1469 dwIndices[bestIndex] = ti;
1472 changes[k][0] = changes[bestIndex][0];
1473 changes[bestIndex][0] = tf;
1476 changes[k][1] = changes[bestIndex][1];
1477 changes[bestIndex][1] = tf;
1480 dists[k] = dists[bestIndex];
1481 dists[bestIndex] = tf;
1486 for (i = 0; i < totweight; i++) {
1487 if (
fabsf(changes[i][0]) >
fabsf(changes[i][1] * 2.0f)) {
1492 if (bestIndex != -1) {
1496 if (lastIndex != -1) {
1497 if (wasUp != upDown[bestIndex]) {
1501 lastIndex = bestIndex;
1502 wasUp = upDown[bestIndex];
1503 dw = (dvert->dw + dwIndices[bestIndex]);
1505 if (upDown[bestIndex]) {
1506 dw->weight *= 1 + cp;
1509 dw->weight /= 1 + cp;
1511 if (dw->weight > 1) {
1514 if (oldw == dw->weight) {
1523 }
while (wasChange && ((distToStart - distToBe) /
fabsf(distToStart - distToBe) ==
1524 (dists[bestIndex] - distToBe) /
fabsf(dists[bestIndex] - distToBe)));
1548 for (i = 0; i < me->
totvert && mvert; i++, mvert++) {
1568 m = me_deform->
mvert[i];
1575 depsgraph, scene_eval, object_eval, me, i,
norm, coord, d, distToBe, strength, cp);
1587 const bool *vgroup_validmap,
1588 const int vgroup_tot,
1589 const int UNUSED(subset_count),
1606 for (
int i = 0; i < dvert_tot; i++) {
1608 if (!(dv = dvert_array[i])) {
1614 if (vgroup_validmap[j]) {
1625 if (use_mirror && use_vert_sel) {
1634 const bool *vgroup_validmap,
1635 const int vgroup_tot,
1636 const int subset_count,
1637 const bool lock_active,
1641 int i, dvert_tot = 0;
1642 const int def_nr = ob->
actdef - 1;
1646 if (subset_count == 0) {
1656 bool changed =
false;
1658 if ((lock_active ==
true) && (lock_flags !=
NULL) && (def_nr < defbase_tot)) {
1659 lock_flags[def_nr] =
true;
1663 for (i = 0; i < defbase_tot; i++) {
1664 if (lock_flags[i] ==
false) {
1669 if (i == defbase_tot) {
1675 for (i = 0; i < dvert_tot; i++) {
1677 if ((dv = dvert_array[i])) {
1681 else if (lock_active) {
1717 "Unlock all vertex groups if there is at least one locked group, lock all in other case"},
1718 {
VGROUP_LOCK,
"LOCK", 0,
"Lock",
"Lock all vertex groups"},
1719 {
VGROUP_UNLOCK,
"UNLOCK", 0,
"Unlock",
"Unlock all vertex groups"},
1720 {
VGROUP_INVERT,
"INVERT", 0,
"Invert",
"Invert the lock state of all vertex groups"},
1732 {
VGROUP_MASK_ALL,
"ALL", 0,
"All",
"Apply action to all vertex groups"},
1736 "INVERT_UNSELECTED",
1738 "Invert Unselected",
1739 "Apply the opposite of Lock/Unlock to unselected vertex groups"},
1762 if (sel_count == 0 && ob->
actdef >= 1 && ob->
actdef <= defbase_tot) {
1772 bool *selected =
NULL;
1843 const bool *vgroup_validmap,
1844 const int vgroup_tot,
1845 const int UNUSED(subset_count),
1846 const bool auto_assign,
1847 const bool auto_remove)
1860 for (
int i = 0; i < dvert_tot; i++) {
1862 if (!(dv = dvert_array[i])) {
1869 if (vgroup_validmap[j]) {
1885 if (use_mirror && use_vert_sel) {
1891 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot, 0.0f,
false);
1899 const bool *vgroup_validmap,
1900 const int vgroup_tot,
1901 const int subset_count,
1904 const float fac_expand)
1906 const float ifac = 1.0f - fac;
1909 int *vgroup_subset_map =
BLI_array_alloca(vgroup_subset_map, subset_count);
1910 float *vgroup_subset_weights =
BLI_array_alloca(vgroup_subset_weights, subset_count);
1915 const bool use_hide = use_select;
1917 const int expand_sign =
signum_i(fac_expand);
1918 const float expand =
fabsf(fac_expand);
1919 const float iexpand = 1.0f - expand;
1928 float *weight_accum_prev;
1929 float *weight_accum_curr;
1939 memset(vgroup_subset_weights, 0,
sizeof(*vgroup_subset_weights) * subset_count);
1952 weight_accum_prev =
MEM_mallocN(
sizeof(*weight_accum_prev) * dvert_tot, __func__);
1953 weight_accum_curr =
MEM_mallocN(
sizeof(*weight_accum_curr) * dvert_tot, __func__);
1955 verts_used =
MEM_mallocN(
sizeof(*verts_used) * dvert_tot, __func__);
1958 #define IS_BM_VERT_READ(v) (use_hide ? (BM_elem_flag_test(v, BM_ELEM_HIDDEN) == 0) : true)
1959 #define IS_BM_VERT_WRITE(v) (use_select ? (BM_elem_flag_test(v, BM_ELEM_SELECT) != 0) : true)
1961 #define IS_ME_VERT_READ(v) (use_hide ? (((v)->flag & ME_HIDE) == 0) : true)
1962 #define IS_ME_VERT_WRITE(v) (use_select ? (((v)->flag & SELECT) != 0) : true)
1966 for (
int i = 0; i < dvert_tot; i++) {
1982 for (
int i = 0; i < dvert_tot; i++) {
1985 for (
int j = 0; j < emap[i].
count; j++) {
1987 const MVert *v_other = &me->
mvert[(
e->v1 == i) ?
e->v2 :
e->v1];
1997 for (subset_index = 0; subset_index < subset_count; subset_index++) {
1998 const int def_nr = vgroup_subset_map[subset_index];
2002 (
const MDeformVert **)dvert_array, dvert_tot, weight_accum_prev, def_nr);
2003 memcpy(weight_accum_curr, weight_accum_prev,
sizeof(*weight_accum_curr) * dvert_tot);
2005 for (iter = 0; iter < repeat; iter++) {
2010 for (vi_step = verts_used; vi_step != vi_end; vi_step++) {
2011 const uint i = *vi_step;
2012 float weight_tot = 0.0f;
2013 float weight = 0.0f;
2015 #define WEIGHT_ACCUMULATE \
2017 float weight_other = weight_accum_prev[i_other]; \
2018 float tot_factor = 1.0f; \
2019 if (expand_sign == 1) { \
2020 if (weight_other < weight_accum_prev[i]) { \
2021 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
2022 tot_factor = iexpand; \
2025 else if (expand_sign == -1) { \
2026 if (weight_other > weight_accum_prev[i]) { \
2027 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
2028 tot_factor = iexpand; \
2031 weight += tot_factor * weight_other; \
2032 weight_tot += tot_factor; \
2059 for (j = 0; j < emap[i].
count; j++) {
2061 const int i_other = (
e->v1 == i ?
e->v2 :
e->v1);
2070 #undef WEIGHT_ACCUMULATE
2072 if (weight_tot != 0.0f) {
2073 weight /= weight_tot;
2074 weight = (weight_accum_prev[i] * ifac) + (weight * fac);
2077 CLAMP(weight, 0.0f, 1.0f);
2078 weight_accum_curr[i] = weight;
2082 SWAP(
float *, weight_accum_curr, weight_accum_prev);
2088 #undef IS_BM_VERT_READ
2089 #undef IS_BM_VERT_WRITE
2090 #undef IS_ME_VERT_READ
2091 #undef IS_ME_VERT_WRITE
2129 if (dw1->
weight < dw2->weight) {
2132 if (dw1->
weight > dw2->weight) {
2146 const bool *vgroup_validmap,
2147 const int vgroup_tot,
2148 const int subset_count,
2149 const int max_weights)
2152 int i, dvert_tot = 0;
2159 int num_to_drop = 0;
2161 for (i = 0; i < dvert_tot; i++) {
2164 int bone_count = 0, non_bone_count = 0;
2168 if (!(dv = dvert_array[i])) {
2172 num_to_drop = subset_count - max_weights;
2175 if (num_to_drop > 0) {
2183 dw_temp[dv->
totweight - 1 - bone_count] = dv->
dw[j];
2187 dw_temp[non_bone_count] = dv->
dw[j];
2188 non_bone_count += 1;
2192 num_to_drop = bone_count - max_weights;
2193 if (num_to_drop > 0) {
2194 qsort(&dw_temp[non_bone_count],
2202 remove_tot += num_to_drop;
2216 const bool *vgroup_validmap,
2217 const int vgroup_tot,
2218 const int UNUSED(subset_count),
2220 const bool keep_single)
2232 if (use_mirror && use_vert_sel) {
2240 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot,
epsilon, keep_single);
2247 const bool *vgroup_validmap,
2248 const int vgroup_tot,
2249 const int UNUSED(subset_count),
2261 const float steps_fl =
steps;
2264 if (use_mirror && use_vert_sel) {
2268 for (
int i = 0; i < dvert_tot; i++) {
2272 if (!(dv = dvert_array[i])) {
2277 for (j = 0, dw = dv->
dw; j < dv->totweight; j++, dw++) {
2278 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
2292 const char sel_mirr,
2293 const int *flip_map,
2294 const int flip_map_len,
2295 const bool mirror_weights,
2296 const bool flip_vgroups,
2297 const bool all_vgroups,
2298 const int act_vgroup)
2302 if (sel_mirr && sel) {
2304 if (mirror_weights) {
2312 if (dw && dw_mirr) {
2339 if (mirror_weights) {
2358 const bool mirror_weights,
2359 const bool flip_vgroups,
2360 const bool all_vgroups,
2361 const bool use_topology,
2366 #define VGROUP_MIRR_OP \
2367 dvert_mirror_op(dvert, \
2381 int *flip_map =
NULL, flip_map_len;
2383 int totmirr = 0, totfail = 0;
2385 *r_totmirr = *r_totfail = 0;
2387 if ((mirror_weights ==
false && flip_vgroups ==
false) ||
2398 if (flip_map ==
NULL) {
2417 if (cd_dvert_offset == -1) {
2429 if (eve_mirr != eve) {
2434 if ((sel || sel_mirr) && (eve != eve_mirr)) {
2458 int vidx, vidx_mirr;
2465 if (!use_vert_sel) {
2466 sel = sel_mirr =
true;
2470 for (vidx = 0,
mv = me->
mvert; vidx < me->totvert; vidx++,
mv++) {
2474 for (vidx = 0,
mv = me->
mvert; vidx < me->totvert; vidx++,
mv++) {
2477 if (vidx != vidx_mirr) {
2478 mv_mirr = &me->
mvert[vidx_mirr];
2486 if (sel || sel_mirr) {
2487 dvert = &me->
dvert[vidx];
2488 dvert_mirr = &me->
dvert[vidx_mirr];
2520 pntsu_half = lt->
pntsu / 2;
2524 for (u = 0; u < pntsu_half; u++) {
2525 int u_inv = (lt->
pntsu - 1) - u;
2533 bp_mirr = <->
def[i2];
2538 if (sel || sel_mirr) {
2540 dvert_mirr = <->
dvert[i2];
2554 if (flip_vgroups && flip_map[
def_nr] >= 0) {
2560 *r_totmirr = totmirr;
2561 *r_totfail = totfail;
2567 #undef VGROUP_MIRR_OP
2594 int cd_dvert_offset;
2626 for (
int i = 0; i < me->
totvert; i++,
mv++, dv++) {
2650 for (
a = 0, bp = lt->
def;
a < tot;
a++, bp++, dv++) {
2760 const bool needs_select,
2761 const short ob_type_flag)
2769 if (ob_type_flag && (((1 << ob->
type) & ob_type_flag)) == 0) {
2790 static bool vertex_group_vert_poll(
bContext *
C)
2807 static bool vertex_group_mesh_vert_select_poll(
bContext *
C)
2873 ot->
name =
"Add Vertex Group";
2874 ot->
idname =
"OBJECT_OT_vertex_group_add";
2875 ot->
description =
"Add a new vertex group to the active object";
2916 ot->
name =
"Remove Vertex Group";
2917 ot->
idname =
"OBJECT_OT_vertex_group_remove";
2918 ot->
description =
"Delete the active or all vertex groups from the active object";
2934 ot->
srna,
"all_unlocked", 0,
"All Unlocked",
"Remove all unlocked vertex groups");
2959 ot->
name =
"Assign to Vertex Group";
2960 ot->
idname =
"OBJECT_OT_vertex_group_assign";
2961 ot->
description =
"Assign the selected vertices to the active vertex group";
2994 ot->
name =
"Assign to New Group";
2995 ot->
idname =
"OBJECT_OT_vertex_group_assign_new";
2996 ot->
description =
"Assign the selected vertices to a new vertex group";
3022 if (use_all_groups) {
3045 ot->
name =
"Remove from Vertex Group";
3046 ot->
idname =
"OBJECT_OT_vertex_group_remove_from";
3047 ot->
description =
"Remove the selected vertices from active or all vertex group(s)";
3090 ot->
name =
"Select Vertex Group";
3091 ot->
idname =
"OBJECT_OT_vertex_group_select";
3092 ot->
description =
"Select all the vertices assigned to the active vertex group";
3122 ot->
name =
"Deselect Vertex Group";
3123 ot->
idname =
"OBJECT_OT_vertex_group_deselect";
3124 ot->
description =
"Deselect all selected vertices assigned to the active vertex group";
3156 ot->
name =
"Copy Vertex Group";
3157 ot->
idname =
"OBJECT_OT_vertex_group_copy";
3182 int subset_count, vgroup_tot;
3185 ob, subset_type, &vgroup_tot, &subset_count);
3199 ot->
name =
"Vertex Group Levels";
3200 ot->
idname =
"OBJECT_OT_vertex_group_levels";
3202 "Add some offset and multiply with some gain the weights of the active vertex group";
3213 ot->
srna,
"offset", 0.0f, -1.0, 1.0,
"Offset",
"Value to add to weights", -1.0f, 1.0f);
3215 ot->
srna,
"gain", 1.0f, 0.0f, FLT_MAX,
"Gain",
"Value to multiply weights by", 0.0f, 10.0f);
3244 ot->
name =
"Normalize Vertex Group";
3245 ot->
idname =
"OBJECT_OT_vertex_group_normalize";
3247 "Normalize weights of the active vertex group, so that the highest ones are now 1.0";
3269 int subset_count, vgroup_tot;
3271 ob, subset_type, &vgroup_tot, &subset_count);
3274 ob, vgroup_validmap, vgroup_tot, subset_count, lock_active, op->
reports);
3292 ot->
name =
"Normalize All Vertex Groups";
3293 ot->
idname =
"OBJECT_OT_vertex_group_normalize_all";
3295 "Normalize all weights of all vertex groups, "
3296 "so that for each vertex, the sum of all weights is 1.0";
3310 "Keep the values of the active group while normalizing others");
3339 "This operator does not support an active mirror modifier");
3354 ot->
name =
"Fix Vertex Group Deform";
3355 ot->
idname =
"OBJECT_OT_vertex_group_fix";
3357 "Modify the position of selected vertices by changing only their respective "
3358 "groups' weights (this tool may be slow for many vertices)";
3372 "The distance to move to",
3381 "The distance moved can be changed by this multiplier",
3390 "Change Sensitivity",
3391 "Change the amount weights are altered with each iteration: lower values are slower",
3423 const char *action_str, *target_str;
3427 action_str =
"Lock";
3430 action_str =
"Unlock";
3433 action_str =
"Toggle locks of";
3436 action_str =
"Invert locks of";
3447 target_str =
"selected";
3450 target_str =
"unselected";
3455 target_str =
"selected";
3458 target_str =
"selected and unlock unselected";
3461 target_str =
"selected and lock unselected";
3464 target_str =
"all and invert unselected";
3471 return BLI_sprintfN(
"%s %s vertex groups of the active object", action_str, target_str);
3477 ot->
name =
"Change the Lock On Vertex Groups";
3478 ot->
idname =
"OBJECT_OT_vertex_group_lock";
3479 ot->
description =
"Change the lock state of all or some vertex groups of active object";
3494 "Lock action to execute on vertex groups");
3501 "Apply the action based on vertex group selection");
3518 int subset_count, vgroup_tot;
3521 ob, subset_type, &vgroup_tot, &subset_count);
3535 ot->
name =
"Invert Vertex Group";
3536 ot->
idname =
"OBJECT_OT_vertex_group_invert";
3551 "Add vertices from groups that have zero weight before inverting");
3556 "Remove vertices from groups that have zero weight after inverting");
3575 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3576 Object *ob = objects[ob_index];
3578 int subset_count, vgroup_tot;
3581 ob, subset_type, &vgroup_tot, &subset_count);
3598 ot->
name =
"Smooth Vertex Weights";
3599 ot->
idname =
"OBJECT_OT_vertex_group_smooth";
3619 "Expand/contract weights",
3639 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3640 Object *ob = objects[ob_index];
3642 int subset_count, vgroup_tot;
3645 ob, subset_type, &vgroup_tot, &subset_count);
3662 ot->
name =
"Clean Vertex Group Weights";
3663 ot->
idname =
"OBJECT_OT_vertex_group_clean";
3664 ot->
description =
"Remove vertex group assignments which are not required";
3680 "Remove vertices which weight is below or equal to this limit",
3687 "Keep verts assigned to at least one group when cleaning");
3703 int subset_count, vgroup_tot;
3706 ob, subset_type, &vgroup_tot, &subset_count);
3720 ot->
name =
"Quantize Vertex Weights";
3721 ot->
idname =
"OBJECT_OT_vertex_group_quantize";
3732 RNA_def_int(
ot->
srna,
"steps", 4, 1, 1000,
"Steps",
"Number of steps between 0 and 1", 1, 100);
3745 int remove_multi_count = 0;
3749 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3750 Object *ob = objects[ob_index];
3752 int subset_count, vgroup_tot;
3754 ob, subset_type, &vgroup_tot, &subset_count);
3756 ob, vgroup_validmap, vgroup_tot, subset_count, limit);
3759 if (remove_count != 0) {
3764 remove_multi_count += remove_count;
3768 if (remove_multi_count) {
3771 "%d vertex weights limited",
3772 remove_multi_count);
3785 ot->
name =
"Limit Number of Weights per Vertex";
3786 ot->
idname =
"OBJECT_OT_vertex_group_limit_total";
3788 "Limit deform weights associated with a vertex to a specified number by removing lowest "
3799 RNA_def_int(
ot->
srna,
"limit", 4, 1, 32,
"Limit",
"Maximum number of deform weights", 1, 32);
3811 int totmirr = 0, totfail = 0;
3834 ot->
name =
"Mirror Vertex Group";
3835 ot->
idname =
"OBJECT_OT_vertex_group_mirror";
3837 "Mirror vertex group, flip weights and/or names, editing only selected vertices, "
3838 "flipping when both sides are selected otherwise copy from unselected";
3850 ot->
srna,
"flip_group_names",
true,
"Flip Group Names",
"Flip vertex group names");
3857 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
3873 if (ob_iter->type == ob_active->
type) {
3874 if (ob_iter != ob_active && ob_iter->
data == ob_active->
data) {
3877 ob_iter->actdef = ob_active->
actdef;
3895 ot->
name =
"Copy Vertex Groups to Linked";
3896 ot->
idname =
"OBJECT_OT_vertex_group_copy_to_linked";
3898 "Replace vertex groups of all users of the same geometry data by vertex groups of active "
3918 int changed_tot = 0;
3936 if ((changed_tot == 0 && fail == 0) || fail) {
3939 "Copy vertex groups to selected: %d done, %d failed (object data must have "
3940 "matching indices)",
3951 ot->
name =
"Copy Vertex Group to Selected";
3952 ot->
idname =
"OBJECT_OT_vertex_group_copy_to_selected";
3953 ot->
description =
"Replace vertex groups of selected objects by vertex groups of active object";
4004 tmp.
icon = ICON_GROUP_VERTEX;
4021 ot->
name =
"Set Active Vertex Group";
4022 ot->
idname =
"OBJECT_OT_vertex_group_set_active";
4072 int *sort_map_update =
MEM_mallocN(
sizeof(
int) * (defbase_tot + 1),
"sort vgroups");
4073 int *sort_map = sort_map_update + 1;
4091 if (cd_dvert_offset != -1) {
4116 while (dvert_tot--) {
4126 for (i = 0; i < defbase_tot; i++) {
4130 sort_map_update[0] = 0;
4155 if (bonebase ==
NULL) {
4157 if (armobj !=
NULL) {
4163 if (bonebase !=
NULL) {
4165 for (bone = bonebase->
last; bone; bone = bone->
prev) {
4193 switch (sort_type) {
4225 ot->
name =
"Sort Vertex Groups";
4226 ot->
idname =
"OBJECT_OT_vertex_group_sort";
4279 {-1,
"UP", 0,
"Up",
""},
4280 {1,
"DOWN", 0,
"Down",
""},
4285 ot->
name =
"Move Vertex Group";
4286 ot->
idname =
"OBJECT_OT_vertex_group_move";
4287 ot->
description =
"Move the active vertex group up/down in the list";
4301 "Direction to move the active vertex group towards");
4325 if (dvert_act ==
NULL) {
4353 if (dvert_act ==
NULL) {
4359 for (i = 0; i < me->
totvert; i++, dv++) {
4415 ot->
name =
"Paste Weight to Selected";
4416 ot->
idname =
"OBJECT_OT_vertex_weight_paste";
4418 "Copy this group's weight to other selected vertices (disabled if vertex group is locked)";
4433 "Index of source weight in active vertex group",
4466 ot->
name =
"Delete Weight";
4467 ot->
idname =
"OBJECT_OT_vertex_weight_delete";
4468 ot->
description =
"Delete this weight from the vertex (disabled if vertex group is locked)";
4483 "Index of source weight in active vertex group",
4500 if (wg_index != -1) {
4501 ob->
actdef = wg_index + 1;
4513 ot->
name =
"Set Active Group";
4514 ot->
idname =
"OBJECT_OT_vertex_weight_set_active";
4530 "Index of source weight in active vertex group",
4563 ot->
name =
"Normalize Active";
4564 ot->
idname =
"OBJECT_OT_vertex_weight_normalize_active_vertex";
4598 ot->
name =
"Copy Active";
4599 ot->
idname =
"OBJECT_OT_vertex_weight_copy";
typedef float(TangentPoint)[2]
#define FOREACH_SCENE_OBJECT_END
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
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, const int u, const int v, const 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, 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_report(ReportList *reports, ReportType type, const char *message)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
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)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset) 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 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()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define UNUSED_FUNCTION(x)
#define IN_RANGE_INCL(a, b, c)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_INIT(stack, tot)
#define STACK_SIZE(stack)
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)
int mesh_get_x_mirror_vert(struct Object *ob, struct Mesh *me_eval, int index, const bool use_topology)
struct BMVert * editbmesh_get_x_mirror_vert(struct Object *ob, struct BMEditMesh *em, struct BMVert *eve, const float co[3], int index, const 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, const int axis, const bool use_self, const bool use_select, const bool respecthide, const 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)(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 RGB to Bright Vector Camera CLAMP
#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
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)
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)
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_copy_to_linked(wmOperatorType *ot)
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)
static bool object_array_for_wpaint_filter(Object *ob, void *user_data)
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)
const EnumPropertyItem * ED_object_vgroup_selection_itemf_helper(const bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free, const uint selection_mask)
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)
static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *UNUSED(op))
#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)
#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))
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)
@ SORT_TYPE_BONEHIERARCHY
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)
@ VGROUP_MASK_INVERT_UNSELECTED
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)
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_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
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))