diff options
Diffstat (limited to 'source/gameengine/Converter/BL_BlenderDataConversion.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 8ba39e288ca..dda1864f07c 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -45,7 +45,9 @@ * This workaround will make sure that curve_cache for curves * is up-to-date. */ -#define THREADED_DAG_WORKAROUND + +/* TODO: Disabled for now, because of eval_ctx. */ +//#define THREADED_DAG_WORKAROUND #include <math.h> #include <vector> @@ -145,6 +147,8 @@ extern "C" { #include "BKE_customdata.h" #include "BKE_cdderivedmesh.h" #include "BKE_DerivedMesh.h" +#include "BKE_group.h" +#include "BKE_layer.h" #include "BKE_material.h" /* give_current_material */ #include "BKE_image.h" #include "IMB_imbuf_types.h" @@ -589,17 +593,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 +793,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; @@ -830,7 +838,7 @@ static bool ConvertMaterial( /* No material, what to do? let's see what is in the UV and set the material accordingly * light and visible is always on */ if (validface) { - material->tile = tface->tile; + /* nop */ } else { // nothing at all @@ -869,13 +877,6 @@ static bool ConvertMaterial( if (validmat) { material->matname =(mat->id.name); } - - if (tface) { - ME_MTEXFACE_CPY(&material->mtexpoly, tface); - } - else { - memset(&material->mtexpoly, 0, sizeof(material->mtexpoly)); - } material->material = mat; return true; } @@ -894,7 +895,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 +911,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); } @@ -1687,6 +1688,7 @@ struct parentChildLink { SG_Node* m_gamechildnode; }; +#if 0 static bPoseChannel *get_active_posechannel2(Object *ob) { bArmature *arm= (bArmature*)ob->data; @@ -1700,6 +1702,7 @@ static bPoseChannel *get_active_posechannel2(Object *ob) return NULL; } +#endif static ListBase *get_active_constraints2(Object *ob) { @@ -1707,6 +1710,7 @@ static ListBase *get_active_constraints2(Object *ob) return NULL; // XXX - shouldnt we care about the pose data and not the mode??? +#if 0 if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan; @@ -1714,8 +1718,11 @@ static ListBase *get_active_constraints2(Object *ob) if (pchan) return &pchan->constraints; } - else + else +#endif + { return &ob->constraints; + } return NULL; } @@ -1740,7 +1747,7 @@ static void blenderSceneSetBackground(Scene *blenderscene) for (SETLOOPER(blenderscene, it, base)) { base->object->lay = base->lay; - base->object->flag = base->flag; + BKE_scene_object_base_flag_sync_from_base(base); } } @@ -2052,10 +2059,8 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for (git=tempglist.begin(); git!=tempglist.end(); git++) { Group* group = *git; - GroupObject* go; - for (go=(GroupObject*)group->gobject.first; go; go=(GroupObject*)go->next) + FOREACH_GROUP_OBJECT(group, blenderobject) { - Object* blenderobject = go->ob; if (converter->FindGameObject(blenderobject) == NULL) { allblobj.insert(blenderobject); @@ -2090,6 +2095,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } } } + FOREACH_GROUP_OBJECT_END } } } |