141 for (
int i = 0;
i < dvert_tot;
i++) {
143 for (
int j = 0; j < dv->
totweight; j++) {
156 const bool use_vert_sel,
157 std::optional<int> current_frame)
160 *dvert_arr =
nullptr;
174 if (cd_dvert_offset == -1) {
203 if (!
mesh->deform_verts().is_empty()) {
206 *dvert_tot =
mesh->verts_num;
214 for (
int i = 0;
i <
mesh->verts_num;
i++) {
215 (*dvert_arr)[
i] = select_vert[
i] ? &dverts[
i] :
nullptr;
219 for (
int i = 0;
i <
mesh->verts_num;
i++) {
220 (*dvert_arr)[
i] = &dverts[
i];
238 for (
int i = 0;
i < *dvert_tot;
i++) {
243 for (
int i = 0;
i < *dvert_tot;
i++) {
244 (*dvert_arr)[
i] = lt->
dvert +
i;
253 if (!current_frame) {
262 *layer, *current_frame);
270 const int points_num =
curves.points_num();
271 *dvert_tot = points_num;
274 for (
int i = 0;
i < points_num;
i++) {
275 (*dvert_arr)[
i] = &dverts[
i];
294 const bool *vgroup_validmap,
295 const int vgroup_tot)
315 for (
int i_src = 0; i_src < dvert_tot; i_src++) {
316 if (dvert_array[i_src] !=
nullptr) {
319 if (i_dst != -1 && dvert_array_all[i_dst] !=
nullptr) {
325 dv_dst, dv_src, vgroup_validmap, vgroup_tot, flip_map, flip_map_len);
327 dvert_array[i_dst] = dvert_array_all[i_dst];
354 for (
int i = 0;
i < dvert_tot;
i++) {
355 if (dvert_array[
i] ==
nullptr) {
358 if ((i_sel != -1) && (i_sel !=
i) && (dvert_array[i_sel])) {
360 dvert_array[
i] = dvert_array_all[
i];
370 const bool *vgroup_validmap,
371 const int vgroup_tot,
373 const bool keep_single)
377 for (
int i = 0;
i < dvert_tot;
i++) {
379 if (!(dv = dvert_array[
i])) {
393 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
394 if (dw->
weight <= epsilon) {
414 bool new_vgroup =
false;
426 static_cast<ID *
>(ob_from->
data), &dvert_array_from, &dvert_tot_from,
false);
429 if ((dvert_array ==
nullptr) && (dvert_array_from !=
nullptr) &&
436 if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from ==
nullptr ||
437 dvert_array ==
nullptr)
442 if (dvert_array_from) {
446 if (new_vgroup ==
true) {
452 return (dvert_tot == dvert_tot_from);
461 if (defbase_tot_from < defbase_tot) {
464 for (
i = 0;
i <= defbase_tot_from;
i++) {
467 for (;
i <= defbase_tot;
i++) {
474 if (dvert_array_from !=
nullptr && dvert_array !=
nullptr) {
475 dvf = dvert_array_from;
478 for (
i = 0;
i < dvert_tot;
i++, dvf++, dv++) {
496 float *dvert_weights,
499 for (
int i = 0;
i < dvert_tot;
i++) {
507 const float *dvert_weights,
509 const bool remove_zero)
513 for (
i = 0;
i < dvert_tot;
i++) {
516 if (dvert_weights[
i] > 0.0f) {
560 Object *ob,
BMVert *eve,
int def_nr,
int vidx,
const int cd_dvert_offset)
569 if (eve_mirr && eve_mirr != eve) {
591 if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
641 int subset_count, vgroup_tot;
642 const bool *vgroup_validmap;
651 if (dvert_act ==
nullptr) {
656 ob, subset_type, &vgroup_tot, &subset_count);
662 *dvert_act,
Span(vgroup_validmap, vgroup_tot),
Span(lock_flags, vgroup_tot));
688 int i, vgroup_tot, subset_count;
690 ob, subset_type, &vgroup_tot, &subset_count);
721 for (
i = 0;
i <
mesh->verts_num;
i++) {
722 if (select_vert[
i] && &dverts[
i] != dvert_act) {
746 "Selected Pose Bones",
747 "All Vertex Groups assigned to Selection"},
752 "All Vertex Groups assigned to Deform Bones"},
753 {
WT_VGROUP_ALL,
"ALL", 0,
"All Groups",
"All Vertex Groups"},
754 {0,
nullptr, 0,
nullptr,
nullptr},
761 const uint selection_mask)
829 "Define which subset of groups shall be used");
854 Object *ob,
const int def_nr,
const int vertnum,
const float weight,
const int assignmode)
863 if (dvert ==
nullptr) {
868 if ((vertnum < 0) || (vertnum >= tot)) {
879 switch (assignmode) {
899 switch (assignmode) {
985 if (cd_dvert_offset != -1 && vertnum < em->
bm->totvert) {
998 if (vertnum >=
mesh->verts_num) {
1001 dv = &dverts[vertnum];
1012 dv = <->
dvert[vertnum];
1057 using namespace bke;
1064 for (MutableDrawingInfo &info : drawings) {
1081 switch (selection_domain) {
1082 case AttrDomain::Point:
1084 for (const int point_i : range) {
1085 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1086 selection.span.typed<bool>()[point_i] = select;
1091 case AttrDomain::Curve: {
1094 for (const int curve_i : range) {
1095 const IndexRange points = points_by_curve[curve_i];
1096 bool any_point_in_group = false;
1097 for (const int point_i : points) {
1098 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1099 any_point_in_group = true;
1103 if (any_point_in_group) {
1104 selection.span.typed<bool>()[curve_i] = select;
1140 if (cd_dvert_offset != -1) {
1171 for (
const int i : select_vert.span.index_range()) {
1172 if (!hide_vert[
i]) {
1195 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
1202 if (actbp && bp == actbp) {
1221 int i, idg, icdg, dvert_tot = 0;
1231 if (!strstr(dg->
name,
"_copy")) {
1252 for (
i = 0;
i < dvert_tot;
i++) {
1257 const float weight = dw_org->weight;
1259 dw_cpy->weight = weight;
1284 float weight_max = 0.0f;
1286 for (
int i = 0;
i < dvert_tot;
i++) {
1289 if (!(dv = dvert_array[
i])) {
1299 if (weight_max > 0.0f) {
1300 for (
int i = 0;
i < dvert_tot;
i++) {
1303 if (!(dv = dvert_array[
i])) {
1309 dw->
weight /= weight_max;
1326 const bool *vgroup_validmap,
1327 const int vgroup_tot,
1345 for (
int i = 0;
i < dvert_tot;
i++) {
1347 if (!(dv = dvert_array[
i])) {
1353 if (vgroup_validmap[j]) {
1364 if (use_mirror && use_vert_sel) {
1391 const bool *vgroup_validmap,
1392 const int vgroup_tot,
1393 const bool lock_active,
1394 const bool soft_lock_active,
1396 std::optional<int> current_frame = {})
1401 const bool use_vert_sel = vertex_group_use_vert_sel(ob);
1406 vgroup_parray_alloc(
1407 static_cast<ID *
>(ob->
data), &dvert_array, &dvert_tot, use_vert_sel, current_frame);
1417 if (lock_flags_array) {
1418 lock_flags =
MutableSpan(lock_flags_array, vgroup_tot);
1420 else if (lock_active) {
1422 std::memset(lock_flags_array, 0, vgroup_tot);
1423 lock_flags =
MutableSpan(lock_flags_array, vgroup_tot);
1426 lock_flags[def_nr] =
true;
1430 if (soft_lock_active && !lock_active) {
1431 soft_lock_flags =
Vector(vgroup_tot,
false);
1432 soft_lock_flags[def_nr] =
true;
1435 const bool all_locked = !lock_flags.
is_empty() && !lock_flags.
contains(
false);
1441 for (
int i = 0;
i < dvert_tot;
i++) {
1465 const bool soft_lock_active,
1467 std::optional<int> current_frame = {})
1474 if (defgroup_validmap[def_nr] ==
true) {
1475 int subset_count, vgroup_tot;
1479 vgroup_normalize_all(
1480 ob, vgroup_validmap, vgroup_tot,
false, soft_lock_active, reports, current_frame);
1499 "Unlock all vertex groups if there is at least one locked group, lock all in other case"},
1500 {
VGROUP_LOCK,
"LOCK", 0,
"Lock",
"Lock all vertex groups"},
1501 {
VGROUP_UNLOCK,
"UNLOCK", 0,
"Unlock",
"Unlock all vertex groups"},
1502 {
VGROUP_INVERT,
"INVERT", 0,
"Invert",
"Invert the lock state of all vertex groups"},
1503 {0,
nullptr, 0,
nullptr,
nullptr},
1514 {
VGROUP_MASK_ALL,
"ALL", 0,
"All",
"Apply action to all vertex groups"},
1518 "INVERT_UNSELECTED",
1520 "Invert Unselected",
1521 "Apply the opposite of Lock/Unlock to unselected vertex groups"},
1522 {0,
nullptr, 0,
nullptr,
nullptr},
1545 if (sel_count == 0 && actdef >= 1 && actdef <= defbase_tot) {
1546 mask[actdef - 1] =
true;
1555 bool *selected =
nullptr;
1629 const bool *vgroup_validmap,
1630 const int vgroup_tot,
1632 const bool auto_assign,
1633 const bool auto_remove)
1646 for (
int i = 0;
i < dvert_tot;
i++) {
1648 if (!(dv = dvert_array[
i])) {
1655 if (vgroup_validmap[j]) {
1671 if (use_mirror && use_vert_sel) {
1684 const bool *vgroup_validmap,
1685 const int vgroup_tot,
1686 const int subset_count,
1689 const float fac_expand)
1692 BLI_assert(vgroup_tot > 0 && subset_count > 0);
1694 const float ifac = 1.0f - fac;
1703 const bool use_hide = use_select;
1705 const int expand_sign =
signum_i(fac_expand);
1706 const float expand =
fabsf(fac_expand);
1707 const float iexpand = 1.0f - expand;
1713 float *weight_accum_prev;
1714 float *weight_accum_curr;
1724 vgroup_subset_weights.
fill(0.0f);
1735 mesh->edges(),
mesh->verts_num, vert_to_edge_offsets, vert_to_edge_indices);
1744#define IS_BM_VERT_READ(v) (use_hide ? (BM_elem_flag_test(v, BM_ELEM_HIDDEN) == 0) : true)
1745#define IS_BM_VERT_WRITE(v) (use_select ? (BM_elem_flag_test(v, BM_ELEM_SELECT) != 0) : true)
1748 if (
mesh && use_hide) {
1749 hide_vert = *
mesh->attributes().lookup_or_default<
bool>(
1757 if (
mesh && use_select) {
1758 select_vert = *
mesh->attributes().lookup_or_default<
bool>(
1767 for (
int i = 0;
i < dvert_tot;
i++) {
1784 for (
int i = 0;
i < dvert_tot;
i++) {
1785 if (select_vert[
i]) {
1786 for (
int j = 0; j < emap[
i].
size(); j++) {
1787 const int2 &edge = edges[emap[
i][j]];
1788 const int i_other = (edge[0] ==
i) ? edge[1] : edge[0];
1789 if (!hide_vert[i_other]) {
1798 for (subset_index = 0; subset_index < subset_count; subset_index++) {
1799 const int def_nr = vgroup_subset_map[subset_index];
1803 (
const MDeformVert **)dvert_array, dvert_tot, weight_accum_prev, def_nr);
1804 memcpy(weight_accum_curr, weight_accum_prev,
sizeof(*weight_accum_curr) * dvert_tot);
1806 for (iter = 0; iter < repeat; iter++) {
1811 for (vi_step = verts_used; vi_step != vi_end; vi_step++) {
1812 const uint i = *vi_step;
1813 float weight_tot = 0.0f;
1814 float weight = 0.0f;
1816#define WEIGHT_ACCUMULATE \
1818 float weight_other = weight_accum_prev[i_other]; \
1819 float tot_factor = 1.0f; \
1820 if (expand_sign == 1) { \
1821 if (weight_other < weight_accum_prev[i]) { \
1822 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1823 tot_factor = iexpand; \
1826 else if (expand_sign == -1) { \
1827 if (weight_other > weight_accum_prev[i]) { \
1828 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1829 tot_factor = iexpand; \
1832 weight += tot_factor * weight_other; \
1833 weight_tot += tot_factor; \
1861 for (j = 0; j < emap[
i].
size(); j++) {
1862 const int2 &edge = edges[emap[
i][j]];
1863 const int i_other = (edge[0] ==
i ? edge[1] : edge[0]);
1864 if (!hide_vert[i_other]) {
1870#undef WEIGHT_ACCUMULATE
1872 if (weight_tot != 0.0f) {
1873 weight /= weight_tot;
1874 weight = (weight_accum_prev[
i] * ifac) + (weight * fac);
1877 CLAMP(weight, 0.0f, 1.0f);
1878 weight_accum_curr[
i] = weight;
1882 std::swap(weight_accum_curr, weight_accum_prev);
1888#undef IS_BM_VERT_READ
1889#undef IS_BM_VERT_WRITE
1942 const bool *vgroup_validmap,
1943 const int vgroup_tot,
1944 const int subset_count,
1945 const int max_weights)
1948 int i, dvert_tot = 0;
1955 int num_to_drop = 0;
1957 for (
i = 0;
i < dvert_tot;
i++) {
1960 int bone_count = 0, non_bone_count = 0;
1964 if (!(dv = dvert_array[
i])) {
1968 num_to_drop = subset_count - max_weights;
1971 if (num_to_drop > 0) {
1979 dw_temp[dv->
totweight - 1 - bone_count] = dv->
dw[j];
1983 dw_temp[non_bone_count] = dv->
dw[j];
1984 non_bone_count += 1;
1988 num_to_drop = bone_count - max_weights;
1989 if (num_to_drop > 0) {
1990 qsort(&dw_temp[non_bone_count],
1999 remove_tot += num_to_drop;
2013 const bool *vgroup_validmap,
2014 const int vgroup_tot,
2016 const float epsilon,
2017 const bool keep_single)
2029 if (use_mirror && use_vert_sel) {
2037 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot, epsilon, keep_single);
2044 const bool *vgroup_validmap,
2045 const int vgroup_tot,
2058 const float steps_fl = steps;
2061 if (use_mirror && use_vert_sel) {
2065 for (
int i = 0;
i < dvert_tot;
i++) {
2069 if (!(dv = dvert_array[
i])) {
2074 for (j = 0, dw = dv->
dw; j < dv->totweight; j++, dw++) {
2075 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
2089 const char sel_mirr,
2090 const int *flip_map,
2091 const int flip_map_len,
2092 const bool mirror_weights,
2093 const bool flip_vgroups,
2094 const bool all_vgroups,
2095 const int act_vgroup)
2099 if (sel_mirr && sel) {
2101 if (mirror_weights) {
2103 std::swap(*dvert, *dvert_mirr);
2109 if (dw && dw_mirr) {
2133 std::swap(dvert, dvert_mirr);
2136 if (mirror_weights) {
2153 const bool mirror_weights,
2154 const bool flip_vgroups,
2155 const bool all_vgroups,
2156 const bool use_topology,
2163 int totmirr = 0, totfail = 0;
2165 *r_totmirr = *r_totfail = 0;
2169 if ((mirror_weights ==
false && flip_vgroups ==
false) ||
2175 int *flip_map =
nullptr;
2183 if (flip_map ==
nullptr) {
2201 if (cd_dvert_offset == -1) {
2214 if (eve_mirr != eve) {
2219 if ((sel || sel_mirr) && (eve != eve_mirr)) {
2251 if (
mesh->deform_verts().is_empty()) {
2261 for (
int vidx = 0; vidx <
mesh->verts_num; vidx++) {
2265 if (vidx != vidx_mirr) {
2267 const bool sel = use_sel ? select_vert[vidx] :
true;
2268 const bool sel_mirr = use_sel ? select_vert[vidx_mirr] :
true;
2270 if (sel || sel_mirr) {
2302 if (lt->
pntsu == 1 || lt->
dvert ==
nullptr) {
2309 int pntsu_half = lt->
pntsu / 2;
2311 for (
int w = 0;
w < lt->
pntsw;
w++) {
2312 for (
int v = 0;
v < lt->
pntsv;
v++) {
2313 for (
int u = 0; u < pntsu_half; u++) {
2314 int u_inv = (lt->
pntsu - 1) - u;
2323 const bool sel_mirr = bp_mirr->
f1 &
SELECT;
2325 if (sel || sel_mirr) {
2347 if (flip_vgroups && flip_map[def_nr] >= 0) {
2348 ob->actdef = flip_map[def_nr] + 1;
2353 *r_totmirr = totmirr;
2354 *r_totfail = totfail;
2360#undef VGROUP_MIRR_OP
2388 if (
mesh->runtime->edit_mesh) {
2390 int cd_dvert_offset;
2422 for (
int i = 0;
i <
mesh->verts_num;
i++) {
2423 if (select_vert[
i]) {
2439 if (lt->
dvert ==
nullptr) {
2446 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
2465 for (MutableDrawingInfo info : drawings) {
2540 const bool needs_select,
2541 const short ob_type_flag)
2549 if (ob_type_flag && ((1 << ob->
type) & ob_type_flag) == 0) {
2570static bool vertex_group_vert_poll(
bContext *
C)
2572 return vertex_group_vert_poll_ex(
C,
false, 0);
2587static bool vertex_group_mesh_vert_select_poll(
bContext *
C)
2589 return vertex_group_vert_poll_ex(
C,
true, (1 <<
OB_MESH));
2656 ot->name =
"Add Vertex Group";
2657 ot->idname =
"OBJECT_OT_vertex_group_add";
2658 ot->description =
"Add a new vertex group to the active object";
2677 const bool use_selection,
2678 const bool all_drawings =
false)
2697 for (
const MutableDrawingInfo &info : drawings) {
2705 const bool use_selection,
2706 const bool all_drawings =
false,
2707 const bool only_unlocked =
false)
2729 if (all_vgroup || only_unlocked) {
2744 if (all_vgroup || only_unlocked) {
2763 ot->name =
"Remove Vertex Group";
2764 ot->idname =
"OBJECT_OT_vertex_group_remove";
2765 ot->description =
"Delete the active or all vertex groups from the active object";
2781 ot->srna,
"all_unlocked",
false,
"All Unlocked",
"Remove all unlocked vertex groups");
2801 const int current_frame = scene.
r.
cfra;
2818 ot->name =
"Assign to Vertex Group";
2819 ot->idname =
"OBJECT_OT_vertex_group_assign";
2820 ot->description =
"Assign the selected vertices to the active vertex group";
2853 ot->name =
"Assign to New Group";
2854 ot->idname =
"OBJECT_OT_vertex_group_assign_new";
2855 ot->description =
"Assign the selected vertices to a new vertex group";
2882 if (use_all_groups) {
2894 if (dg ==
nullptr) {
2909 const int current_frame = scene.
r.
cfra;
2927 ot->name =
"Remove from Vertex Group";
2928 ot->idname =
"OBJECT_OT_vertex_group_remove_from";
2929 ot->description =
"Remove the selected vertices from active or all vertex group(s)";
2943 ot->srna,
"use_all_groups",
false,
"All Groups",
"Remove from all groups");
2946 ot->srna,
"use_all_verts",
false,
"All Vertices",
"Clear the active group");
2976 ot->name =
"Select Vertex Group";
2977 ot->idname =
"OBJECT_OT_vertex_group_select";
2978 ot->description =
"Select all the vertices assigned to the active vertex group";
3010 ot->name =
"Deselect Vertex Group";
3011 ot->idname =
"OBJECT_OT_vertex_group_deselect";
3012 ot->description =
"Deselect all selected vertices assigned to the active vertex group";
3044 ot->name =
"Duplicate Vertex Group";
3045 ot->idname =
"OBJECT_OT_vertex_group_copy";
3046 ot->description =
"Make a copy of the active vertex group";
3071 int subset_count, vgroup_tot;
3074 ob, subset_type, &vgroup_tot, &subset_count);
3088 ot->name =
"Vertex Group Levels";
3089 ot->idname =
"OBJECT_OT_vertex_group_levels";
3091 "Add some offset and multiply with some gain the weights of the active vertex group";
3102 ot->srna,
"offset", 0.0f, -1.0, 1.0,
"Offset",
"Value to add to weights", -1.0f, 1.0f);
3104 ot->srna,
"gain", 1.0f, 0.0f,
FLT_MAX,
"Gain",
"Value to multiply weights by", 0.0f, 10.0f);
3133 ot->name =
"Normalize Vertex Group";
3134 ot->idname =
"OBJECT_OT_vertex_group_normalize";
3136 "Normalize weights of the active vertex group, so that the highest ones are now 1.0";
3167 for (
int i = 0;
i < defgroup_tot;
i++) {
3168 if (defgroup_validmap[
i] ==
true) {
3176 return target_group;
3191 int subset_count, vgroup_tot;
3193 ob, subset_type, &vgroup_tot, &subset_count);
3195 if (subset_count == 0) {
3203 ob, vgroup_validmap, vgroup_tot, lock_active,
false, op->
reports, current_frame);
3207 ob, vgroup_validmap, vgroup_tot, lock_active,
false, op->
reports);
3228 ot->name =
"Normalize All Vertex Groups";
3229 ot->idname =
"OBJECT_OT_vertex_group_normalize_all";
3231 "Normalize all weights of all vertex groups, "
3232 "so that for each vertex, the sum of all weights is 1.0";
3246 "Keep the values of the active group while normalizing others");
3282 return TIP_(
"Lock all vertex groups of the active object");
3284 return TIP_(
"Lock selected vertex groups of the active object");
3286 return TIP_(
"Lock unselected vertex groups of the active object");
3288 return TIP_(
"Lock selected and unlock unselected vertex groups of the active object");
3294 return TIP_(
"Unlock all vertex groups of the active object");
3296 return TIP_(
"Unlock selected vertex groups of the active object");
3298 return TIP_(
"Unlock unselected vertex groups of the active object");
3300 return TIP_(
"Unlock selected and lock unselected vertex groups of the active object");
3306 return TIP_(
"Toggle locks of all vertex groups of the active object");
3308 return TIP_(
"Toggle locks of selected vertex groups of the active object");
3310 return TIP_(
"Toggle locks of unselected vertex groups of the active object");
3313 "Toggle locks of all and invert unselected vertex groups of the active object");
3319 return TIP_(
"Invert locks of all vertex groups of the active object");
3322 return TIP_(
"Invert locks of selected vertex groups of the active object");
3324 return TIP_(
"Invert locks of unselected vertex groups of the active object");
3336 ot->name =
"Change the Lock On Vertex Groups";
3337 ot->idname =
"OBJECT_OT_vertex_group_lock";
3338 ot->description =
"Change the lock state of all or some vertex groups of active object";
3353 "Lock action to execute on vertex groups");
3360 "Apply the action based on vertex group selection");
3378 int subset_count, vgroup_tot;
3381 ob, subset_type, &vgroup_tot, &subset_count);
3395 ot->name =
"Invert Vertex Group";
3396 ot->idname =
"OBJECT_OT_vertex_group_invert";
3397 ot->description =
"Invert active vertex group's weights";
3411 "Add vertices from groups that have zero weight before inverting");
3416 "Remove vertices from groups that have zero weight after inverting");
3433 bool has_vgroup_multi =
false;
3435 for (
Object *ob : objects) {
3436 int subset_count, vgroup_tot;
3439 ob, subset_type, &vgroup_tot, &subset_count);
3443 if (locked_vgroups) {
3445 for (
int i = 0;
i < vgroup_tot;
i++) {
3446 if (vgroup_validmap[
i] && locked_vgroups[
i]) {
3447 vgroup_validmap[
i] =
false;
3454 has_vgroup_multi =
true;
3458 ob, vgroup_validmap, vgroup_tot, subset_count, fac, repeat, fac_expand);
3475 if (!has_vgroup_multi) {
3485 ot->name =
"Smooth Vertex Weights";
3486 ot->idname =
"OBJECT_OT_vertex_group_smooth";
3487 ot->description =
"Smooth weights for selected vertices";
3497 RNA_def_float(
ot->srna,
"factor", 0.5f, 0.0f, 1.0,
"Factor",
"", 0.0f, 1.0f);
3498 RNA_def_int(
ot->srna,
"repeat", 1, 1, 10000,
"Iterations",
"", 1, 200);
3506 "Expand/contract weights",
3525 for (
Object *ob : objects) {
3526 int subset_count, vgroup_tot;
3529 ob, subset_type, &vgroup_tot, &subset_count);
3545 ot->name =
"Clean Vertex Group Weights";
3546 ot->idname =
"OBJECT_OT_vertex_group_clean";
3547 ot->description =
"Remove vertex group assignments which are not required";
3563 "Remove vertices which weight is below or equal to this limit",
3570 "Keep verts assigned to at least one group when cleaning");
3587 int subset_count, vgroup_tot;
3590 ob, subset_type, &vgroup_tot, &subset_count);
3604 ot->name =
"Quantize Vertex Weights";
3605 ot->idname =
"OBJECT_OT_vertex_group_quantize";
3606 ot->description =
"Set weights to a fixed number of steps";
3616 RNA_def_int(
ot->srna,
"steps", 4, 1, 1000,
"Steps",
"Number of steps between 0 and 1", 1, 100);
3630 int remove_multi_count = 0;
3633 for (
Object *ob : objects) {
3635 int subset_count, vgroup_tot;
3637 ob, subset_type, &vgroup_tot, &subset_count);
3639 ob, vgroup_validmap, vgroup_tot, subset_count, limit);
3642 if (remove_count != 0) {
3647 remove_multi_count += remove_count;
3650 if (remove_multi_count) {
3653 "%d vertex weights limited",
3654 remove_multi_count);
3667 ot->name =
"Limit Number of Weights per Vertex";
3668 ot->idname =
"OBJECT_OT_vertex_group_limit_total";
3670 "Limit deform weights associated with a vertex to a specified number by removing lowest "
3681 RNA_def_int(
ot->srna,
"limit", 4, 1, 32,
"Limit",
"Maximum number of deform weights", 1, 32);
3693 int totmirr = 0, totfail = 0;
3716 ot->name =
"Mirror Vertex Group";
3717 ot->idname =
"OBJECT_OT_vertex_group_mirror";
3719 "Mirror vertex group, flip weights and/or names, editing only selected vertices, "
3720 "flipping when both sides are selected otherwise copy from unselected";
3730 RNA_def_boolean(
ot->srna,
"mirror_weights",
true,
"Mirror Weights",
"Mirror weights");
3732 ot->srna,
"flip_group_names",
true,
"Flip Group Names",
"Flip vertex group names");
3733 RNA_def_boolean(
ot->srna,
"all_groups",
false,
"All Groups",
"Mirror all vertex groups weights");
3739 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
3751 int changed_tot = 0;
3769 if ((changed_tot == 0 && fail == 0) || fail) {
3772 "Copy vertex groups to selected: %d done, %d failed (object data must support "
3773 "vertex groups and have matching indices)",
3784 ot->name =
"Copy Vertex Group to Selected";
3785 ot->idname =
"OBJECT_OT_vertex_group_copy_to_selected";
3786 ot->description =
"Replace vertex groups of selected objects by vertex groups of active object";
3838 tmp.
icon = ICON_GROUP_VERTEX;
3855 ot->name =
"Set Active Vertex Group";
3856 ot->idname =
"OBJECT_OT_vertex_group_set_active";
3857 ot->description =
"Set the active vertex group";
3887 char *name_array =
static_cast<char *
>(
3909 int *sort_map = sort_map_update + 1;
3932 if (cd_dvert_offset != -1) {
3956 while (dvert_tot--) {
3966 for (
i = 0;
i < defbase_tot;
i++) {
3970 sort_map_update[0] = 0;
3996 if (bonebase ==
nullptr) {
3998 if (armobj !=
nullptr) {
4005 if (bonebase !=
nullptr) {
4010 if (dg !=
nullptr) {
4036 switch (sort_type) {
4065 {0,
nullptr, 0,
nullptr,
nullptr},
4068 ot->name =
"Sort Vertex Groups";
4069 ot->idname =
"OBJECT_OT_vertex_group_sort";
4070 ot->description =
"Sort vertex groups";
4125 {-1,
"UP", 0,
"Up",
""},
4126 {1,
"DOWN", 0,
"Down",
""},
4127 {0,
nullptr, 0,
nullptr,
nullptr},
4131 ot->name =
"Move Vertex Group";
4132 ot->idname =
"OBJECT_OT_vertex_group_move";
4133 ot->description =
"Move the active vertex group up/down in the list";
4147 "Direction to move the active vertex group towards");
4169 if (dvert_act ==
nullptr) {
4194 if (dvert_act ==
nullptr) {
4203 for (
i = 0;
i <
mesh->verts_num;
i++) {
4204 if (select_vert[
i] && (&dverts[
i] != dvert_act)) {
4258 ot->name =
"Paste Weight to Selected";
4259 ot->idname =
"OBJECT_OT_vertex_weight_paste";
4261 "Copy this group's weight to other selected vertices (disabled if vertex group is locked)";
4276 "Index of source weight in active vertex group",
4309 ot->name =
"Delete Weight";
4310 ot->idname =
"OBJECT_OT_vertex_weight_delete";
4311 ot->description =
"Delete this weight from the vertex (disabled if vertex group is locked)";
4326 "Index of source weight in active vertex group",
4343 if (wg_index != -1) {
4356 ot->name =
"Set Active Group";
4357 ot->idname =
"OBJECT_OT_vertex_weight_set_active";
4358 ot->description =
"Set as active vertex group";
4373 "Index of source weight in active vertex group",
4407 ot->name =
"Normalize Active";
4408 ot->idname =
"OBJECT_OT_vertex_weight_normalize_active_vertex";
4409 ot->description =
"Normalize active vertex's weights";
4442 ot->name =
"Copy Active";
4443 ot->idname =
"OBJECT_OT_vertex_weight_copy";
4444 ot->description =
"Copy weights from active to selected";
#define CTX_DATA_BEGIN(C, Type, instance, member)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
Utility functions for vertex groups in grease pencil objects.
BPoint * BKE_lattice_active_point_get(Lattice *lt)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
Mesh * BKE_mesh_from_object(Object *ob)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
bool BKE_object_is_in_wpaint_select_vert(const Object *ob)
bool BKE_object_is_in_editmode_vgroup(const 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_assert_unreachable()
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
void void BLI_listbase_sort(ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
MINLINE float max_ff(float a, float b)
MINLINE int signum_i(float a)
int char char int int int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define SNPRINTF_UTF8(dst, format,...)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#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)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
#define ID_IS_EDITABLE(_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
MDeformVert * ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
void ED_mesh_report_mirror(ReportList &reports, int totmirr, int totfail)
void EDBM_select_flush_from_verts(BMEditMesh *em, bool select)
bool EDBM_uvselect_clear(BMEditMesh *em)
BMVert * EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v)
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
void paintvert_flush_flags(Object *ob)
int mesh_get_x_mirror_vert(Object *ob, Mesh *mesh_eval, int index, bool use_topology)
int ED_mesh_mirror_get_vert(Object *ob, int index)
void EDBM_verts_mirror_cache_end(BMEditMesh *em)
MDeformVert * ED_mesh_active_dvert_get_only(Object *ob)
MDeformVert * ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
BMVert * editbmesh_get_x_mirror_vert(Object *ob, BMEditMesh *em, BMVert *eve, const float co[3], int index, bool use_topology)
bool ED_operator_object_active_local_editable_ex(bContext *C, const Object *ob)
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
#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)
BMesh const char void * data
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.
static VArray from_single(T value, const int64_t size)
void fill(const T &value) const
constexpr bool contains(const T &value) const
constexpr bool is_empty() const
constexpr bool is_empty() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, AttrType data_type)
bke::CurvesGeometry & strokes_for_write()
blender::bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings)
void * MEM_mallocN(size_t len, const char *str)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
bool remove_from_vertex_group(Drawing &drawing, StringRef name, bool use_selection)
void assign_to_vertex_group(Drawing &drawing, StringRef name, float weight)
GroupedSpan< int > build_vert_to_edge_map(Span< int2 > edges, int verts_num, Array< int > &r_offsets, Array< int > &r_indices)
bke::GSpanAttributeWriter ensure_selection_attribute(bke::CurvesGeometry &curves, bke::AttrDomain selection_domain, bke::AttrType create_type, StringRef attribute_name)
void vgroup_parray_to_weight_array(const MDeformVert **dvert_array, int dvert_tot, float *dvert_weights, int def_nr)
void OBJECT_OT_vertex_weight_paste(wmOperatorType *ot)
static void grease_pencil_clear_from_all_vgroup(Scene &scene, Object &ob, const bool use_selection, const bool all_drawings=false, const bool only_unlocked=false)
static wmOperatorStatus vertex_group_limit_total_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vertex_group_normalize_all_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_group_normalize(wmOperatorType *ot)
static wmOperatorStatus vertex_weight_copy_exec(bContext *C, wmOperator *)
void OBJECT_OT_vertex_group_sort(wmOperatorType *ot)
void OBJECT_OT_vertex_group_levels(wmOperatorType *ot)
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)
static bool object_array_for_wpaint_filter(const Object *ob, void *user_data)
void OBJECT_OT_vertex_weight_set_active(wmOperatorType *ot)
static wmOperatorStatus vertex_weight_normalize_active_vertex_exec(bContext *C, wmOperator *)
static void vgroup_quantize_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int, const int steps)
static int vgroup_sort_name(const void *def_a_ptr, const void *def_b_ptr)
static bool vgroup_normalize_active_vertex(Object *ob, eVGroupSelect subset_type)
static bool vgroup_normalize(Object *ob)
void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot)
void OBJECT_OT_vertex_group_smooth(wmOperatorType *ot)
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
static const EnumPropertyItem vgroup_lock_actions[]
static const EnumPropertyItem * rna_vertex_group_select_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static void vgroup_nr_vert_add(Object *ob, const int def_nr, const int vertnum, const float weight, const int assignmode)
static wmOperatorStatus vertex_group_levels_exec(bContext *C, wmOperator *op)
void vgroup_data_clamp_range(ID *id, int total)
void vgroup_parray_from_weight_array(MDeformVert **dvert_array, int dvert_tot, const float *dvert_weights, int def_nr, bool remove_zero)
bool vgroup_array_copy(Object *ob, Object *ob_from)
static wmOperatorStatus vertex_group_assign_exec(bContext *C, wmOperator *op)
static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
void vgroup_parray_remove_zero(MDeformVert **dvert_array, int dvert_tot, const bool *vgroup_validmap, int vgroup_tot, float epsilon, bool keep_single)
static wmOperatorStatus vertex_weight_paste_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem * rna_vertex_group_with_single_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
static wmOperatorStatus vertex_weight_set_active_exec(bContext *C, wmOperator *op)
void OBJECT_OT_vertex_weight_normalize_active_vertex(wmOperatorType *ot)
static void mesh_defvert_mirror_update_internal(Object *ob, MDeformVert *dvert_dst, MDeformVert *dvert_src, const int def_nr)
void OBJECT_OT_vertex_group_assign(wmOperatorType *ot)
bool vgroup_sync_from_pose(Object *ob)
void OBJECT_OT_vertex_group_limit_total(wmOperatorType *ot)
static wmOperatorStatus vertex_group_copy_exec(bContext *C, wmOperator *)
static void vgroup_normalize_all_deform_if_active_is_deform(Object *ob, const bool soft_lock_active, ReportList *reports, std::optional< int > current_frame={})
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 void vgroup_duplicate(Object *ob)
static void vgroup_sort_bone_hierarchy(Object *ob, ListBase *bonebase)
static wmOperatorStatus vertex_group_clean_exec(bContext *C, wmOperator *op)
bool vgroup_parray_alloc(ID *id, MDeformVert ***dvert_arr, int *dvert_tot, bool use_vert_sel, std::optional< int > current_frame={})
static const EnumPropertyItem vgroup_lock_mask[]
void OBJECT_OT_vertex_group_copy_to_selected(wmOperatorType *ot)
static bool vertex_group_supported_poll(bContext *C)
static void mesh_defvert_mirror_update_em(Object *ob, BMVert *eve, int def_nr, int vidx, const int cd_dvert_offset)
void OBJECT_OT_vertex_weight_copy(wmOperatorType *ot)
static void vgroup_grease_pencil_select_verts(const Scene &scene, const ToolSettings &tool_settings, const bDeformGroup *def_group, const bool select, Object &object)
void vgroup_parray_mirror_assign(Object *ob, MDeformVert **dvert_array, int dvert_tot)
static bool UNUSED_FUNCTION vertex_group_poll_edit(bContext *C)
static wmOperatorStatus vertex_group_invert_exec(bContext *C, wmOperator *op)
static void vgroup_clean_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int, const float epsilon, const bool keep_single)
static wmOperatorStatus vertex_group_lock_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vertex_group_assign_new_exec(bContext *C, wmOperator *op)
Object * context_object(const bContext *C)
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 wmOperatorStatus vertex_group_add_exec(bContext *C, wmOperator *)
static Lattice * vgroup_edit_lattice(Object *ob)
void OBJECT_OT_vertex_group_mirror(wmOperatorType *ot)
float vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum)
static wmOperatorStatus set_active_group_exec(bContext *C, wmOperator *op)
static char * vgroup_init_remap(Object *ob)
static wmOperatorStatus vertex_group_select_exec(bContext *C, wmOperator *)
void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
@ VGROUP_MASK_INVERT_UNSELECTED
static bool vertex_group_vert_select_poll(bContext *C)
static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
static bool vertex_group_poll_ex(bContext *C, Object *ob)
static wmOperatorStatus vertex_group_remove_from_exec(bContext *C, wmOperator *op)
static void vgroup_delete_active(Object *ob)
void OBJECT_OT_vertex_group_invert(wmOperatorType *ot)
void OBJECT_OT_vertex_group_move(wmOperatorType *ot)
static void grease_pencil_clear_from_vgroup(Scene &scene, Object &ob, bDeformGroup *dg, const bool use_selection, const bool all_drawings=false)
void vgroup_mirror(Object *ob, bool mirror_weights, bool flip_vgroups, bool all_vgroups, bool use_topology, int *r_totmirr, int *r_totfail)
static wmOperatorStatus vertex_group_mirror_exec(bContext *C, wmOperator *op)
static bool vgroup_normalize_all(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const bool lock_active, const bool soft_lock_active, ReportList *reports, std::optional< int > current_frame={})
void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot)
const EnumPropertyItem * vgroup_selection_itemf_helper(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free, unsigned int selection_mask)
static wmOperatorStatus vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op)
static void mesh_defvert_mirror_update_ob(Object *ob, int def_nr, int vidx)
static bool vertex_group_vert_select_unlocked_poll(bContext *C)
static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
static const EnumPropertyItem * vgroup_itemf(bContext *C, PointerRNA *, PropertyRNA *, bool *r_free)
static void vgroup_invert_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int, const bool auto_assign, const bool auto_remove)
void vgroup_select_by_name(Object *ob, const char *name)
static eVGroupSelect normalize_vertex_group_target(Object *ob)
static wmOperatorStatus vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op)
void OBJECT_OT_vertex_group_assign_new(wmOperatorType *ot)
static wmOperatorStatus vertex_group_deselect_exec(bContext *C, wmOperator *)
static void vgroup_operator_subset_select_props(wmOperatorType *ot, bool use_active)
void OBJECT_OT_vertex_weight_delete(wmOperatorType *ot)
static wmOperatorStatus vertex_weight_delete_exec(bContext *C, wmOperator *op)
static bool vertex_group_vert_poll_ex(bContext *C, const bool needs_select, const short ob_type_flag)
static bool vertex_group_supported_poll_ex(bContext *C, const Object *ob)
void OBJECT_OT_vertex_group_copy(wmOperatorType *ot)
void vgroup_parray_mirror_sync(Object *ob, MDeformVert **dvert_array, int dvert_tot, const bool *vgroup_validmap, int vgroup_tot)
static wmOperatorStatus vertex_group_smooth_exec(bContext *C, wmOperator *op)
static void vgroup_select_verts(const ToolSettings &tool_settings, Object *ob, Scene &scene, int select)
static bool vertex_group_mesh_vert_poll(bContext *C)
static bool vertex_group_poll(bContext *C)
static float get_vert_def_nr(Object *ob, const int def_nr, const int vertnum)
void OBJECT_OT_vertex_group_quantize(wmOperatorType *ot)
static Vector< Object * > object_array_for_wpaint(bContext *C)
static void vgroup_levels_subset(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const int, const float offset, const float gain)
@ SORT_TYPE_BONEHIERARCHY
static wmOperatorStatus vgroup_move_exec(bContext *C, wmOperator *op)
static wmOperatorStatus vertex_group_quantize_exec(bContext *C, wmOperator *op)
static std::string vertex_group_lock_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
void vgroup_vert_add(Object *ob, bDeformGroup *dg, int vertnum, float weight, int assignmode)
static const EnumPropertyItem WT_vertex_group_select_item[]
void OBJECT_OT_vertex_group_remove(wmOperatorType *ot)
void vgroup_vert_remove(Object *ob, bDeformGroup *dg, int vertnum)
static bool vertex_group_use_vert_sel(Object *ob)
static wmOperatorStatus vertex_group_sort_exec(bContext *C, wmOperator *op)
static bool check_vertex_group_accessible(wmOperator *op, Object *ob, int def_nr)
void OBJECT_OT_vertex_group_add(wmOperatorType *ot)
static void vgroup_assign_verts(Object *ob, Scene &scene, const float weight)
static wmOperatorStatus vertex_group_normalize_exec(bContext *C, wmOperator *)
blender::Vector< Object * > objects_in_mode_or_selected(bContext *C, bool(*filter_fn)(const Object *ob, void *user_data), void *filter_user_data)
void OBJECT_OT_vertex_group_clean(wmOperatorType *ot)
void OBJECT_OT_vertex_group_select(wmOperatorType *ot)
static void vgroup_remove_weight(Object *ob, const int def_nr)
void vgroup_vert_active_mirror(Object *ob, int def_nr)
static void vgroup_lock_all(Object *ob, int action, int mask)
static bool vertex_group_vert_select_mesh_poll(bContext *C)
static wmOperatorStatus vertex_group_remove_exec(bContext *C, wmOperator *op)
static bool * vgroup_selected_get(Object *ob)
void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< int32_t, 2 > int2
float wrap(float value, float max, float min)
#define IS_BM_VERT_READ(v)
#define IS_BM_VERT_WRITE(v)
#define WEIGHT_ACCUMULATE
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)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int 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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
static void def_group(BlenderRNA *, StructRNA *srna)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
struct MDeformVert * dvert
struct EditLatt * editlatt
struct ToolSettings * toolsettings
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)