Add WIP version of the BLENDER importer. DO NOT USE FOR PRODUCTION YET!

Loads static meshes. Sometimes (it segfaults on the rest). No materials, cameras, fancy stuff. Works with all versions of blender. No compressed blend files yet.

- StreamReader now uses shared_ptr's to manage ownership of the stream.
- Adapt other loaders accordingly.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@717 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2010-05-10 10:22:24 +00:00
parent 1928dc7df7
commit 32bfa9ac21
26 changed files with 4663 additions and 296 deletions

View File

@@ -63,25 +63,6 @@ BaseImporter::~BaseImporter()
// nothing to do here
}
template <typename T>
struct tinyguard
{
tinyguard(T* obj) : obj(obj), mdismiss() {}
~tinyguard () throw() {if (!mdismiss) {delete obj;} obj = NULL;}
void dismiss() {
mdismiss=true;
}
operator T*() {
return obj;
}
private:
T* obj;
bool mdismiss;
};
// ------------------------------------------------------------------------------------------------
// Imports the given file and returns the imported data.
aiScene* BaseImporter::ReadFile( const std::string& pFile, IOSystem* pIOHandler)
@@ -90,7 +71,7 @@ aiScene* BaseImporter::ReadFile( const std::string& pFile, IOSystem* pIOHandler)
FileSystemFilter filter(pFile,pIOHandler);
// create a scene object to hold the data
tinyguard<aiScene> sc(new aiScene());
ScopeGuard<aiScene> sc(new aiScene());
// dispatch importing
try