|
|
@ -591,8 +591,6 @@ namespace MWRender
|
|
|
|
|
|
|
|
|
|
|
|
void Animation::loadAllAnimationsInFolder(const std::string &model, const std::string &baseModel)
|
|
|
|
void Animation::loadAllAnimationsInFolder(const std::string &model, const std::string &baseModel)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const std::map<std::string, VFS::File*>& index = mResourceSystem->getVFS()->getIndex();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string animationPath = model;
|
|
|
|
std::string animationPath = model;
|
|
|
|
if (animationPath.find("meshes") == 0)
|
|
|
|
if (animationPath.find("meshes") == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -602,20 +600,12 @@ namespace MWRender
|
|
|
|
|
|
|
|
|
|
|
|
mResourceSystem->getVFS()->normalizeFilename(animationPath);
|
|
|
|
mResourceSystem->getVFS()->normalizeFilename(animationPath);
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::string, VFS::File*>::const_iterator found = index.lower_bound(animationPath);
|
|
|
|
for (const auto& name : mResourceSystem->getVFS()->getRecursiveDirectoryIterator(animationPath))
|
|
|
|
while (found != index.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const std::string& name = found->first;
|
|
|
|
|
|
|
|
if (name.size() >= animationPath.size() && name.substr(0, animationPath.size()) == animationPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
size_t pos = name.find_last_of('.');
|
|
|
|
size_t pos = name.find_last_of('.');
|
|
|
|
if (pos != std::string::npos && name.compare(pos, name.size() - pos, ".kf") == 0)
|
|
|
|
if (pos != std::string::npos && name.compare(pos, name.size() - pos, ".kf") == 0)
|
|
|
|
addSingleAnimSource(name, baseModel);
|
|
|
|
addSingleAnimSource(name, baseModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
++found;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Animation::addAnimSource(const std::string &model, const std::string& baseModel)
|
|
|
|
void Animation::addAnimSource(const std::string &model, const std::string& baseModel)
|
|
|
@ -1295,8 +1285,6 @@ namespace MWRender
|
|
|
|
if (model.empty())
|
|
|
|
if (model.empty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
const std::map<std::string, VFS::File*>& index = resourceSystem->getVFS()->getIndex();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string animationPath = model;
|
|
|
|
std::string animationPath = model;
|
|
|
|
if (animationPath.find("meshes") == 0)
|
|
|
|
if (animationPath.find("meshes") == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1306,20 +1294,12 @@ namespace MWRender
|
|
|
|
|
|
|
|
|
|
|
|
resourceSystem->getVFS()->normalizeFilename(animationPath);
|
|
|
|
resourceSystem->getVFS()->normalizeFilename(animationPath);
|
|
|
|
|
|
|
|
|
|
|
|
std::map<std::string, VFS::File*>::const_iterator found = index.lower_bound(animationPath);
|
|
|
|
for (const auto& name : resourceSystem->getVFS()->getRecursiveDirectoryIterator(animationPath))
|
|
|
|
while (found != index.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
const std::string& name = found->first;
|
|
|
|
|
|
|
|
if (name.size() >= animationPath.size() && name.substr(0, animationPath.size()) == animationPath)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
size_t pos = name.find_last_of('.');
|
|
|
|
size_t pos = name.find_last_of('.');
|
|
|
|
if (pos != std::string::npos && name.compare(pos, name.size() - pos, ".nif") == 0)
|
|
|
|
if (pos != std::string::npos && name.compare(pos, name.size() - pos, ".nif") == 0)
|
|
|
|
loadBonesFromFile(node, name, resourceSystem);
|
|
|
|
loadBonesFromFile(node, name, resourceSystem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
++found;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> getModelInstance(Resource::ResourceSystem* resourceSystem, const std::string& model, bool baseonly, bool inject, const std::string& defaultSkeleton)
|
|
|
|
osg::ref_ptr<osg::Node> getModelInstance(Resource::ResourceSystem* resourceSystem, const std::string& model, bool baseonly, bool inject, const std::string& defaultSkeleton)
|
|
|
|