From 2e74c9f3ada5390d8acaf431c0177f557158f85e Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 6 May 2018 19:37:25 -0500 Subject: [PATCH] Remember that std::vector<>.size() needs to be offset by 1 if it's being used to find the last index. --- src/GUI/Plater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index 16a74a828..d94e51005 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -244,7 +244,7 @@ std::vector Plater::load_model_objects(ModelObjectPtrs model_objects) { tmpobj.identifier = (this->object_identifier)++; this->objects.push_back(tmpobj); - obj_idx.push_back(this->objects.size()); + obj_idx.push_back(this->objects.size() - 1); Slic3r::Log::info(LogChannel, LOG_WSTRING("Object array new size: " << this->objects.size())); Slic3r::Log::info(LogChannel, LOG_WSTRING("Instances: " << obj->instances.size()));