From 1bb682180cead224f6dd2b6ca1f69682f3a7ef10 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 18 May 2015 12:24:18 -0700 Subject: [PATCH] workaround for segregateMeshGroups() crash --- libraries/render-utils/src/Model.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 080b63370a..c51ca9682a 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -2056,6 +2056,12 @@ void Model::segregateMeshGroups() { const FBXGeometry& geometry = _geometry->getFBXGeometry(); const QVector& networkMeshes = _geometry->getMeshes(); + // all of our mesh vectors must match in size + if (networkMeshes.size() != geometry.meshes.size() || + geometry.meshes.size() != _meshStates.size()) { + qDebug() << "WARNING!!!! Mesh Sizes don't match! We will not segregate mesh groups yet."; + return; + } // Run through all of the meshes, and place them into their segregated, but unsorted buckets for (int i = 0; i < networkMeshes.size(); i++) {