140 for (
int i = 0;
i < dvert_tot;
i++) {
142 for (
int j = 0; j < dv->
totweight; j++) {
155 const bool use_vert_sel,
156 std::optional<int> current_frame)
159 *dvert_arr =
nullptr;
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];
237 for (
int i = 0;
i < *dvert_tot;
i++) {
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)
314 for (
int i_src = 0; i_src < dvert_tot; i_src++) {
315 if (dvert_array[i_src] !=
nullptr) {
318 if (i_dst != -1 && dvert_array_all[i_dst] !=
nullptr) {
324 dv_dst, dv_src, vgroup_validmap, vgroup_tot, flip_map, flip_map_len);
326 dvert_array[i_dst] = dvert_array_all[i_dst];
353 for (
int i = 0;
i < dvert_tot;
i++) {
354 if (dvert_array[
i] ==
nullptr) {
357 if ((i_sel != -1) && (i_sel !=
i) && (dvert_array[i_sel])) {
359 dvert_array[
i] = dvert_array_all[
i];
369 const bool *vgroup_validmap,
370 const int vgroup_tot,
372 const bool keep_single)
376 for (
int i = 0;
i < dvert_tot;
i++) {
378 if (!(dv = dvert_array[
i])) {
392 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
393 if (dw->
weight <= epsilon) {
413 bool new_vgroup =
false;
425 static_cast<ID *
>(ob_from->
data), &dvert_array_from, &dvert_tot_from,
false);
428 if ((dvert_array ==
nullptr) && (dvert_array_from !=
nullptr) &&
435 if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from ==
nullptr ||
436 dvert_array ==
nullptr)
441 if (dvert_array_from) {
445 if (new_vgroup ==
true) {
451 return (dvert_tot == dvert_tot_from);
460 if (defbase_tot_from < defbase_tot) {
463 for (
i = 0;
i <= defbase_tot_from;
i++) {
466 for (;
i <= defbase_tot;
i++) {
473 if (dvert_array_from !=
nullptr && dvert_array !=
nullptr) {
474 dvf = dvert_array_from;
477 for (
i = 0;
i < dvert_tot;
i++, dvf++, dv++) {
495 float *dvert_weights,
498 for (
int i = 0;
i < dvert_tot;
i++) {
506 const float *dvert_weights,
508 const bool remove_zero)
512 for (
i = 0;
i < dvert_tot;
i++) {
515 if (dvert_weights[
i] > 0.0f) {
559 Object *ob,
BMVert *eve,
int def_nr,
int vidx,
const int cd_dvert_offset)
568 if (eve_mirr && eve_mirr != eve) {
590 if ((vidx_mirr) >= 0 && (vidx_mirr != vidx)) {
640 int subset_count, vgroup_tot;
641 const bool *vgroup_validmap;
650 if (dvert_act ==
nullptr) {
655 ob, subset_type, &vgroup_tot, &subset_count);
663 dvert_act, vgroup_validmap, vgroup_tot, lock_flags, defbase_tot);
689 int i, vgroup_tot, subset_count;
691 ob, subset_type, &vgroup_tot, &subset_count);
722 for (
i = 0;
i <
mesh->verts_num;
i++) {
723 if (select_vert[
i] && &dverts[
i] != dvert_act) {
747 "Selected Pose Bones",
748 "All Vertex Groups assigned to Selection"},
753 "All Vertex Groups assigned to Deform Bones"},
754 {
WT_VGROUP_ALL,
"ALL", 0,
"All Groups",
"All Vertex Groups"},
755 {0,
nullptr, 0,
nullptr,
nullptr},
762 const uint selection_mask)
830 "Define which subset of groups shall be used");
855 Object *ob,
const int def_nr,
const int vertnum,
const float weight,
const int assignmode)
864 if (dvert ==
nullptr) {
869 if ((vertnum < 0) || (vertnum >= tot)) {
880 switch (assignmode) {
900 switch (assignmode) {
986 if (cd_dvert_offset != -1 && vertnum < em->
bm->totvert) {
999 if (vertnum >=
mesh->verts_num) {
1002 dv = &dverts[vertnum];
1013 dv = <->
dvert[vertnum];
1058 using namespace bke;
1065 for (MutableDrawingInfo &info : drawings) {
1082 switch (selection_domain) {
1083 case AttrDomain::Point:
1085 for (const int point_i : range) {
1086 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1087 selection.span.typed<bool>()[point_i] = select;
1092 case AttrDomain::Curve: {
1095 for (const int curve_i : range) {
1096 const IndexRange points = points_by_curve[curve_i];
1097 bool any_point_in_group = false;
1098 for (const int point_i : points) {
1099 if (BKE_defvert_find_index(&dverts[point_i], def_nr)) {
1100 any_point_in_group = true;
1104 if (any_point_in_group) {
1105 selection.span.typed<bool>()[curve_i] = select;
1141 if (cd_dvert_offset != -1) {
1174 for (
const int i : select_vert.span.index_range()) {
1175 if (!hide_vert[
i]) {
1198 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
1205 if (actbp && bp == actbp) {
1221 char name[
sizeof(dg->
name)];
1224 int i, idg, icdg, dvert_tot = 0;
1234 if (!strstr(dg->
name,
"_copy")) {
1255 for (
i = 0;
i < dvert_tot;
i++) {
1260 const float weight = dw_org->weight;
1262 dw_cpy->weight = weight;
1287 float weight_max = 0.0f;
1289 for (
int i = 0;
i < dvert_tot;
i++) {
1292 if (!(dv = dvert_array[
i])) {
1302 if (weight_max > 0.0f) {
1303 for (
int i = 0;
i < dvert_tot;
i++) {
1306 if (!(dv = dvert_array[
i])) {
1312 dw->
weight /= weight_max;
1329 const bool *vgroup_validmap,
1330 const int vgroup_tot,
1348 for (
int i = 0;
i < dvert_tot;
i++) {
1350 if (!(dv = dvert_array[
i])) {
1356 if (vgroup_validmap[j]) {
1367 if (use_mirror && use_vert_sel) {
1376 const bool *vgroup_validmap,
1377 const int vgroup_tot,
1378 const bool lock_active,
1380 std::optional<int> current_frame = {})
1383 int i, dvert_tot = 0;
1385 const bool use_vert_sel = vertex_group_use_vert_sel(ob);
1387 vgroup_parray_alloc(
1388 static_cast<ID *
>(ob->
data), &dvert_array, &dvert_tot, use_vert_sel, current_frame);
1394 bool changed =
false;
1396 if ((lock_active ==
true) && (lock_flags !=
nullptr) && (def_nr < defbase_tot)) {
1397 lock_flags[def_nr] =
true;
1401 for (
i = 0;
i < defbase_tot;
i++) {
1402 if (lock_flags[
i] ==
false) {
1407 if (
i == defbase_tot) {
1413 for (
i = 0;
i < dvert_tot;
i++) {
1415 if ((dv = dvert_array[
i])) {
1419 else if (lock_active) {
1452 const bool lock_active,
1454 std::optional<int> current_frame = {})
1461 if (defgroup_validmap[def_nr] ==
true) {
1462 int subset_count, vgroup_tot;
1466 vgroup_normalize_all(ob, vgroup_validmap, vgroup_tot, lock_active,
reports, current_frame);
1485 "Unlock all vertex groups if there is at least one locked group, lock all in other case"},
1486 {
VGROUP_LOCK,
"LOCK", 0,
"Lock",
"Lock all vertex groups"},
1487 {
VGROUP_UNLOCK,
"UNLOCK", 0,
"Unlock",
"Unlock all vertex groups"},
1488 {
VGROUP_INVERT,
"INVERT", 0,
"Invert",
"Invert the lock state of all vertex groups"},
1489 {0,
nullptr, 0,
nullptr,
nullptr},
1500 {
VGROUP_MASK_ALL,
"ALL", 0,
"All",
"Apply action to all vertex groups"},
1504 "INVERT_UNSELECTED",
1506 "Invert Unselected",
1507 "Apply the opposite of Lock/Unlock to unselected vertex groups"},
1508 {0,
nullptr, 0,
nullptr,
nullptr},
1531 if (sel_count == 0 && actdef >= 1 && actdef <= defbase_tot) {
1532 mask[actdef - 1] =
true;
1541 bool *selected =
nullptr;
1615 const bool *vgroup_validmap,
1616 const int vgroup_tot,
1618 const bool auto_assign,
1619 const bool auto_remove)
1632 for (
int i = 0;
i < dvert_tot;
i++) {
1634 if (!(dv = dvert_array[
i])) {
1641 if (vgroup_validmap[j]) {
1657 if (use_mirror && use_vert_sel) {
1670 const bool *vgroup_validmap,
1671 const int vgroup_tot,
1672 const int subset_count,
1675 const float fac_expand)
1678 BLI_assert(vgroup_tot > 0 && subset_count > 0);
1680 const float ifac = 1.0f - fac;
1689 const bool use_hide = use_select;
1691 const int expand_sign =
signum_i(fac_expand);
1692 const float expand =
fabsf(fac_expand);
1693 const float iexpand = 1.0f - expand;
1699 float *weight_accum_prev;
1700 float *weight_accum_curr;
1710 vgroup_subset_weights.
fill(0.0f);
1721 mesh->edges(),
mesh->verts_num, vert_to_edge_offsets, vert_to_edge_indices);
1730#define IS_BM_VERT_READ(v) (use_hide ? (BM_elem_flag_test(v, BM_ELEM_HIDDEN) == 0) : true)
1731#define IS_BM_VERT_WRITE(v) (use_select ? (BM_elem_flag_test(v, BM_ELEM_SELECT) != 0) : true)
1737#define IS_ME_VERT_READ(v) (use_hide ? !(hide_vert && hide_vert[v]) : true)
1738#define IS_ME_VERT_WRITE(v) (use_select ? select_vert[v] : true)
1742 for (
int i = 0;
i < dvert_tot;
i++) {
1763 for (
int i = 0;
i < dvert_tot;
i++) {
1765 for (
int j = 0; j < emap[
i].
size(); j++) {
1766 const int2 &edge = edges[emap[
i][j]];
1767 const int i_other = (edge[0] ==
i) ? edge[1] : edge[0];
1777 for (subset_index = 0; subset_index < subset_count; subset_index++) {
1778 const int def_nr = vgroup_subset_map[subset_index];
1782 (
const MDeformVert **)dvert_array, dvert_tot, weight_accum_prev, def_nr);
1783 memcpy(weight_accum_curr, weight_accum_prev,
sizeof(*weight_accum_curr) * dvert_tot);
1785 for (iter = 0; iter < repeat; iter++) {
1790 for (vi_step = verts_used; vi_step != vi_end; vi_step++) {
1791 const uint i = *vi_step;
1792 float weight_tot = 0.0f;
1793 float weight = 0.0f;
1795#define WEIGHT_ACCUMULATE \
1797 float weight_other = weight_accum_prev[i_other]; \
1798 float tot_factor = 1.0f; \
1799 if (expand_sign == 1) { \
1800 if (weight_other < weight_accum_prev[i]) { \
1801 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1802 tot_factor = iexpand; \
1805 else if (expand_sign == -1) { \
1806 if (weight_other > weight_accum_prev[i]) { \
1807 weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
1808 tot_factor = iexpand; \
1811 weight += tot_factor * weight_other; \
1812 weight_tot += tot_factor; \
1844 for (j = 0; j < emap[
i].
size(); j++) {
1845 const int2 &edge = edges[emap[
i][j]];
1846 const int i_other = (edge[0] ==
i ? edge[1] : edge[0]);
1853#undef WEIGHT_ACCUMULATE
1855 if (weight_tot != 0.0f) {
1856 weight /= weight_tot;
1857 weight = (weight_accum_prev[
i] * ifac) + (weight * fac);
1860 CLAMP(weight, 0.0f, 1.0f);
1861 weight_accum_curr[
i] = weight;
1865 std::swap(weight_accum_curr, weight_accum_prev);
1871#undef IS_BM_VERT_READ
1872#undef IS_BM_VERT_WRITE
1873#undef IS_ME_VERT_READ
1874#undef IS_ME_VERT_WRITE
1927 const bool *vgroup_validmap,
1928 const int vgroup_tot,
1929 const int subset_count,
1930 const int max_weights)
1933 int i, dvert_tot = 0;
1940 int num_to_drop = 0;
1942 for (
i = 0;
i < dvert_tot;
i++) {
1945 int bone_count = 0, non_bone_count = 0;
1949 if (!(dv = dvert_array[
i])) {
1953 num_to_drop = subset_count - max_weights;
1956 if (num_to_drop > 0) {
1964 dw_temp[dv->
totweight - 1 - bone_count] = dv->
dw[j];
1968 dw_temp[non_bone_count] = dv->
dw[j];
1969 non_bone_count += 1;
1973 num_to_drop = bone_count - max_weights;
1974 if (num_to_drop > 0) {
1975 qsort(&dw_temp[non_bone_count],
1984 remove_tot += num_to_drop;
1998 const bool *vgroup_validmap,
1999 const int vgroup_tot,
2001 const float epsilon,
2002 const bool keep_single)
2014 if (use_mirror && use_vert_sel) {
2022 dvert_array, dvert_tot, vgroup_validmap, vgroup_tot, epsilon, keep_single);
2029 const bool *vgroup_validmap,
2030 const int vgroup_tot,
2043 const float steps_fl =
steps;
2046 if (use_mirror && use_vert_sel) {
2050 for (
int i = 0;
i < dvert_tot;
i++) {
2054 if (!(dv = dvert_array[
i])) {
2059 for (j = 0, dw = dv->
dw; j < dv->totweight; j++, dw++) {
2060 if ((dw->
def_nr < vgroup_tot) && vgroup_validmap[dw->
def_nr]) {
2074 const char sel_mirr,
2075 const int *flip_map,
2076 const int flip_map_len,
2077 const bool mirror_weights,
2078 const bool flip_vgroups,
2079 const bool all_vgroups,
2080 const int act_vgroup)
2084 if (sel_mirr && sel) {
2086 if (mirror_weights) {
2088 std::swap(*dvert, *dvert_mirr);
2094 if (dw && dw_mirr) {
2118 std::swap(dvert, dvert_mirr);
2121 if (mirror_weights) {
2138 const bool mirror_weights,
2139 const bool flip_vgroups,
2140 const bool all_vgroups,
2141 const bool use_topology,
2148 int totmirr = 0, totfail = 0;
2150 *r_totmirr = *r_totfail = 0;
2154 if ((mirror_weights ==
false && flip_vgroups ==
false) ||
2160 int *flip_map =
nullptr;
2168 if (flip_map ==
nullptr) {
2186 if (cd_dvert_offset == -1) {
2199 if (eve_mirr != eve) {
2204 if ((sel || sel_mirr) && (eve != eve_mirr)) {
2236 if (
mesh->deform_verts().is_empty()) {
2246 for (
int vidx = 0; vidx <
mesh->verts_num; vidx++) {
2250 if (vidx != vidx_mirr) {
2252 const bool sel = use_sel ? select_vert[vidx] :
true;
2253 const bool sel_mirr = use_sel ? select_vert[vidx_mirr] :
true;
2255 if (sel || sel_mirr) {
2287 if (lt->
pntsu == 1 || lt->
dvert ==
nullptr) {
2294 int pntsu_half = lt->
pntsu / 2;
2296 for (
int w = 0;
w < lt->
pntsw;
w++) {
2297 for (
int v = 0;
v < lt->
pntsv;
v++) {
2298 for (
int u = 0; u < pntsu_half; u++) {
2299 int u_inv = (lt->
pntsu - 1) - u;
2308 const bool sel_mirr = bp_mirr->
f1 &
SELECT;
2310 if (sel || sel_mirr) {
2332 if (flip_vgroups && flip_map[def_nr] >= 0) {
2333 ob->actdef = flip_map[def_nr] + 1;
2338 *r_totmirr = totmirr;
2339 *r_totfail = totfail;
2345#undef VGROUP_MIRR_OP
2373 if (
mesh->runtime->edit_mesh) {
2375 int cd_dvert_offset;
2407 for (
int i = 0;
i <
mesh->verts_num;
i++) {
2408 if (select_vert[
i]) {
2424 if (lt->
dvert ==
nullptr) {
2431 for (a = 0, bp = lt->
def; a < tot; a++, bp++, dv++) {
2450 for (MutableDrawingInfo info : drawings) {
2525 const bool needs_select,
2526 const short ob_type_flag)
2534 if (ob_type_flag && ((1 << ob->
type) & ob_type_flag) == 0) {
2555static bool vertex_group_vert_poll(
bContext *
C)
2557 return vertex_group_vert_poll_ex(
C,
false, 0);
2572static bool vertex_group_mesh_vert_select_poll(
bContext *
C)
2574 return vertex_group_vert_poll_ex(
C,
true, (1 <<
OB_MESH));
2641 ot->name =
"Add Vertex Group";
2642 ot->idname =
"OBJECT_OT_vertex_group_add";
2643 ot->description =
"Add a new vertex group to the active object";
2662 const bool use_selection,
2663 const bool all_drawings =
false)
2682 for (
const MutableDrawingInfo &info : drawings) {
2690 const bool use_selection,
2691 const bool all_drawings =
false,
2692 const bool only_unlocked =
false)
2714 if (all_vgroup || only_unlocked) {
2729 if (all_vgroup || only_unlocked) {
2748 ot->name =
"Remove Vertex Group";
2749 ot->idname =
"OBJECT_OT_vertex_group_remove";
2750 ot->description =
"Delete the active or all vertex groups from the active object";
2766 ot->srna,
"all_unlocked",
false,
"All Unlocked",
"Remove all unlocked vertex groups");
2786 const int current_frame = scene.
r.
cfra;
2803 ot->name =
"Assign to Vertex Group";
2804 ot->idname =
"OBJECT_OT_vertex_group_assign";
2805 ot->description =
"Assign the selected vertices to the active vertex group";
2838 ot->name =
"Assign to New Group";
2839 ot->idname =
"OBJECT_OT_vertex_group_assign_new";
2840 ot->description =
"Assign the selected vertices to a new vertex group";
2867 if (use_all_groups) {
2879 if (dg ==
nullptr) {
2894 const int current_frame = scene.
r.
cfra;
2912 ot->name =
"Remove from Vertex Group";
2913 ot->idname =
"OBJECT_OT_vertex_group_remove_from";
2914 ot->description =
"Remove the selected vertices from active or all vertex group(s)";
2928 ot->srna,
"use_all_groups",
false,
"All Groups",
"Remove from all groups");
2931 ot->srna,
"use_all_verts",
false,
"All Vertices",
"Clear the active group");
2961 ot->name =
"Select Vertex Group";
2962 ot->idname =
"OBJECT_OT_vertex_group_select";
2963 ot->description =
"Select all the vertices assigned to the active vertex group";
2995 ot->name =
"Deselect Vertex Group";
2996 ot->idname =
"OBJECT_OT_vertex_group_deselect";
2997 ot->description =
"Deselect all selected vertices assigned to the active vertex group";
3029 ot->name =
"Duplicate Vertex Group";
3030 ot->idname =
"OBJECT_OT_vertex_group_copy";
3031 ot->description =
"Make a copy of the active vertex group";
3056 int subset_count, vgroup_tot;
3059 ob, subset_type, &vgroup_tot, &subset_count);
3073 ot->name =
"Vertex Group Levels";
3074 ot->idname =
"OBJECT_OT_vertex_group_levels";
3076 "Add some offset and multiply with some gain the weights of the active vertex group";
3087 ot->srna,
"offset", 0.0f, -1.0, 1.0,
"Offset",
"Value to add to weights", -1.0f, 1.0f);
3089 ot->srna,
"gain", 1.0f, 0.0f,
FLT_MAX,
"Gain",
"Value to multiply weights by", 0.0f, 10.0f);
3118 ot->name =
"Normalize Vertex Group";
3119 ot->idname =
"OBJECT_OT_vertex_group_normalize";
3121 "Normalize weights of the active vertex group, so that the highest ones are now 1.0";
3152 for (
int i = 0;
i < defgroup_tot;
i++) {
3153 if (defgroup_validmap[
i] ==
true) {
3161 return target_group;
3176 int subset_count, vgroup_tot;
3178 ob, subset_type, &vgroup_tot, &subset_count);
3180 if (subset_count == 0) {
3188 ob, vgroup_validmap, vgroup_tot, lock_active, op->
reports, current_frame);
3212 ot->name =
"Normalize All Vertex Groups";
3213 ot->idname =
"OBJECT_OT_vertex_group_normalize_all";
3215 "Normalize all weights of all vertex groups, "
3216 "so that for each vertex, the sum of all weights is 1.0";
3230 "Keep the values of the active group while normalizing others");
3266 return TIP_(
"Lock all vertex groups of the active object");
3268 return TIP_(
"Lock selected vertex groups of the active object");
3270 return TIP_(
"Lock unselected vertex groups of the active object");
3272 return TIP_(
"Lock selected and unlock unselected vertex groups of the active object");
3278 return TIP_(
"Unlock all vertex groups of the active object");
3280 return TIP_(
"Unlock selected vertex groups of the active object");
3282 return TIP_(
"Unlock unselected vertex groups of the active object");
3284 return TIP_(
"Unlock selected and lock unselected vertex groups of the active object");
3290 return TIP_(
"Toggle locks of all vertex groups of the active object");
3292 return TIP_(
"Toggle locks of selected vertex groups of the active object");
3294 return TIP_(
"Toggle locks of unselected vertex groups of the active object");
3297 "Toggle locks of all and invert unselected vertex groups of the active object");
3303 return TIP_(
"Invert locks of all vertex groups of the active object");
3306 return TIP_(
"Invert locks of selected vertex groups of the active object");
3308 return TIP_(
"Invert locks of unselected vertex groups of the active object");
3320 ot->name =
"Change the Lock On Vertex Groups";
3321 ot->idname =
"OBJECT_OT_vertex_group_lock";
3322 ot->description =
"Change the lock state of all or some vertex groups of active object";
3337 "Lock action to execute on vertex groups");
3344 "Apply the action based on vertex group selection");
3362 int subset_count, vgroup_tot;
3365 ob, subset_type, &vgroup_tot, &subset_count);
3379 ot->name =
"Invert Vertex Group";
3380 ot->idname =
"OBJECT_OT_vertex_group_invert";
3381 ot->description =
"Invert active vertex group's weights";
3395 "Add vertices from groups that have zero weight before inverting");
3400 "Remove vertices from groups that have zero weight after inverting");
3417 bool has_vgroup_multi =
false;
3419 for (
Object *ob : objects) {
3420 int subset_count, vgroup_tot;
3423 ob, subset_type, &vgroup_tot, &subset_count);
3427 if (locked_vgroups) {
3429 for (
int i = 0;
i < vgroup_tot;
i++) {
3430 if (vgroup_validmap[
i] && locked_vgroups[
i]) {
3431 vgroup_validmap[
i] =
false;
3438 has_vgroup_multi =
true;
3442 ob, vgroup_validmap, vgroup_tot, subset_count, fac, repeat, fac_expand);
3459 if (!has_vgroup_multi) {
3469 ot->name =
"Smooth Vertex Weights";
3470 ot->idname =
"OBJECT_OT_vertex_group_smooth";
3471 ot->description =
"Smooth weights for selected vertices";
3481 RNA_def_float(
ot->srna,
"factor", 0.5f, 0.0f, 1.0,
"Factor",
"", 0.0f, 1.0f);
3482 RNA_def_int(
ot->srna,
"repeat", 1, 1, 10000,
"Iterations",
"", 1, 200);
3490 "Expand/contract weights",
3509 for (
Object *ob : objects) {
3510 int subset_count, vgroup_tot;
3513 ob, subset_type, &vgroup_tot, &subset_count);
3529 ot->name =
"Clean Vertex Group Weights";
3530 ot->idname =
"OBJECT_OT_vertex_group_clean";
3531 ot->description =
"Remove vertex group assignments which are not required";
3547 "Remove vertices which weight is below or equal to this limit",
3554 "Keep verts assigned to at least one group when cleaning");
3571 int subset_count, vgroup_tot;
3574 ob, subset_type, &vgroup_tot, &subset_count);
3588 ot->name =
"Quantize Vertex Weights";
3589 ot->idname =
"OBJECT_OT_vertex_group_quantize";
3590 ot->description =
"Set weights to a fixed number of steps";
3600 RNA_def_int(
ot->srna,
"steps", 4, 1, 1000,
"Steps",
"Number of steps between 0 and 1", 1, 100);
3614 int remove_multi_count = 0;
3617 for (
Object *ob : objects) {
3619 int subset_count, vgroup_tot;
3621 ob, subset_type, &vgroup_tot, &subset_count);
3623 ob, vgroup_validmap, vgroup_tot, subset_count, limit);
3626 if (remove_count != 0) {
3631 remove_multi_count += remove_count;
3634 if (remove_multi_count) {
3637 "%d vertex weights limited",
3638 remove_multi_count);
3651 ot->name =
"Limit Number of Weights per Vertex";
3652 ot->idname =
"OBJECT_OT_vertex_group_limit_total";
3654 "Limit deform weights associated with a vertex to a specified number by removing lowest "
3665 RNA_def_int(
ot->srna,
"limit", 4, 1, 32,
"Limit",
"Maximum number of deform weights", 1, 32);
3677 int totmirr = 0, totfail = 0;
3700 ot->name =
"Mirror Vertex Group";
3701 ot->idname =
"OBJECT_OT_vertex_group_mirror";
3703 "Mirror vertex group, flip weights and/or names, editing only selected vertices, "
3704 "flipping when both sides are selected otherwise copy from unselected";
3714 RNA_def_boolean(
ot->srna,
"mirror_weights",
true,
"Mirror Weights",
"Mirror weights");
3716 ot->srna,
"flip_group_names",
true,
"Flip Group Names",
"Flip vertex group names");
3717 RNA_def_boolean(
ot->srna,
"all_groups",
false,
"All Groups",
"Mirror all vertex groups weights");
3723 "Use topology based mirroring (for when both sides of mesh have matching, unique topology)");
3735 int changed_tot = 0;
3753 if ((changed_tot == 0 && fail == 0) || fail) {
3756 "Copy vertex groups to selected: %d done, %d failed (object data must support "
3757 "vertex groups and have matching indices)",
3768 ot->name =
"Copy Vertex Group to Selected";
3769 ot->idname =
"OBJECT_OT_vertex_group_copy_to_selected";
3770 ot->description =
"Replace vertex groups of selected objects by vertex groups of active object";
3822 tmp.
icon = ICON_GROUP_VERTEX;
3839 ot->name =
"Set Active Vertex Group";
3840 ot->idname =
"OBJECT_OT_vertex_group_set_active";
3841 ot->description =
"Set the active vertex group";
3871 char *name_array =
static_cast<char *
>(
3893 int *sort_map = sort_map_update + 1;
3916 if (cd_dvert_offset != -1) {
3940 while (dvert_tot--) {
3950 for (
i = 0;
i < defbase_tot;
i++) {
3954 sort_map_update[0] = 0;
3980 if (bonebase ==
nullptr) {
3982 if (armobj !=
nullptr) {
3989 if (bonebase !=
nullptr) {
3994 if (dg !=
nullptr) {
4020 switch (sort_type) {
4049 {0,
nullptr, 0,
nullptr,
nullptr},
4052 ot->name =
"Sort Vertex Groups";
4053 ot->idname =
"OBJECT_OT_vertex_group_sort";
4054 ot->description =
"Sort vertex groups";
4109 {-1,
"UP", 0,
"Up",
""},
4110 {1,
"DOWN", 0,
"Down",
""},
4111 {0,
nullptr, 0,
nullptr,
nullptr},
4115 ot->name =
"Move Vertex Group";
4116 ot->idname =
"OBJECT_OT_vertex_group_move";
4117 ot->description =
"Move the active vertex group up/down in the list";
4131 "Direction to move the active vertex group towards");
4153 if (dvert_act ==
nullptr) {
4178 if (dvert_act ==
nullptr) {
4187 for (
i = 0;
i <
mesh->verts_num;
i++) {
4188 if (select_vert[
i] && (&dverts[
i] != dvert_act)) {
4242 ot->name =
"Paste Weight to Selected";
4243 ot->idname =
"OBJECT_OT_vertex_weight_paste";
4245 "Copy this group's weight to other selected vertices (disabled if vertex group is locked)";
4260 "Index of source weight in active vertex group",
4293 ot->name =
"Delete Weight";
4294 ot->idname =
"OBJECT_OT_vertex_weight_delete";
4295 ot->description =
"Delete this weight from the vertex (disabled if vertex group is locked)";
4310 "Index of source weight in active vertex group",
4327 if (wg_index != -1) {
4340 ot->name =
"Set Active Group";
4341 ot->idname =
"OBJECT_OT_vertex_weight_set_active";
4342 ot->description =
"Set as active vertex group";
4357 "Index of source weight in active vertex group",
4391 ot->name =
"Normalize Active";
4392 ot->idname =
"OBJECT_OT_vertex_weight_normalize_active_vertex";
4393 ot->description =
"Normalize active vertex's weights";
4426 ot->name =
"Copy Active";
4427 ot->idname =
"OBJECT_OT_vertex_weight_copy";
4428 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)
const void * CustomData_get_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
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)
#define SNPRINTF(dst, format,...)
char * STRNCPY(char(&dst)[N], const char *src)
int char char int int int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define UNUSED_FUNCTION(x)
#define IN_RANGE_INCL(a, b, c)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
#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)
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)
void EDBM_deselect_flush(BMEditMesh *em)
int ED_mesh_mirror_get_vert(Object *ob, int index)
void ED_mesh_report_mirror(wmOperator *op, int totmirr, int totfail)
void EDBM_verts_mirror_cache_end(BMEditMesh *em)
void EDBM_select_flush(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 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.
void fill(const T &value) const
constexpr bool is_empty() const
constexpr bool is_empty() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type)
bke::CurvesGeometry & strokes_for_write()
#define ID_IS_EDITABLE(_id)
#define MEM_reallocN(vmemh, len)
#define ID_IS_OVERRIDE_LIBRARY(_id)
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, eCustomDataType 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)
static void vgroup_normalize_all_deform_if_active_is_deform(Object *ob, const bool lock_active, ReportList *reports, std::optional< int > current_frame={})
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 *)
@ SORT_TYPE_BONEHIERARCHY
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)
static bool vertex_group_vert_select_poll(bContext *C)
static void vgroup_copy_active_to_sel(Object *ob, eVGroupSelect subset_type)
static bool vgroup_normalize_all(Object *ob, const bool *vgroup_validmap, const int vgroup_tot, const bool lock_active, ReportList *reports, std::optional< int > current_frame={})
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)
@ VGROUP_MASK_INVERT_UNSELECTED
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)
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)
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_ME_VERT_READ(v)
#define IS_ME_VERT_WRITE(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 *)