mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:07:42 +00:00
Attachment model support in blender addon
This commit is contained in:
@@ -77,7 +77,7 @@ void ProjectPath::assign(Database::Project& project, SystemStringView path)
|
||||
m_absPath = SystemString(project.getProjectRootPath().getAbsolutePath()) + _S('/') + m_relPath;
|
||||
SanitizePath(m_relPath);
|
||||
SanitizePath(m_absPath);
|
||||
|
||||
|
||||
ComputeHash();
|
||||
}
|
||||
|
||||
@@ -119,6 +119,38 @@ void ProjectPath::assign(const ProjectPath& parentPath, std::string_view path)
|
||||
}
|
||||
#endif
|
||||
|
||||
ProjectPath ProjectPath::getWithExtension(const SystemChar* ext, bool replace) const
|
||||
{
|
||||
ProjectPath pp(*this);
|
||||
if (replace)
|
||||
{
|
||||
auto relIt = pp.m_relPath.end();
|
||||
if (relIt != pp.m_relPath.begin())
|
||||
--relIt;
|
||||
auto absIt = pp.m_absPath.end();
|
||||
if (absIt != pp.m_absPath.begin())
|
||||
--absIt;
|
||||
while (relIt != pp.m_relPath.begin() && *relIt != _S('.') && *relIt != _S('/'))
|
||||
{
|
||||
--relIt;
|
||||
--absIt;
|
||||
}
|
||||
if (*relIt == _S('.') && relIt != pp.m_relPath.begin())
|
||||
{
|
||||
pp.m_relPath.resize(relIt - pp.m_relPath.begin());
|
||||
pp.m_absPath.resize(absIt - pp.m_absPath.begin());
|
||||
}
|
||||
}
|
||||
if (ext)
|
||||
{
|
||||
pp.m_relPath += ext;
|
||||
pp.m_absPath += ext;
|
||||
}
|
||||
|
||||
pp.ComputeHash();
|
||||
return pp;
|
||||
}
|
||||
|
||||
ProjectPath ProjectPath::getCookedPath(const Database::DataSpecEntry& spec) const
|
||||
{
|
||||
ProjectPath woExt = getWithExtension(nullptr, true);
|
||||
|
||||
Reference in New Issue
Block a user