- fbx: create dummy root node and assign converted meshes. This is a temporary solution to be able to test mesh reading.

pull/14/head
Alexander Gessler 2012-06-28 23:44:23 +02:00
parent 524285c90d
commit 7a3e3b1353
3 changed files with 25 additions and 3 deletions

View File

@ -64,7 +64,29 @@ public:
: out(out)
, doc(doc)
{
ConvertRootNode();
//ConvertRootNode();
// hack to process all meshes
BOOST_FOREACH(const ObjectMap::value_type& v,doc.Objects()) {
const Object* ob = v.second->Get();
if(!ob) {
continue;
}
const MeshGeometry* geo = dynamic_cast<const MeshGeometry*>(ob);
if(geo) {
ConvertMesh(*geo);
}
}
// dummy root node
out->mRootNode = new aiNode();
out->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes.size());
out->mRootNode->mMeshes = new unsigned int[meshes.size()];
for(unsigned int i = 0; i < out->mRootNode->mNumMeshes; ++i) {
out->mRootNode->mMeshes[i] = i;
}
TransferDataToScene();
}

View File

@ -352,7 +352,7 @@ const Object* LazyObject::Get()
if (!strncmp(obtype,"Geometry",static_cast<size_t>(key.end()-key.begin()))) {
if (!strcmp(classtag.c_str(),"Mesh")) {
object = new MeshGeometry(element,name,settings);
object.reset(new MeshGeometry(element,name,settings));
}
}

View File

@ -91,7 +91,7 @@ class Object
public:
Object(const Element& element, const std::string& name);
~Object();
virtual ~Object();
public: