- fbx: fix bug that caused textures to be ignored in some cases.
parent
c7ee6fd70f
commit
2f5ec6f136
|
@ -57,7 +57,8 @@ namespace FBX {
|
||||||
|
|
||||||
using namespace Util;
|
using namespace Util;
|
||||||
|
|
||||||
namespace {
|
// XXX vc9's debugger won't step into anonymous namespaces
|
||||||
|
//namespace {
|
||||||
|
|
||||||
/** Dummy class to encapsulate the conversion process */
|
/** Dummy class to encapsulate the conversion process */
|
||||||
class Converter
|
class Converter
|
||||||
|
@ -84,6 +85,20 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hack to process all materials
|
||||||
|
BOOST_FOREACH(const ObjectMap::value_type& v,doc.Objects()) {
|
||||||
|
|
||||||
|
const Object* ob = v.second->Get();
|
||||||
|
if(!ob) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Material* mat = dynamic_cast<const Material*>(ob);
|
||||||
|
if(mat) {
|
||||||
|
ConvertMaterial(*mat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// dummy root node
|
// dummy root node
|
||||||
out->mRootNode = new aiNode();
|
out->mRootNode = new aiNode();
|
||||||
out->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes.size());
|
out->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes.size());
|
||||||
|
@ -469,7 +484,7 @@ private:
|
||||||
const FBX::Document& doc;
|
const FBX::Document& doc;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // !anon
|
//} // !anon
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void ConvertToAssimpScene(aiScene* out, const Document& doc)
|
void ConvertToAssimpScene(aiScene* out, const Document& doc)
|
||||||
|
|
|
@ -464,6 +464,10 @@ Document::Document(const Parser& parser, const ImportSettings& settings)
|
||||||
, settings(settings)
|
, settings(settings)
|
||||||
{
|
{
|
||||||
ReadPropertyTemplates();
|
ReadPropertyTemplates();
|
||||||
|
|
||||||
|
// this order is important, connections need parsed objects to check
|
||||||
|
// whether connections are ok or not. Objects may not be evaluated yet,
|
||||||
|
// though, since this may require valid connections.
|
||||||
ReadObjects();
|
ReadObjects();
|
||||||
ReadConnections();
|
ReadConnections();
|
||||||
}
|
}
|
||||||
|
@ -506,8 +510,6 @@ void Document::ReadObjects()
|
||||||
}
|
}
|
||||||
|
|
||||||
objects[id] = new LazyObject(id, *el.second, *this);
|
objects[id] = new LazyObject(id, *el.second, *this);
|
||||||
// DEBUG - evaluate all objects
|
|
||||||
const Object* o = objects[id]->Get();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -392,7 +392,7 @@ public:
|
||||||
public:
|
public:
|
||||||
|
|
||||||
uint64_t insertionOrder;
|
uint64_t insertionOrder;
|
||||||
const std::string& prop;
|
const std::string prop;
|
||||||
|
|
||||||
uint64_t src, dest;
|
uint64_t src, dest;
|
||||||
const Document& doc;
|
const Document& doc;
|
||||||
|
|
Loading…
Reference in New Issue