void deleteArchive(XSI::CString path) { std::map<std::string,Alembic::Abc::IArchive *>::iterator it; it = gArchives.find(path.GetAsciiString()); if(it == gArchives.end()) return; delete(it->second); gArchives.erase(it); }
Alembic::Abc::IObject getObjectFromArchive(XSI::CString path, XSI::CString identifier) { Alembic::Abc::IArchive * archive = getArchiveFromID(path); if(archive == NULL) return Alembic::Abc::IObject(); // split the path std::string stdIdentifier(identifier.GetAsciiString()); std::vector<std::string> parts; boost::split(parts, stdIdentifier, boost::is_any_of("/")); // recurse to find it Alembic::Abc::IObject obj = archive->getTop(); for(size_t i=1;i<parts.size();i++) { Alembic::Abc::IObject child(obj,parts[i]); obj = child; } return obj; }