From e154857aca29697cdad6ddf0813362afe53a6432 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Mon, 10 Jul 2023 09:27:43 +0500 Subject: [PATCH] Filter S3D plugins by name when running from build dir. Fixes https://gitlab.com/kicad/code/kicad/-/issues/12871 (cherry picked from commit 0781d8c1751dcfa52047a1b4a6da3afb41e2681d) --- 3d-viewer/3d_cache/3d_plugin_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/3d-viewer/3d_cache/3d_plugin_manager.cpp b/3d-viewer/3d_cache/3d_plugin_manager.cpp index 6c93439d8f..daa9324176 100644 --- a/3d-viewer/3d_cache/3d_plugin_manager.cpp +++ b/3d-viewer/3d_cache/3d_plugin_manager.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2015-2016 Cirilo Bernardo - * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -294,6 +294,13 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath, ++bl; } + // prevent loading non-plugin dlls + if( wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) ) + { + if( !path.GetName().StartsWith( "s3d_plugin" ) ) + return; + } + aPluginList.push_back( wxpath ); wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * [INFO] found 3D plugin '%s'\n" ), wxpath.GetData() );