Cleanup: remove unnecessary texface checks

This commit is contained in:
Campbell Barton 2017-04-24 22:45:40 +10:00
parent aff30aaf2d
commit 69a216d343
2 changed files with 10 additions and 11 deletions

@ -306,31 +306,30 @@ void paintface_deselect_all_visible(Object *ob, int action, bool flush_flags)
bool paintface_minmax(Object *ob, float r_min[3], float r_max[3])
{
Mesh *me;
MPoly *mp;
MTexPoly *tf;
MLoop *ml;
MVert *mvert;
const Mesh *me;
const MPoly *mp;
const MLoop *ml;
const MVert *mvert;
int a, b;
bool ok = false;
float vec[3], bmat[3][3];
me = BKE_mesh_from_object(ob);
if (!me || !me->mtpoly) return ok;
if (!me || !me->mloopuv) {
return ok;
}
copy_m3_m4(bmat, ob->obmat);
mvert = me->mvert;
mp = me->mpoly;
tf = me->mtpoly;
for (a = me->totpoly; a > 0; a--, mp++, tf++) {
for (a = me->totpoly; a > 0; a--, mp++) {
if (mp->flag & ME_HIDE || !(mp->flag & ME_FACE_SEL))
continue;
ml = me->mloop + mp->totloop;
for (b = 0; b < mp->totloop; b++, ml++) {
copy_v3_v3(vec, (mvert[ml->v].co));
mul_m3_v3(bmat, vec);
mul_v3_m3v3(vec, bmat, mvert[ml->v].co);
add_v3_v3v3(vec, vec, ob->obmat[3]);
minmax_v3v3_v3(r_min, r_max, vec);
}

@ -502,7 +502,7 @@ static void draw_uvs_texpaint(SpaceImage *sima, Scene *scene, Object *ob)
ma = give_current_material(ob, ob->actcol);
if (me->mtpoly) {
if (me->mloopuv) {
MPoly *mpoly = me->mpoly;
MLoopUV *mloopuv, *mloopuv_base;
int a, b;