diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp index a41c727f67..6da8545826 100644 --- a/3d-viewer/3d_cache/3d_cache.cpp +++ b/3d-viewer/3d_cache/3d_cache.cpp @@ -47,6 +47,7 @@ #include "sg/scenegraph.h" #include "plugins/3dapi/ifsg_api.h" +#include #include // For ExpandEnvVarSubstitutions #include #include @@ -345,12 +346,13 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY** wxString bname = ep->GetCacheBaseName(); wxString cachename = m_CacheDir + bname + wxT( ".3dc" ); - if( wxFileName::FileExists( cachename ) && loadCacheData( ep ) ) + if( !ADVANCED_CFG::GetCfg().m_Skip3DFileCache && wxFileName::FileExists( cachename ) + && loadCacheData( ep ) ) return ep->sceneData; ep->sceneData = m_Plugins->Load3DModel( aFileName, ep->pluginInfo ); - if( nullptr != ep->sceneData ) + if( !ADVANCED_CFG::GetCfg().m_Skip3DFileCache && nullptr != ep->sceneData ) saveCacheData( ep ); return ep->sceneData; diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 89abd58710..43e388fa27 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -162,6 +162,8 @@ static const wxChar DrawBoundingBoxes[] = wxT( "DrawBoundingBoxes" ); static const wxChar ShowPcbnewExportNetlist[] = wxT( "ShowPcbnewExportNetlist" ); +static const wxChar Skip3DFileCache[] = wxT( "Skip3DFileCache" ); + } // namespace KEYS @@ -264,6 +266,7 @@ ADVANCED_CFG::ADVANCED_CFG() m_HotkeysDumper = false; m_DrawBoundingBoxes = false; m_ShowPcbnewExportNetlist = false; + m_Skip3DFileCache = false; loadFromConfigFile(); } @@ -364,6 +367,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist, &m_ShowPcbnewExportNetlist, false ) ); + configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DFileCache, + &m_Skip3DFileCache, false ) ); + wxConfigLoadSetups( &aCfg, configParams ); dumpCfg( configParams ); diff --git a/include/advanced_config.h b/include/advanced_config.h index 75bee67654..267dd8dc2c 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -170,6 +170,11 @@ public: */ bool m_ShowPcbnewExportNetlist; + /** + * Skip reading/writing 3d model file caches + */ + bool m_Skip3DFileCache; + private: ADVANCED_CFG();