dyntopo speedup for smooth brush, no need to search for the shared vert-face loop, instead just iterate over the loops.
This commit is contained in:
@@ -1353,23 +1353,18 @@ static float neighbor_average_mask(SculptSession *ss, unsigned vert)
|
|||||||
/* Same logic as neighbor_average(), but for bmesh rather than mesh */
|
/* Same logic as neighbor_average(), but for bmesh rather than mesh */
|
||||||
static void bmesh_neighbor_average(float avg[3], BMVert *v)
|
static void bmesh_neighbor_average(float avg[3], BMVert *v)
|
||||||
{
|
{
|
||||||
int vfcount = BM_vert_face_count(v);
|
const int vfcount = BM_vert_face_count(v);
|
||||||
|
|
||||||
zero_v3(avg);
|
zero_v3(avg);
|
||||||
|
|
||||||
/* Don't modify corner vertices */
|
/* Don't modify corner vertices */
|
||||||
if (vfcount > 1) {
|
if (vfcount > 1) {
|
||||||
BMIter iter;
|
BMIter liter;
|
||||||
BMFace *f;
|
BMLoop *l;
|
||||||
int i, total = 0;
|
int i, total = 0;
|
||||||
|
|
||||||
BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) {
|
BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
|
||||||
BMLoop *l1 = BM_face_vert_share_loop(f, v);
|
BMVert *adj_v[3] = {l->prev->v, v, l->next->v};
|
||||||
BMLoop *l2 = BM_loop_other_vert_loop(l1, v);
|
|
||||||
BMVert *adj_v[3] = {
|
|
||||||
BM_edge_other_vert(l1->e, v),
|
|
||||||
v,
|
|
||||||
BM_edge_other_vert(l2->e, v)};
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (vfcount != 2 || BM_vert_face_count(adj_v[i]) <= 2) {
|
if (vfcount != 2 || BM_vert_face_count(adj_v[i]) <= 2) {
|
||||||
@@ -1391,18 +1386,13 @@ static void bmesh_neighbor_average(float avg[3], BMVert *v)
|
|||||||
/* Same logic as neighbor_average_mask(), but for bmesh rather than mesh */
|
/* Same logic as neighbor_average_mask(), but for bmesh rather than mesh */
|
||||||
static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
|
static float bmesh_neighbor_average_mask(BMesh *bm, BMVert *v)
|
||||||
{
|
{
|
||||||
BMIter iter;
|
BMIter liter;
|
||||||
BMFace *f;
|
BMLoop *l;
|
||||||
float avg = 0;
|
float avg = 0;
|
||||||
int i, total = 0;
|
int i, total = 0;
|
||||||
|
|
||||||
BM_ITER_ELEM (f, &iter, v, BM_FACES_OF_VERT) {
|
BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) {
|
||||||
BMLoop *l1 = BM_face_vert_share_loop(f, v);
|
BMVert *adj_v[3] = {l->prev->v, v, l->next->v};
|
||||||
BMLoop *l2 = BM_loop_other_vert_loop(l1, v);
|
|
||||||
BMVert *adj_v[3] = {
|
|
||||||
BM_edge_other_vert(l1->e, v),
|
|
||||||
v,
|
|
||||||
BM_edge_other_vert(l2->e, v)};
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
BMVert *v2 = adj_v[i];
|
BMVert *v2 = adj_v[i];
|
||||||
|
Reference in New Issue
Block a user