Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/multires.cc
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| CustomData_get_layer_for_write(&me->ldata, CD_MDISPS, me->totloop)); | CustomData_get_layer_for_write(&me->ldata, CD_MDISPS, me->totloop)); | ||||
| gpm = static_cast<GridPaintMask *>( | gpm = static_cast<GridPaintMask *>( | ||||
| CustomData_get_layer_for_write(&me->ldata, CD_GRID_PAINT_MASK, me->totloop)); | CustomData_get_layer_for_write(&me->ldata, CD_GRID_PAINT_MASK, me->totloop)); | ||||
| multires_force_sculpt_rebuild(ob); | multires_force_sculpt_rebuild(ob); | ||||
| if (mdisps && levels > 0) { | if (mdisps && levels > 0) { | ||||
| if (lvl > 0) { | if (lvl > 0) { | ||||
| // MLoop *ml = me->mloop; /*UNUSED*/ | |||||
| int nsize = multires_side_tot[lvl]; | int nsize = multires_side_tot[lvl]; | ||||
| int hsize = multires_side_tot[mmd->totlvl]; | int hsize = multires_side_tot[mmd->totlvl]; | ||||
| int i, j; | int i, j; | ||||
| for (i = 0; i < me->totpoly; i++) { | for (i = 0; i < me->totpoly; i++) { | ||||
| for (j = 0; j < polys[i].totloop; j++) { | for (j = 0; j < polys[i].totloop; j++) { | ||||
| int g = polys[i].loopstart + j; | int g = polys[i].loopstart + j; | ||||
| MDisps *mdisp = &mdisps[g]; | MDisps *mdisp = &mdisps[g]; | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| * the barycentric coordinates and finally find the closest vertex | * the barycentric coordinates and finally find the closest vertex | ||||
| * should work reliably for convex cases only but better than nothing */ | * should work reliably for convex cases only but better than nothing */ | ||||
| #if 0 | #if 0 | ||||
| int minS, i; | int minS, i; | ||||
| float mindist = FLT_MAX; | float mindist = FLT_MAX; | ||||
| for (i = 0; i < mpoly->totloop; i++) { | for (i = 0; i < mpoly->totloop; i++) { | ||||
| float len = len_v3v3(nullptr, positions[mloop[mpoly->loopstart + i].v]); | float len = len_v3v3(nullptr, positions[corner_verts[mpoly->loopstart + i]]); | ||||
| if (len < mindist) { | if (len < mindist) { | ||||
| mindist = len; | mindist = len; | ||||
| minS = i; | minS = i; | ||||
| } | } | ||||
| } | } | ||||
| S = minS; | S = minS; | ||||
| #endif | #endif | ||||
| /* temp not implemented yet and also not working properly in current master. | /* temp not implemented yet and also not working properly in current master. | ||||
| * (was worked around by subdividing once) */ | * (was worked around by subdividing once) */ | ||||
| S = 0; | S = 0; | ||||
| *x = 0; | *x = 0; | ||||
| *y = 0; | *y = 0; | ||||
| } | } | ||||
| return S; | return S; | ||||
| } | } | ||||
| Context not available. | |||||