forked from bartvdbraak/blender
Fix T37920: BGE LibLoad failed for meshes with no materials
This commit is contained in:
parent
0d6ae3fda2
commit
6a473305af
@ -1313,6 +1313,8 @@ bool KX_BlenderSceneConverter::FreeBlendFile(struct Main *maggie)
|
||||
|
||||
int size_before = obs->GetCount();
|
||||
|
||||
gameobj->RemoveMeshes();
|
||||
|
||||
/* Eventually calls RemoveNodeDestructObject
|
||||
* frees m_map_gameobject_to_blender from UnregisterGameObject */
|
||||
scene->RemoveObject(gameobj);
|
||||
|
@ -558,7 +558,7 @@ RAS_MeshSlot* RAS_MaterialBucket::CopyMesh(RAS_MeshSlot *ms)
|
||||
return &m_meshSlots.back();
|
||||
}
|
||||
|
||||
void RAS_MaterialBucket::RemoveMesh(RAS_MeshSlot* ms)
|
||||
void RAS_MaterialBucket::RemoveMeshSlot(RAS_MeshSlot *ms)
|
||||
{
|
||||
list<RAS_MeshSlot>::iterator it;
|
||||
|
||||
@ -570,6 +570,20 @@ void RAS_MaterialBucket::RemoveMesh(RAS_MeshSlot* ms)
|
||||
}
|
||||
}
|
||||
|
||||
void RAS_MaterialBucket::RemoveMesh(RAS_MeshObject *mesh)
|
||||
{
|
||||
list<RAS_MeshSlot>::iterator it;
|
||||
it=m_meshSlots.begin();
|
||||
while (it != m_meshSlots.end()) {
|
||||
if ((*it).m_mesh == mesh) {
|
||||
m_meshSlots.erase(it++);
|
||||
}
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list<RAS_MeshSlot>::iterator RAS_MaterialBucket::msBegin()
|
||||
{
|
||||
return m_meshSlots.begin();
|
||||
|
@ -228,7 +228,8 @@ public:
|
||||
|
||||
class RAS_MeshSlot* AddMesh(int numverts);
|
||||
class RAS_MeshSlot* CopyMesh(class RAS_MeshSlot *ms);
|
||||
void RemoveMesh(class RAS_MeshSlot* ms);
|
||||
void RemoveMeshSlot(class RAS_MeshSlot *ms);
|
||||
void RemoveMesh(class RAS_MeshObject *mesh);
|
||||
void Optimize(MT_Scalar distance);
|
||||
void ActivateMesh(RAS_MeshSlot* slot)
|
||||
{
|
||||
|
@ -458,9 +458,14 @@ void RAS_MeshObject::RemoveFromBuckets(void *clientobj)
|
||||
if (!msp)
|
||||
continue;
|
||||
|
||||
/* see [#37920] */
|
||||
#if 0
|
||||
RAS_MeshSlot *ms = *msp;
|
||||
|
||||
it->m_bucket->RemoveMesh(ms);
|
||||
it->m_bucket->RemoveMeshSlot(ms);
|
||||
#else
|
||||
it->m_bucket->RemoveMesh(this);
|
||||
#endif
|
||||
it->m_slots.remove(clientobj);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user