From 67c236647d6f285b0c34163694c94776c8439fb5 Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Wed, 29 Nov 2017 11:20:09 -0500 Subject: [PATCH 1/2] Restore import of multi mesh binary STLs Regression introduced in: 9a9f18bbed8938323548335d9225e480a0ea8ca6 This restores the behaviour for binary STLs with multiple bodies. The code could be improved (to reuse code found at the end of LoadASCIIFile) but for now this is a quick fix --- code/STLLoader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index ab2dcf36e..96a81c22f 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -505,6 +505,12 @@ bool STLImporter::LoadBinaryFile() // now copy faces addFacesToMesh(pMesh); + // add all created meshes to the single node + pScene->mRootNode->mNumMeshes = pScene->mNumMeshes; + pScene->mRootNode->mMeshes = new unsigned int[pScene->mNumMeshes]; + for (unsigned int i = 0; i < pScene->mNumMeshes; i++) + pScene->mRootNode->mMeshes[i] = i; + if (bIsMaterialise && !pMesh->mColors[0]) { // use the color as diffuse material color From 5822d1920e83b08be6cf774e08affe5da967f880 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 30 Nov 2017 09:22:55 +0100 Subject: [PATCH 2/2] Update STLLoader.cpp Retrigger travis + appveyor. --- code/STLLoader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/STLLoader.cpp b/code/STLLoader.cpp index 96a81c22f..be4c7584d 100644 --- a/code/STLLoader.cpp +++ b/code/STLLoader.cpp @@ -58,6 +58,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; namespace { + static const aiImporterDesc desc = { "Stereolithography (STL) Importer", "",