Remove MTFace DM_paint_uvlayer_active_get func

This commit is contained in:
Campbell Barton 2015-07-17 04:26:17 +10:00
parent 67acde92bb
commit 40936307dd
4 changed files with 4 additions and 28 deletions

@ -615,8 +615,7 @@ void DM_ensure_looptri(DerivedMesh *dm);
void DM_update_tessface_data(DerivedMesh *dm);
void DM_update_materials(DerivedMesh *dm, struct Object *ob);
struct MTFace *DM_paint_uvlayer_active_get(DerivedMesh *dm, int mat_nr);
struct MLoopUV *DM_paint_uvlayer_active_get_mloopuv(DerivedMesh *dm, int mat_nr);
struct MLoopUV *DM_paint_uvlayer_active_get(DerivedMesh *dm, int mat_nr);
void DM_interp_vert_data(
struct DerivedMesh *source, struct DerivedMesh *dest,

@ -576,30 +576,7 @@ void DM_update_materials(DerivedMesh *dm, Object *ob)
}
}
MTFace *DM_paint_uvlayer_active_get(DerivedMesh *dm, int mat_nr)
{
MTFace *tf_base;
BLI_assert(mat_nr < dm->totmat);
if (dm->mat[mat_nr] && dm->mat[mat_nr]->texpaintslot &&
dm->mat[mat_nr]->texpaintslot[dm->mat[mat_nr]->paint_active_slot].uvname)
{
tf_base = CustomData_get_layer_named(&dm->faceData, CD_MTFACE,
dm->mat[mat_nr]->texpaintslot[dm->mat[mat_nr]->paint_active_slot].uvname);
/* This can fail if we have changed the name in the UV layer list and have assigned the old name in the material
* texture slot.*/
if (!tf_base)
tf_base = CustomData_get_layer(&dm->faceData, CD_MTFACE);
}
else {
tf_base = CustomData_get_layer(&dm->faceData, CD_MTFACE);
}
return tf_base;
}
MLoopUV *DM_paint_uvlayer_active_get_mloopuv(DerivedMesh *dm, int mat_nr)
MLoopUV *DM_paint_uvlayer_active_get(DerivedMesh *dm, int mat_nr)
{
MLoopUV *uv_base;

@ -1384,7 +1384,7 @@ static void cdDM_buffer_copy_uv_texpaint(
uv_base = MEM_mallocN(totmaterial * sizeof(*uv_base), "texslots");
for (i = 0; i < totmaterial; i++) {
uv_base[i] = DM_paint_uvlayer_active_get_mloopuv(dm, i);
uv_base[i] = DM_paint_uvlayer_active_get(dm, i);
}
stencil = CustomData_get_stencil_layer(&dm->loopData, CD_MLOOPUV);

@ -2050,7 +2050,7 @@ static void ccgDM_buffer_copy_uv_texpaint(
mloopuv_base = MEM_mallocN(totmaterial * sizeof(*mloopuv_base), "texslots");
for (i = 0; i < totmaterial; i++) {
mloopuv_base[i] = DM_paint_uvlayer_active_get_mloopuv(dm, i);
mloopuv_base[i] = DM_paint_uvlayer_active_get(dm, i);
}
stencil = CustomData_get_stencil_layer(&dm->loopData, CD_MLOOPUV);