@ -658,16 +658,24 @@ namespace MWRender
return mKeyframes - > mTextKeys ;
return mKeyframes - > mTextKeys ;
}
}
void Animation : : loadA llAnimationsInFolder( const std : : string & model , const std : : string & baseModel )
void Animation : : loadA dditionalAnimations( VFS : : Path : : NormalizedView model , const std : : string & baseModel )
{
{
std : : string animationPath = model ;
constexpr VFS : : Path : : NormalizedView meshes ( " meshes/ " ) ;
if ( animationPath . find ( " meshes " ) = = 0 )
if ( ! model . value ( ) . starts_with ( meshes . value ( ) ) )
{
return ;
animationPath . replace ( 0 , 6 , " animations " ) ;
}
std : : string path ( model . value ( ) ) ;
animationPath . replace ( animationPath . size ( ) - 3 , 3 , " / " ) ;
constexpr VFS : : Path : : NormalizedView animations ( " animations/ " ) ;
path . replace ( 0 , meshes . value ( ) . size ( ) , animations . value ( ) ) ;
const std : : string : : size_type extensionStart = path . find_last_of ( VFS : : Path : : extensionSeparator ) ;
if ( extensionStart = = std : : string : : npos )
return ;
path . replace ( extensionStart , path . size ( ) - extensionStart , " / " ) ;
for ( const auto & name : mResourceSystem - > getVFS ( ) - > getRecursiveDirectoryIterator ( animationPath ) )
for ( const VFS : : Path : : Normalized & name : mResourceSystem - > getVFS ( ) - > getRecursiveDirectoryIterator ( p ath) )
{
{
if ( Misc : : getFileExtension ( name ) = = " kf " )
if ( Misc : : getFileExtension ( name ) = = " kf " )
{
{
@ -686,7 +694,7 @@ namespace MWRender
addSingleAnimSource ( kfname , baseModel ) ;
addSingleAnimSource ( kfname , baseModel ) ;
if ( Settings : : game ( ) . mUseAdditionalAnimSources )
if ( Settings : : game ( ) . mUseAdditionalAnimSources )
loadA llAnimationsInFolder ( kfname , baseModel ) ;
loadA dditionalAnimations ( kfname , baseModel ) ;
}
}
std : : shared_ptr < Animation : : AnimSource > Animation : : addSingleAnimSource (
std : : shared_ptr < Animation : : AnimSource > Animation : : addSingleAnimSource (