Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_vgroup.cc
| Show First 20 Lines • Show All 1,916 Lines • ▼ Show 20 Lines | static void vgroup_smooth_subset(Object *ob, | ||||
| const int expand_sign = signum_i(fac_expand); | const int expand_sign = signum_i(fac_expand); | ||||
| const float expand = fabsf(fac_expand); | const float expand = fabsf(fac_expand); | ||||
| const float iexpand = 1.0f - expand; | const float iexpand = 1.0f - expand; | ||||
| BMEditMesh *em = BKE_editmesh_from_object(ob); | BMEditMesh *em = BKE_editmesh_from_object(ob); | ||||
| BMesh *bm = em ? em->bm : nullptr; | BMesh *bm = em ? em->bm : nullptr; | ||||
| Mesh *me = em ? nullptr : static_cast<Mesh *>(ob->data); | Mesh *me = em ? nullptr : static_cast<Mesh *>(ob->data); | ||||
| const bke::AttributeAccessor attributes = me->attributes(); | |||||
| const VArray<bool> select_vert = attributes.lookup_or_default<bool>( | |||||
| ".select_vert", ATTR_DOMAIN_POINT, false); | |||||
| MeshElemMap *emap; | MeshElemMap *emap; | ||||
| int *emap_mem; | int *emap_mem; | ||||
| float *weight_accum_prev; | float *weight_accum_prev; | ||||
| float *weight_accum_curr; | float *weight_accum_curr; | ||||
| uint subset_index; | uint subset_index; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | for (int i = 0; i < dvert_tot; i++) { | ||||
| STACK_PUSH(verts_used, i); | STACK_PUSH(verts_used, i); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| const bke::AttributeAccessor attributes = me->attributes(); | |||||
| const VArray<bool> select_vert = attributes.lookup_or_default<bool>( | |||||
| ".select_vert", ATTR_DOMAIN_POINT, false); | |||||
| const blender::Span<MEdge> edges = me->edges(); | const blender::Span<MEdge> edges = me->edges(); | ||||
| for (int i = 0; i < dvert_tot; i++) { | for (int i = 0; i < dvert_tot; i++) { | ||||
| if (IS_ME_VERT_WRITE(i)) { | if (IS_ME_VERT_WRITE(i)) { | ||||
| for (int j = 0; j < emap[i].count; j++) { | for (int j = 0; j < emap[i].count; j++) { | ||||
| const MEdge *e = &edges[emap[i].indices[j]]; | const MEdge *e = &edges[emap[i].indices[j]]; | ||||
| const int i_other = (e->v1 == i) ? e->v2 : e->v1; | const int i_other = (e->v1 == i) ? e->v2 : e->v1; | ||||
| if (IS_ME_VERT_READ(i_other)) { | if (IS_ME_VERT_READ(i_other)) { | ||||
| STACK_PUSH(verts_used, i); | STACK_PUSH(verts_used, i); | ||||
| ▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | ((void)0) | ||||
| if (IS_BM_VERT_READ(v_other)) { | if (IS_BM_VERT_READ(v_other)) { | ||||
| const int i_other = BM_elem_index_get(v_other); | const int i_other = BM_elem_index_get(v_other); | ||||
| WEIGHT_ACCUMULATE; | WEIGHT_ACCUMULATE; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| const bke::AttributeAccessor attributes = me->attributes(); | |||||
| const VArray<bool> select_vert = attributes.lookup_or_default<bool>( | |||||
| ".select_vert", ATTR_DOMAIN_POINT, false); | |||||
| int j; | int j; | ||||
| const blender::Span<MEdge> edges = me->edges(); | const blender::Span<MEdge> edges = me->edges(); | ||||
| /* checked already */ | /* checked already */ | ||||
| BLI_assert(IS_ME_VERT_WRITE(i)); | BLI_assert(IS_ME_VERT_WRITE(i)); | ||||
| for (j = 0; j < emap[i].count; j++) { | for (j = 0; j < emap[i].count; j++) { | ||||
| const MEdge *e = &edges[emap[i].indices[j]]; | const MEdge *e = &edges[emap[i].indices[j]]; | ||||
| ▲ Show 20 Lines • Show All 2,551 Lines • Show Last 20 Lines | |||||