diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:14:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-24 16:38:15 +0300 |
commit | 7a9ad029dd1d1afe42d54c9c181de887636db7c0 (patch) | |
tree | e9281cbe8bb01365a699ffd6f4bbd09a6a91015f /source/blender/editors/space_image | |
parent | 707340edd703ff1fd7c8157eb3cc811913698c8d (diff) |
Remove TexFace, per-face images
TexFace complicates the now more popular shading pipeline by having
per-face images, see: T51382 for details.
To keep the ability to select a per-material edit-image
(used with UV-mapping workflow), the material now stores an image
which will be set when changing images in edit-mode.
This is used as a bake-target when not using Cycles too.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 4b51a50d096..601b1fa8e72 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -44,11 +44,13 @@ #include "BKE_colortools.h" #include "BKE_context.h" +#include "BKE_editmesh.h" #include "BKE_image.h" #include "BKE_layer.h" #include "BKE_library.h" #include "BKE_scene.h" #include "BKE_screen.h" +#include "BKE_material.h" #include "DEG_depsgraph.h" @@ -425,17 +427,20 @@ static void image_refresh(const bContext *C, ScrArea *sa) } else { /* old shading system, we set texface */ - MTexPoly *tf; - if (em && EDBM_mtexpoly_check(em)) { - tf = EDBM_mtexpoly_active_get(em, NULL, sloppy, selected); + BMFace *efa = BM_mesh_active_face_get(em->bm, sloppy, selected); - if (tf) { + if (efa) { /* don't need to check for pin here, see above */ - sima->image = tf->tpage; + Image *image = BKE_object_material_edit_image_get(obedit, efa->mat_nr); + + sima->image = image; - if ((sima->flag & SI_EDITTILE) == 0) { - sima->curtile = tf->tile; + MTexPoly *tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY); + if (tf) { + if ((sima->flag & SI_EDITTILE) == 0) { + sima->curtile = tf->tile; + } } } } |