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;
163 switch (
GS(
id->name)) {
173 if (cd_dvert_offset == -1) {
202 if (!
mesh->deform_verts().is_empty()) {
205 *dvert_tot =
mesh->verts_num;
213 for (
int i = 0; i <
mesh->verts_num; i++) {
214 (*dvert_arr)[i] = select_vert[i] ? &dverts[i] :
nullptr;
218 for (
int i = 0; i <
mesh->verts_num; i++) {
219 (*dvert_arr)[i] = &dverts[i];
228 Lattice *lt = id_cast<Lattice *>(
id);
237 for (
int i = 0; i < *dvert_tot; i++) {
238 (*dvert_arr)[i] = (def->
f1 &
SELECT) ? <->
dvert[i] :
nullptr;
242 for (
int i = 0; i < *dvert_tot; i++) {
243 (*dvert_arr)[i] = lt->
dvert + i;
252 if (!current_frame) {
261 *
layer, *current_frame);
269 const int points_num =
curves.points_num();
270 *dvert_tot = points_num;
273 for (
int i = 0; i < points_num; i++) {
274 (*dvert_arr)[i] = &dverts[i];
293 const bool *vgroup_validmap,
294 const int vgroup_tot)
311 for (
int i_src = 0; i_src < dvert_tot; i_src++) {
312 if (dvert_array[i_src] !=
nullptr) {
315 if (i_dst != -1 && dvert_array_all[i_dst] !=
nullptr) {
321 dv_dst, dv_src, vgroup_validmap, vgroup_tot, flip_map, flip_map_len);
323 dvert_array[i_dst] = dvert_array_all[i_dst];
328 MEM_delete(flip_map);
329 MEM_delete(dvert_array_all);
347 for (
int i = 0; i < dvert_tot; i++) {
348 if (dvert_array[i] ==
nullptr) {
351 if ((i_sel != -1) && (i_sel != i) && (dvert_array[i_sel])) {
353 dvert_array[i] = dvert_array_all[i];
358 MEM_delete(dvert_array_all);
363 const bool *vgroup_validmap,
364 const int vgroup_tot,
366 const bool keep_single)
370 for (
int i = 0; i < dvert_tot; i++) {
372 if (!(dv = dvert_array[i])) {
386 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
387 if (dw->
weight <= epsilon) {
405 int defbase_tot_from = defbase_src->count();
406 int defbase_tot = defbase_dst->count();
407 bool new_vgroup =
false;
421 if ((dvert_array ==
nullptr) && (dvert_array_from !=
nullptr) &&
428 if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from ==
nullptr ||
429 dvert_array ==
nullptr)
432 MEM_delete(dvert_array);
434 if (dvert_array_from) {
435 MEM_delete(dvert_array_from);
438 if (new_vgroup ==
true) {
444 return (dvert_tot == dvert_tot_from);
449 defbase_dst->free_no_destruct();
453 if (defbase_tot_from < defbase_tot) {
456 for (i = 0; i <= defbase_tot_from; i++) {
459 for (; i <= defbase_tot; i++) {
466 if (dvert_array_from !=
nullptr && dvert_array !=
nullptr) {
467 dvf = dvert_array_from;
470 for (i = 0; i < dvert_tot; i++, dvf++, dv++) {
471 MEM_SAFE_DELETE((*dv)->dw);
475 (*dv)->dw = MEM_dupalloc((*dv)->dw);
479 MEM_delete(dvert_array);
480 MEM_delete(dvert_array_from);
488 float *dvert_weights,
491 for (
int i = 0; i < dvert_tot; i++) {
499 const float *dvert_weights,
501 const bool remove_zero)
505 for (i = 0; i < dvert_tot; i++) {
508 if (dvert_weights[i] > 0.0f) {
511 dw->
weight = dvert_weights[i];
539 MEM_delete(flip_map);
552 Object *ob,
BMVert *eve,
int def_nr,
int vidx,
const int cd_dvert_offset)
561 if (eve_mirr && eve_mirr != eve) {
583 if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
631 int subset_count, vgroup_tot;
632 const bool *vgroup_validmap;
641 if (dvert_act ==
nullptr) {
646 ob, subset_type, &vgroup_tot, &subset_count);
652 *dvert_act,
Span(vgroup_validmap, vgroup_tot),
Span(lock_flags, vgroup_tot));
653 MEM_delete(lock_flags);
659 MEM_delete(vgroup_validmap);
678 int i, vgroup_tot, subset_count;
680 ob, subset_type, &vgroup_tot, &subset_count);
711 for (i = 0; i <
mesh->verts_num; i++) {
712 if (select_vert[i] && &dverts[i] != dvert_act) {
722 MEM_delete(vgroup_validmap);
736 N_(
"Selected Pose Bones"),
737 N_(
"All Vertex Groups assigned to Selection")},
741 N_(
"Deform Pose Bones"),
742 N_(
"All Vertex Groups assigned to Deform Bones")},
744 {0,
nullptr, 0,
nullptr,
nullptr},
751 const uint selection_mask)
819 "Define which subset of groups shall be used");
844 Object *ob,
const int def_nr,
const int vertnum,
const float weight,
const int assignmode)
853 if (dvert ==
nullptr) {
858 if ((vertnum < 0) || (vertnum >= tot)) {
869 switch (assignmode) {
889 switch (assignmode) {
975 if (cd_dvert_offset != -1 && vertnum < bm->totvert) {
988 if (vertnum >=
mesh->verts_num) {
991 dv = &dverts[vertnum];
1002 dv = <->
dvert[vertnum];
1047 using namespace bke;
1054 for (MutableDrawingInfo &info : drawings) {
1056 ListBaseT<bDeformGroup> &vertex_group_names =
curves.vertex_group_names;
1071 switch (selection_domain) {
1072 case AttrDomain::Point:
1074 for (const int point_i : range) {
1075 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1076 selection.span.typed<bool>()[point_i] = select;
1081 case AttrDomain::Curve: {
1084 for (const int curve_i : range) {
1085 const IndexRange points = points_by_curve[curve_i];
1086 bool any_point_in_group = false;
1087 for (const int point_i : points) {
1088 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1089 any_point_in_group = true;
1093 if (any_point_in_group) {
1094 selection.span.typed<bool>()[curve_i] = select;
1130 if (cd_dvert_offset != -1) {
1161 for (
const int i : select_vert.span.index_range()) {
1162 if (!hide_vert[i]) {
1164 select_vert.span[i] =
select;
1185 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
1192 if (actbp && bp == actbp) {
1208 char name[
sizeof(dg->
name)];
1211 int i, idg, icdg, dvert_tot = 0;
1221 if (!strstr(dg->
name,
"_copy")) {
1242 for (i = 0; i < dvert_tot; i++) {
1247 const float weight = dw_org->weight;
1249 dw_cpy->weight = weight;
1253 MEM_delete(dvert_array);
1274 float weight_max = 0.0f;
1276 for (
int i = 0; i < dvert_tot; i++) {
1279 if (!(dv = dvert_array[i])) {
1289 if (weight_max > 0.0f) {
1290 for (
int i = 0; i < dvert_tot; i++) {
1293 if (!(dv = dvert_array[i])) {
1299 dw->
weight /= weight_max;
1307 MEM_delete(dvert_array);
1316 const bool *vgroup_validmap,
1317 const int vgroup_tot,
1335 for (
int i = 0; i < dvert_tot; i++) {
1337 if (!(dv = dvert_array[i])) {
1343 if (vgroup_validmap[j]) {
1354 if (use_mirror && use_vert_sel) {
1358 MEM_delete(dvert_array);
1381 const bool *vgroup_validmap,
1382 const int vgroup_tot,
1383 const bool lock_active,
1384 const bool soft_lock_active,
1386 std::optional<int> current_frame = {})
1391 const bool use_vert_sel = vertex_group_use_vert_sel(ob);
1396 vgroup_parray_alloc(ob->
data, &dvert_array, &dvert_tot, use_vert_sel, current_frame);
1405 bool *lock_flags_array = BKE_object_defgroup_lock_flags_get(ob, vgroup_tot);
1406 if (lock_flags_array) {
1407 lock_flags = MutableSpan(lock_flags_array, vgroup_tot);
1409 else if (lock_active) {
1411 std::memset(lock_flags_array, 0, vgroup_tot);
1412 lock_flags = MutableSpan(lock_flags_array, vgroup_tot);
1415 lock_flags[def_nr] =
true;
1418 Vector<bool> soft_lock_flags;
1419 if (soft_lock_active && !lock_active) {
1420 soft_lock_flags =
Vector(vgroup_tot,
false);
1421 soft_lock_flags[def_nr] =
true;
1424 const bool all_locked = !lock_flags.
is_empty() && !lock_flags.
contains(
false);
1426 BKE_report(reports, RPT_ERROR,
"All groups are locked");
1430 for (
int i = 0; i < dvert_tot; i++) {
1431 MDeformVert *dv = dvert_array[i];
1439 MEM_delete(dvert_array);
1440 MEM_SAFE_DELETE(lock_flags_array);
1455 const bool soft_lock_active,
1457 std::optional<int> current_frame = {})
1464 if (defgroup_validmap[def_nr] ==
true) {
1465 int subset_count, vgroup_tot;
1469 vgroup_normalize_all(
1470 ob, vgroup_validmap, vgroup_tot,
false, soft_lock_active, reports, current_frame);
1471 MEM_SAFE_DELETE(vgroup_validmap);
1474 MEM_SAFE_DELETE(defgroup_validmap);
1489 "Unlock all vertex groups if there is at least one locked group, lock all in other case"},
1490 {
VGROUP_LOCK,
"LOCK", 0,
"Lock",
"Lock all vertex groups"},
1491 {
VGROUP_UNLOCK,
"UNLOCK", 0,
"Unlock",
"Unlock all vertex groups"},
1492 {
VGROUP_INVERT,
"INVERT", 0,
"Invert",
"Invert the lock state of all vertex groups"},
1493 {0,
nullptr, 0,
nullptr,
nullptr},
1504 {
VGROUP_MASK_ALL,
"ALL", 0,
"All",
"Apply action to all vertex groups"},
1508 "INVERT_UNSELECTED",
1510 "Invert Unselected",
1511 "Apply the opposite of Lock/Unlock to unselected vertex groups"},
1512 {0,
nullptr, 0,
nullptr,
nullptr},
1535 if (sel_count == 0 && actdef >= 1 && actdef <= defbase_tot) {
1536 mask[actdef - 1] =
true;
1545 bool *selected =
nullptr;
1556 for (dg = defbase->first(), i = 0; dg; dg = dg->
next, i++) {
1580 for (dg = defbase->first(), i = 0; dg; dg = dg->
next, i++) {
1614 MEM_delete(selected);
1619 const bool *vgroup_validmap,
1620 const int vgroup_tot,
1622 const bool auto_assign,
1623 const bool auto_remove)
1636 for (
int i = 0; i < dvert_tot; i++) {
1638 if (!(dv = dvert_array[i])) {
1645 if (vgroup_validmap[j]) {
1661 if (use_mirror && use_vert_sel) {
1669 MEM_delete(dvert_array);
1674 const bool *vgroup_validmap,
1675 const int vgroup_tot,
1676 const int subset_count,
1679 const float fac_expand)
1682 BLI_assert(vgroup_tot > 0 && subset_count > 0);
1684 const float ifac = 1.0f - fac;
1693 const bool use_hide = use_select;
1695 const int expand_sign =
signum_i(fac_expand);
1697 const float iexpand = 1.0f -
expand;
1702 float *weight_accum_prev;
1703 float *weight_accum_curr;
1713 vgroup_subset_weights.
fill(0.0f);
1724 mesh->edges(),
mesh->verts_num, vert_to_edge_offsets, vert_to_edge_indices);
1733#define IS_BM_VERT_READ(v) (use_hide ? (BM_elem_flag_test(v, BM_ELEM_HIDDEN) == 0) : true)
1734#define IS_BM_VERT_WRITE(v) (use_select ? (BM_elem_flag_test(v, BM_ELEM_SELECT) != 0) : true)
1737 if (
mesh && use_hide) {
1738 hide_vert = *
mesh->attributes().lookup_or_default<
bool>(
1746 if (
mesh && use_select) {
1747 select_vert = *
mesh->attributes().lookup_or_default<
bool>(
1756 for (
int i = 0; i < dvert_tot; i++) {
1773 for (
int i = 0; i < dvert_tot; i++) {
1774 if (select_vert[i]) {
1775 for (
int j = 0; j < emap[i].
size(); j++) {
1776 const int2 &edge = edges[emap[i][j]];
1777 const int i_other = (edge[0] == i) ? edge[1] : edge[0];
1778 if (!hide_vert[i_other]) {
1787 for (subset_index = 0; subset_index < subset_count; subset_index++) {
1788 const int def_nr = vgroup_subset_map[subset_index];
1792 (
const MDeformVert **)dvert_array, dvert_tot, weight_accum_prev, def_nr);
1793 memcpy(weight_accum_curr, weight_accum_prev,
sizeof(*weight_accum_curr) * dvert_tot);
1795 for (iter = 0; iter < repeat; iter++) {
1800 for (vi_step = verts_used; vi_step != vi_end; vi_step++) {
1801 const uint i = *vi_step;
1802 float weight_tot = 0.0f;
1803 float weight = 0.0f;
1805#define WEIGHT_ACCUMULATE \
1807 float weight_other = weight_accum_prev[i_other]; \
1808 float tot_factor = 1.0f; \
1809 if (expand_sign == 1) { \
1810 if (weight_other < weight_accum_prev[i]) { \
1811 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1812 tot_factor = iexpand; \
1815 else if (expand_sign == -1) { \
1816 if (weight_other > weight_accum_prev[i]) { \
1817 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1818 tot_factor = iexpand; \
1821 weight += tot_factor * weight_other; \
1822 weight_tot += tot_factor; \
1850 for (j = 0; j < emap[i].
size(); j++) {
1851 const int2 &edge = edges[emap[i][j]];
1852 const int i_other = (edge[0] == i ? edge[1] : edge[0]);
1853 if (!hide_vert[i_other]) {
1859#undef WEIGHT_ACCUMULATE
1861 if (weight_tot != 0.0f) {
1862 weight /= weight_tot;
1863 weight = (weight_accum_prev[i] * ifac) + (weight * fac);
1866 CLAMP(weight, 0.0f, 1.0f);
1867 weight_accum_curr[i] = weight;
1871 std::swap(weight_accum_curr, weight_accum_prev);
1877#undef IS_BM_VERT_READ
1878#undef IS_BM_VERT_WRITE
1880 MEM_delete(weight_accum_curr);
1881 MEM_delete(weight_accum_prev);
1882 MEM_delete(verts_used);
1885 MEM_delete(dvert_array);
1893 MEM_delete(dvert_array);
1931 const bool *vgroup_validmap,
1932 const int vgroup_tot,
1933 const int subset_count,
1934 const int max_weights)
1937 int i, dvert_tot = 0;
1944 int num_to_drop = 0;
1946 for (i = 0; i < dvert_tot; i++) {
1949 int bone_count = 0, non_bone_count = 0;
1953 if (!(dv = dvert_array[i])) {
1957 num_to_drop = subset_count - max_weights;
1960 if (num_to_drop > 0) {
1968 dw_temp[dv->
totweight - 1 - bone_count] = dv->
dw[j];
1972 dw_temp[non_bone_count] = dv->
dw[j];
1973 non_bone_count += 1;
1977 num_to_drop = bone_count - max_weights;
1978 if (num_to_drop > 0) {
1979 qsort(&dw_temp[non_bone_count],
1988 remove_tot += num_to_drop;
1991 MEM_delete(dw_temp);
1995 MEM_delete(dvert_array);
2002 const bool *vgroup_validmap,
2003 const int vgroup_tot,
2005 const float epsilon,
2006 const bool keep_single)
2018 if (use_mirror && use_vert_sel) {
2026 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot, epsilon, keep_single);
2028 MEM_delete(dvert_array);
2033 const bool *vgroup_validmap,
2034 const int vgroup_tot,
2047 const float steps_fl = steps;
2050 if (use_mirror && use_vert_sel) {
2054 for (
int i = 0; i < dvert_tot; i++) {
2058 if (!(dv = dvert_array[i])) {
2063 for (j = 0, dw = dv->
dw; j < dv->totweight; j++, dw++) {
2064 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
2071 MEM_delete(dvert_array);
2078 const char sel_mirr,
2079 const int *flip_map,
2080 const int flip_map_len,
2081 const bool mirror_weights,
2082 const bool flip_vgroups,
2083 const bool all_vgroups,
2084 const int act_vgroup)
2088 if (sel_mirr && sel) {
2090 if (mirror_weights) {
2092 std::swap(*dvert, *dvert_mirr);
2098 if (dw && dw_mirr) {
2122 std::swap(dvert, dvert_mirr);
2125 if (mirror_weights) {
2142 const bool mirror_weights,
2143 const bool flip_vgroups,
2144 const bool all_vgroups,
2145 const bool use_topology,
2152 int totmirr = 0, totfail = 0;
2154 *r_totmirr = *r_totfail = 0;
2158 if ((mirror_weights ==
false && flip_vgroups ==
false) ||
2164 int *flip_map =
nullptr;
2172 if (flip_map ==
nullptr) {
2191 if (cd_dvert_offset == -1) {
2204 if (eve_mirr != eve) {
2209 if ((sel || sel_mirr) && (eve != eve_mirr)) {
2241 if (
mesh->deform_verts().is_empty()) {
2251 for (
int vidx = 0; vidx <
mesh->verts_num; vidx++) {
2255 if (vidx != vidx_mirr) {
2257 const bool sel = use_sel ? select_vert[vidx] :
true;
2258 const bool sel_mirr = use_sel ? select_vert[vidx_mirr] :
true;
2260 if (sel || sel_mirr) {
2285 MEM_delete(vert_tag);
2292 if (lt->
pntsu == 1 || lt->
dvert ==
nullptr) {
2299 int pntsu_half = lt->
pntsu / 2;
2301 for (
int w = 0;
w < lt->
pntsw;
w++) {
2302 for (
int v = 0;
v < lt->
pntsv;
v++) {
2303 for (
int u = 0; u < pntsu_half; u++) {
2304 int u_inv = (lt->
pntsu - 1) - u;
2313 const bool sel_mirr = bp_mirr->
f1 &
SELECT;
2315 if (sel || sel_mirr) {
2337 if (flip_vgroups && flip_map[def_nr] >= 0) {
2338 ob->
actdef = flip_map[def_nr] + 1;
2343 *r_totmirr = totmirr;
2344 *r_totfail = totfail;
2347 MEM_delete(flip_map);
2350#undef VGROUP_MIRR_OP
2374 int cd_dvert_offset;
2406 for (
int i = 0; i <
mesh->verts_num; i++) {
2407 if (select_vert[i]) {
2423 if (lt->
dvert ==
nullptr) {
2430 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
2449 for (MutableDrawingInfo info : drawings) {
2497 if (defbase->is_empty()) {
2524 const bool needs_select,
2525 const short ob_type_flag)
2533 if (ob_type_flag && ((1 << ob->
type) & ob_type_flag) == 0) {
2554static bool vertex_group_vert_poll(
bContext *
C)
2556 return vertex_group_vert_poll_ex(
C,
false, 0);
2571static bool vertex_group_mesh_vert_select_poll(
bContext *
C)
2573 return vertex_group_vert_poll_ex(
C,
true, (1 <<
OB_MESH));
2640 ot->
name =
"Add Vertex Group";
2641 ot->
idname =
"OBJECT_OT_vertex_group_add";
2642 ot->
description =
"Add a new vertex group to the active object";
2661 const bool use_selection,
2662 const bool all_drawings =
false)
2681 for (
const MutableDrawingInfo &info : drawings) {
2689 const bool use_selection,
2690 const bool all_drawings =
false,
2691 const bool only_unlocked =
false)
2713 if (all_vgroup || only_unlocked) {
2728 if (all_vgroup || only_unlocked) {
2747 ot->
name =
"Remove Vertex Group";
2748 ot->
idname =
"OBJECT_OT_vertex_group_remove";
2749 ot->
description =
"Delete the active or all vertex groups from the active object";
2765 ot->
srna,
"all_unlocked",
false,
"All Unlocked",
"Remove all unlocked vertex groups");
2792 const int current_frame = scene.
r.
cfra;
2794 ob, def_nr,
true, op->
reports, current_frame);
2810 ot->
name =
"Assign to Vertex Group";
2811 ot->
idname =
"OBJECT_OT_vertex_group_assign";
2812 ot->
description =
"Assign the selected vertices to the active vertex group";
2845 ot->
name =
"Assign to New Group";
2846 ot->
idname =
"OBJECT_OT_vertex_group_assign_new";
2847 ot->
description =
"Assign the selected vertices to a new vertex group";
2874 if (use_all_groups) {
2886 if (dg ==
nullptr) {
2903 const int current_frame = scene.
r.
cfra;
2905 ob, def_nr,
true, op->
reports, current_frame);
2923 ot->
name =
"Remove from Vertex Group";
2924 ot->
idname =
"OBJECT_OT_vertex_group_remove_from";
2925 ot->
description =
"Remove the selected vertices from active or all vertex group(s)";
2939 ot->
srna,
"use_all_groups",
false,
"All Groups",
"Remove from all groups");
2942 ot->
srna,
"use_all_verts",
false,
"All Vertices",
"Clear the active group");
2972 ot->
name =
"Select Vertex Group";
2973 ot->
idname =
"OBJECT_OT_vertex_group_select";
2974 ot->
description =
"Select all the vertices assigned to the active vertex group";
3006 ot->
name =
"Deselect Vertex Group";
3007 ot->
idname =
"OBJECT_OT_vertex_group_deselect";
3008 ot->
description =
"Deselect all selected vertices assigned to the active vertex group";
3040 ot->
name =
"Duplicate Vertex Group";
3041 ot->
idname =
"OBJECT_OT_vertex_group_copy";
3042 ot->
description =
"Make a copy of the active vertex group";
3067 int subset_count, vgroup_tot;
3070 ob, subset_type, &vgroup_tot, &subset_count);
3072 MEM_delete(vgroup_validmap);
3084 ot->
name =
"Vertex Group Levels";
3085 ot->
idname =
"OBJECT_OT_vertex_group_levels";
3087 "Add some offset and multiply with some gain the weights of the active vertex group";
3098 ot->
srna,
"offset", 0.0f, -1.0, 1.0,
"Offset",
"Value to add to weights", -1.0f, 1.0f);
3100 ot->
srna,
"gain", 1.0f, 0.0f,
FLT_MAX,
"Gain",
"Value to multiply weights by", 0.0f, 10.0f);
3129 ot->
name =
"Normalize Vertex Group";
3130 ot->
idname =
"OBJECT_OT_vertex_group_normalize";
3132 "Normalize weights of the active vertex group, so that the highest ones are now 1.0";
3163 for (
int i = 0; i < defgroup_tot; i++) {
3164 if (defgroup_validmap[i] ==
true) {
3169 MEM_delete(defgroup_validmap);
3172 return target_group;
3187 int subset_count, vgroup_tot;
3189 ob, subset_type, &vgroup_tot, &subset_count);
3191 if (subset_count == 0) {
3199 ob, vgroup_validmap, vgroup_tot, lock_active,
false, op->
reports, current_frame);
3203 ob, vgroup_validmap, vgroup_tot, lock_active,
false, op->
reports);
3207 MEM_delete(vgroup_validmap);
3224 ot->
name =
"Normalize All Vertex Groups";
3225 ot->
idname =
"OBJECT_OT_vertex_group_normalize_all";
3227 "Normalize all weights of all vertex groups, "
3228 "so that for each vertex, the sum of all weights is 1.0";
3242 "Keep the values of the active group while normalizing others");
3278 return TIP_(
"Lock all vertex groups of the active object");
3280 return TIP_(
"Lock selected vertex groups of the active object");
3282 return TIP_(
"Lock unselected vertex groups of the active object");
3284 return TIP_(
"Lock selected and unlock unselected vertex groups of the active object");
3290 return TIP_(
"Unlock all vertex groups of the active object");
3292 return TIP_(
"Unlock selected vertex groups of the active object");
3294 return TIP_(
"Unlock unselected vertex groups of the active object");
3296 return TIP_(
"Unlock selected and lock unselected vertex groups of the active object");
3302 return TIP_(
"Toggle locks of all vertex groups of the active object");
3304 return TIP_(
"Toggle locks of selected vertex groups of the active object");
3306 return TIP_(
"Toggle locks of unselected vertex groups of the active object");
3309 "Toggle locks of all and invert unselected vertex groups of the active object");
3315 return TIP_(
"Invert locks of all vertex groups of the active object");
3318 return TIP_(
"Invert locks of selected vertex groups of the active object");
3320 return TIP_(
"Invert locks of unselected vertex groups of the active object");
3332 ot->
name =
"Change the Lock On Vertex Groups";
3333 ot->
idname =
"OBJECT_OT_vertex_group_lock";
3334 ot->
description =
"Change the lock state of all or some vertex groups of active object";
3349 "Lock action to execute on vertex groups");
3356 "Apply the action based on vertex group selection");
3374 int subset_count, vgroup_tot;
3377 ob, subset_type, &vgroup_tot, &subset_count);
3379 MEM_delete(vgroup_validmap);
3391 ot->
name =
"Invert Vertex Group";
3392 ot->
idname =
"OBJECT_OT_vertex_group_invert";
3393 ot->
description =
"Invert active vertex group's weights";
3407 "Add vertices from groups that have zero weight before inverting");
3412 "Remove vertices from groups that have zero weight after inverting");
3429 bool has_vgroup_multi =
false;
3431 for (
Object *ob : objects) {
3432 int subset_count, vgroup_tot;
3435 ob, subset_type, &vgroup_tot, &subset_count);
3439 if (locked_vgroups) {
3441 for (
int i = 0; i < vgroup_tot; i++) {
3442 if (vgroup_validmap[i] && locked_vgroups[i]) {
3443 vgroup_validmap[i] =
false;
3448 MEM_SAFE_DELETE(locked_vgroups);
3450 has_vgroup_multi =
true;
3454 ob, vgroup_validmap, vgroup_tot, subset_count, fac, repeat, fac_expand);
3462 MEM_delete(vgroup_validmap);
3471 if (!has_vgroup_multi) {
3481 ot->
name =
"Smooth Vertex Weights";
3482 ot->
idname =
"OBJECT_OT_vertex_group_smooth";
3483 ot->
description =
"Smooth weights for selected vertices";
3494 RNA_def_int(ot->
srna,
"repeat", 1, 1, 10000,
"Iterations",
"", 1, 200);
3502 "Expand/contract weights",
3521 for (
Object *ob : objects) {
3522 int subset_count, vgroup_tot;
3525 ob, subset_type, &vgroup_tot, &subset_count);
3528 MEM_delete(vgroup_validmap);
3541 ot->
name =
"Clean Vertex Group Weights";
3542 ot->
idname =
"OBJECT_OT_vertex_group_clean";
3543 ot->
description =
"Remove vertex group assignments which are not required";
3559 "Remove vertices which weight is below or equal to this limit",
3566 "Keep verts assigned to at least one group when cleaning");
3583 int subset_count, vgroup_tot;
3586 ob, subset_type, &vgroup_tot, &subset_count);
3588 MEM_delete(vgroup_validmap);
3600 ot->
name =
"Quantize Vertex Weights";
3601 ot->
idname =
"OBJECT_OT_vertex_group_quantize";
3602 ot->
description =
"Set weights to a fixed number of steps";
3612 RNA_def_int(ot->
srna,
"steps", 4, 1, 1000,
"Steps",
"Number of steps between 0 and 1", 1, 100);
3626 int remove_multi_count = 0;
3629 for (
Object *ob : objects) {
3631 int subset_count, vgroup_tot;
3633 ob, subset_type, &vgroup_tot, &subset_count);
3635 ob, vgroup_validmap, vgroup_tot, subset_count, limit);
3636 MEM_delete(vgroup_validmap);
3638 if (remove_count != 0) {
3643 remove_multi_count += remove_count;
3646 if (remove_multi_count) {
3649 "%d vertex weights limited",
3650 remove_multi_count);
3663 ot->
name =
"Limit Number of Weights per Vertex";
3664 ot->
idname =
"OBJECT_OT_vertex_group_limit_total";
3666 "Limit deform weights associated with a vertex to a specified number by removing lowest "
3677 RNA_def_int(ot->
srna,
"limit", 4, 1, 32,
"Limit",
"Maximum number of deform weights", 1, 32);
3689 int totmirr = 0, totfail = 0;
3712 ot->
name =
"Mirror Vertex Group";
3713 ot->
idname =
"OBJECT_OT_vertex_group_mirror";
3715 "Mirror vertex group, flip weights and/or names, editing only selected vertices, "
3716 "flipping when both sides are selected otherwise copy from unselected";
3728 ot->
srna,
"flip_group_names",
true,
"Flip Group Names",
"Flip vertex group names");
3729 RNA_def_boolean(ot->
srna,
"all_groups",
false,
"All Groups",
"Mirror all vertex groups weights");
3735 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
3747 int changed_tot = 0;
3765 if ((changed_tot == 0 && fail == 0) || fail) {
3768 "Copy vertex groups to selected: %d done, %d failed (object data must support "
3769 "vertex groups and have matching indices)",
3780 ot->
name =
"Copy Vertex Group to Selected";
3781 ot->
idname =
"OBJECT_OT_vertex_group_copy_to_selected";
3782 ot->
description =
"Replace vertex groups of selected objects by vertex groups of active object";
3832 for (a = 0, def = defbase->first(); def; def = def->
next, a++) {
3834 tmp.
icon = ICON_GROUP_VERTEX;
3851 ot->
name =
"Set Active Vertex Group";
3852 ot->
idname =
"OBJECT_OT_vertex_group_set_active";
3882 int defbase_tot = defbase->count();
3901 int defbase_tot = defbase->count();
3905 int *sort_map = sort_map_update + 1;
3911 for (def = defbase->first(), i = 0; def; def = def->
next, i++) {
3928 if (cd_dvert_offset != -1) {
3942 MEM_delete(sort_map_update);
3952 while (dvert_tot--) {
3962 for (i = 0; i < defbase_tot; i++) {
3966 sort_map_update[0] = 0;
3973 MEM_delete(sort_map_update);
3992 if (bonebase ==
nullptr) {
3994 if (armobj !=
nullptr) {
4001 if (bonebase !=
nullptr) {
4002 for (
Bone &bone : bonebase->items_reversed()) {
4006 if (dg !=
nullptr) {
4032 switch (sort_type) {
4050 MEM_delete(name_array);
4061 {0,
nullptr, 0,
nullptr,
nullptr},
4064 ot->
name =
"Sort Vertex Groups";
4065 ot->
idname =
"OBJECT_OT_vertex_group_sort";
4112 MEM_delete(name_array);
4121 {-1,
"UP", 0,
"Up",
""},
4122 {1,
"DOWN", 0,
"Down",
""},
4123 {0,
nullptr, 0,
nullptr,
nullptr},
4127 ot->
name =
"Move Vertex Group";
4128 ot->
idname =
"OBJECT_OT_vertex_group_move";
4129 ot->
description =
"Move the active vertex group up/down in the list";
4143 "Direction to move the active vertex group towards");
4165 if (dvert_act ==
nullptr) {
4190 if (dvert_act ==
nullptr) {
4199 for (i = 0; i <
mesh->verts_num; i++) {
4200 if (select_vert[i] && (&dverts[i] != dvert_act)) {
4254 ot->
name =
"Paste Weight to Selected";
4255 ot->
idname =
"OBJECT_OT_vertex_weight_paste";
4257 "Copy this group's weight to other selected vertices (disabled if vertex group is locked)";
4272 "Index of source weight in active vertex group",
4305 ot->
name =
"Delete Weight";
4306 ot->
idname =
"OBJECT_OT_vertex_weight_delete";
4307 ot->
description =
"Delete this weight from the vertex (disabled if vertex group is locked)";
4322 "Index of source weight in active vertex group",
4339 if (wg_index != -1) {
4352 ot->
name =
"Set Active Group";
4353 ot->
idname =
"OBJECT_OT_vertex_weight_set_active";
4369 "Index of source weight in active vertex group",
4403 ot->
name =
"Normalize Active";
4404 ot->
idname =
"OBJECT_OT_vertex_weight_normalize_active_vertex";
4405 ot->
description =
"Normalize active vertex's weights";
4438 ot->
name =
"Copy Active";
4439 ot->
idname =
"OBJECT_OT_vertex_weight_copy";
4440 ot->
description =
"Copy weights from active to selected";
#define CTX_DATA_BEGIN(C, Type, instance, member)
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
Utility functions for vertex groups in grease pencil objects.
General operations, lookup, etc. for blender objects.
#define BLI_BITMAP_NEW(_num, _alloc_string)
#define BLI_BITMAP_TEST(_bitmap, _index)
#define BLI_BITMAP_ENABLE(_bitmap, _index)
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
#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
Read Blender memory allocation and freeing.
#define UNUSED_FUNCTION(x)
#define BLI_assert_unreachable()
#define IN_RANGE_INCL(a, b, c)
#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)
#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)
#define MEM_realloc_uninitialized(vmemh, len)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void fill(const T &value) const
constexpr bool contains(const T &value) const
constexpr bool is_empty() const
constexpr bool is_empty() const
static VArray from_single(T value, const int64_t size)
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
bke::CurvesGeometry & strokes_for_write()
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str)
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 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 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 void vgroup_assign_verts(Object *ob, Scene &scene, const int def_nr, const float weight)
static char * vgroup_init_remap(Object *ob)
static wmOperatorStatus vertex_group_select_exec(bContext *C, wmOperator *)
void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot)
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 vgroup_normalize_all_deform_if_active_is_deform(Object *ob, const int def_nr, const bool soft_lock_active, ReportList *reports, std::optional< int > current_frame={})
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 void vgroup_sort_bone_hierarchy(Object *ob, ListBaseT< Bone > *bonebase)
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)
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)
@ SORT_TYPE_BONEHIERARCHY
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 wmOperatorStatus vertex_group_normalize_exec(bContext *C, wmOperator *)
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)
@ VGROUP_MASK_INVERT_UNSELECTED
static bool * vgroup_selected_get(Object *ob)
void OBJECT_OT_vertex_group_normalize_all(wmOperatorType *ot)
BLI_INLINE Texture * wrap(MTLTexture *texture)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
struct MDeformVert * BKE_object_defgroup_data_create(struct ID *id)
void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc)
void BKE_object_defgroup_unique_name(bDeformGroup *dg, Object *ob)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
bool BKE_object_is_in_editmode_vgroup(const Object *ob)
void BKE_object_defgroup_remap_update_users(struct Object *ob, const int *map)
int RNA_enum_get(PointerRNA *ptr, const char *name)
ListBaseT< bDeformGroup > * BKE_object_defgroup_list_mutable(Object *ob)
int char char int int int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
const ListBaseT< bDeformGroup > * BKE_object_defgroup_list(const Object *ob)
MDeformVert * ED_mesh_active_dvert_get_em(Object *ob, BMVert **r_eve)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BKE_object_defgroup_count(const Object *ob)
bool BKE_object_defgroup_array_get(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot)
bool ED_operator_object_active_local_editable_ex(bContext *C, const Object *ob)
void BKE_object_defgroup_mirror_selection(struct Object *ob, int defbase_tot, const bool *selection, bool *dg_flags_sel, int *r_dg_flags_sel_tot)
void BKE_defvert_remap(MDeformVert *dvert, const int *map, int map_len)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
bDeformGroup * BKE_object_defgroup_find_name(const Object *ob, StringRef name)
BMVert * EDBM_verts_mirror_get(BMEditMesh *em, BMesh *bm, BMVert *v)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
bool BKE_object_defgroup_clear_all(struct Object *ob, bool use_selection)
bool * BKE_object_defgroup_validmap_get(struct Object *ob, int defbase_tot)
Object * BKE_modifiers_is_deformed_by_armature(Object *ob)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
MDeformVert * ED_mesh_active_dvert_get_ob(Object *ob, int *r_index)
int mesh_get_x_mirror_vert(Object *ob, Mesh *mesh_eval, int index, bool use_topology)
int RNA_int_get(PointerRNA *ptr, const char *name)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BKE_object_defgroup_active_index_set(Object *ob, int new_index)
int ED_mesh_mirror_get_vert(Object *ob, int index)
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, BMesh *bm, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
int * BKE_object_defgroup_flip_map(const Object *ob, bool use_default, int *r_flip_map_num)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BKE_defgroup_name_index(const ListBaseT< bDeformGroup > *defbase, StringRef name)
void BKE_object_defgroup_remove_all(struct Object *ob)
bool * BKE_object_defgroup_selected_get(struct Object *ob, int defbase_tot, int *r_dg_flags_sel_tot)
float BKE_defvert_find_weight(const MDeformVert *dvert, int defgroup)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BKE_object_supports_vertex_groups(const Object *ob)
void BKE_defvert_copy_subset(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool *vgroup_subset, int vgroup_num)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
VecBase< int32_t, 2 > int2
int * BKE_object_defgroup_flip_map_single(const Object *ob, bool use_default, int defgroup, int *r_flip_map_num)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BKE_defvert_normalize_ex(MDeformVert &dvert, Span< bool > subset_flags, Span< bool > lock_flags, Span< bool > soft_lock_flags)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
MINLINE int signum_i(float a)
BMesh const char void * data
Mesh * BKE_mesh_from_object(Object *ob)
Object * BKE_object_pose_armature_get(Object *ob)
int BKE_lattice_index_from_uvw(const Lattice *lt, int u, int v, int w)
bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings)
void BKE_defvert_copy_index(MDeformVert *dvert_dst, int defgroup_dst, const MDeformVert *dvert_src, int defgroup_src)
bDeformGroup * BKE_defgroup_duplicate(const bDeformGroup *ingroup)
void BKE_defvert_sync_mapped(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const int *flip_map, int flip_map_num, bool use_ensure)
void BKE_defvert_mirror_subset(MDeformVert *dvert_dst, const MDeformVert *dvert_src, const bool *vgroup_subset, int vgroup_num, const int *flip_map, int flip_map_num)
MDeformWeight * BKE_defvert_ensure_index(MDeformVert *dv, int defgroup)
int BKE_object_defgroup_name_index(const Object *ob, StringRef name)
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
int BKE_object_defgroup_flip_index(const Object *ob, int index, bool use_default)
bool BKE_object_defgroup_clear(struct Object *ob, struct bDeformGroup *dg, bool use_selection)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
ToolSettings * CTX_data_tool_settings(const bContext *C)
void BKE_object_defgroup_subset_to_index_array(const bool *defgroup_validmap, int defgroup_tot, int *r_defgroup_subset_map)
BPoint * BKE_lattice_active_point_get(Lattice *lt)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
void paintvert_flush_flags(Object *ob)
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void void BLI_listbase_sort(ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BKE_defvert_normalize_subset(MDeformVert &dvert, Span< bool > subset_flags)
void BKE_defvert_flip(MDeformVert *dvert, const int *flip_map, int flip_map_num)
bool * BKE_object_defgroup_lock_flags_get(struct Object *ob, int defbase_tot)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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)
void EDBM_verts_mirror_cache_end(BMEditMesh *em)
void ED_mesh_report_mirror(ReportList &reports, int totmirr, int totfail)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
struct bDeformGroup * BKE_object_defgroup_add(struct Object *ob)
MINLINE float max_ff(float a, float b)
void BKE_defvert_add_index_notest(MDeformVert *dv, int defgroup, float weight)
void BKE_defvert_copy(MDeformVert *dvert_dst, const MDeformVert *dvert_src)
ID_Type GS(const char *name)
bool BKE_object_is_in_wpaint_select_vert(const Object *ob)
void BKE_object_defgroup_remove_all_ex(struct Object *ob, bool only_unlocked)
BMVert * editbmesh_get_x_mirror_vert(Object *ob, BMesh *bm, BMVert *eve, const float co[3], int index, bool use_topology)
bool EDBM_uvselect_clear(BMesh *bm)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
MDeformVert * ED_mesh_active_dvert_get_only(Object *ob)
bool * BKE_object_defgroup_subset_from_select_type(struct Object *ob, enum eVGroupSelect subset_type, int *r_defgroup_tot, int *r_subset_count)
void BKE_object_defgroup_remove(struct Object *ob, struct bDeformGroup *defgroup)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void BKE_defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
void EDBM_select_flush_from_verts(BMesh *bm, short selectmode, bool select)
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)
float RNA_float_get(PointerRNA *ptr, const char *name)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
MDeformWeight * BKE_defvert_find_index(const MDeformVert *dv, int defgroup)
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
int * BKE_object_defgroup_flip_map_unlocked(const Object *ob, bool use_default, int *r_flip_map_num)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_defvert_normalize_lock_map(MDeformVert &dvert, Span< bool > subset_flags, Span< bool > lock_flags)
int BKE_object_defgroup_active_index_get(const Object *ob)
#define IS_BM_VERT_READ(v)
#define IS_BM_VERT_WRITE(v)
#define WEIGHT_ACCUMULATE
struct EditLatt * editlatt
struct MDeformVert * dvert
DNA_DEPRECATED unsigned short actdef
struct ToolSettings * toolsettings
ListBaseT< Bone > bonebase
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct ReportList * reports