From 0c414b2cdf6495f47f544c643d2548c9daad6176 Mon Sep 17 00:00:00 2001 From: hrntsm Date: Sun, 17 Apr 2022 13:13:03 +0900 Subject: [PATCH 1/2] Fix no mesh input restore error to handle null string draco --- Tunny/UI/OptimizationWindow.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tunny/UI/OptimizationWindow.cs b/Tunny/UI/OptimizationWindow.cs index 704ae764..e75e526b 100644 --- a/Tunny/UI/OptimizationWindow.cs +++ b/Tunny/UI/OptimizationWindow.cs @@ -124,7 +124,7 @@ private void RestoreButton_Click(object sender, EventArgs e) var modelMesh = new GH_Structure(); var variables = new GH_Structure(); var objectives = new GH_Structure(); - IEnumerable nickName = _component.GhInOut.Sliders.Select(x => x.NickName); + var nickName = _component.GhInOut.Sliders.Select(x => x.NickName).ToArray(); var optuna = new Optuna(_component.GhInOut.ComponentFolder); string studyName = studyNameTextBox.Text; @@ -164,6 +164,10 @@ private static void SetObjectives(GH_Structure objectives, ModelResul private static void SetModelMesh(GH_Structure modelMesh, ModelResult model) { + if (model.Draco == string.Empty) + { + return; + } var mesh = (Mesh)DracoCompression.DecompressBase64String(model.Draco); modelMesh.Append(new GH_Mesh(mesh), new GH_Path(0, model.Number)); } From 7dc62b4e7c7b58d4298f816fe2603332b84b0f43 Mon Sep 17 00:00:00 2001 From: hrntsm Date: Sun, 17 Apr 2022 13:18:32 +0900 Subject: [PATCH 2/2] Update version info --- CHANGELOG.md | 8 ++++++++ Tunny/Tunny.csproj | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4b8bb23..d25d2f0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +Please see [here](https://github.com/hrntsm/Tunny/releases) for the data released for each version. + +## [0.1.1] -2022-04-17 + +### Fixed + +- If there is no modelmesh input and use restore function, gh is crashed bug. + ## [0.1.0] -2022-04-14 ### Added diff --git a/Tunny/Tunny.csproj b/Tunny/Tunny.csproj index 701360c7..33c5607e 100644 --- a/Tunny/Tunny.csproj +++ b/Tunny/Tunny.csproj @@ -2,7 +2,7 @@ net48 - 1.0 + 0.1.1 Tunny Tunny is an optimization component wrapped in optuna. .gha