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/gameengine/Converter/BL_BlenderDataConversion.cpp | |
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/gameengine/Converter/BL_BlenderDataConversion.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 6add30f1131..68939d6ac21 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -589,17 +589,17 @@ static bool ConvertMaterial( /* In Multitexture use the face texture if and only if * it is set in the buttons * In GLSL is not working yet :/ 3.2011 */ - bool facetex = false; - if (validface && mat->mode & MA_FACETEXTURE) { - facetex = true; - } // foreach MTex for (int i = 0; i < MAXTEX; i++) { // use face tex - if (i == 0 && facetex ) { - facetex = false; + if (i == 0) { +#if 0 Image *tmp = (Image *)(tface->tpage); +#else + /* weak but better then nothing */ + Image *tmp = mat ? mat->edit_image : NULL; +#endif if (tmp) { material->img[i] = tmp; @@ -789,7 +789,11 @@ static bool ConvertMaterial( // check for tface tex to fallback on if (validface) { +#if 0 material->img[0] = (Image *)(tface->tpage); +#else + material->img[0] = mat ? mat->edit_image : NULL; +#endif // ------------------------ if (material->img[0]) { material->texname[0] = material->img[0]->id.name; @@ -894,7 +898,7 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol, converter->GetGLSLMaterials()); - if (ma && (ma->mode & MA_FACETEXTURE) == 0) + if (ma) converter->CacheBlenderMaterial(scene, ma, bl_mat); } @@ -910,7 +914,7 @@ static RAS_MaterialBucket *material_from_mesh(Material *ma, MFace *mface, MTFace kx_blmat->Initialize(scene, bl_mat, (ma?&ma->game:NULL), lightlayer); polymat = static_cast<RAS_IPolyMaterial*>(kx_blmat); - if (ma && (ma->mode & MA_FACETEXTURE) == 0) + if (ma) converter->CachePolyMaterial(scene, ma, polymat); } |