Skip to content

Commit

Permalink
Merge pull request #7 from hrntsm/fix/no-mesh-input-restore
Browse files Browse the repository at this point in the history
Fix/no mesh input restore
  • Loading branch information
hrntsm authored Apr 17, 2022
2 parents 0879c2d + 7dc62b4 commit d87295e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Tunny/Tunny.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<Version>1.0</Version>
<Version>0.1.1</Version>
<Title>Tunny</Title>
<Description>Tunny is an optimization component wrapped in optuna.</Description>
<TargetExt>.gha</TargetExt>
Expand Down
6 changes: 5 additions & 1 deletion Tunny/UI/OptimizationWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void RestoreButton_Click(object sender, EventArgs e)
var modelMesh = new GH_Structure<GH_Mesh>();
var variables = new GH_Structure<GH_Number>();
var objectives = new GH_Structure<GH_Number>();
IEnumerable<string> 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;
Expand Down Expand Up @@ -164,6 +164,10 @@ private static void SetObjectives(GH_Structure<GH_Number> objectives, ModelResul

private static void SetModelMesh(GH_Structure<GH_Mesh> 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));
}
Expand Down

0 comments on commit d87295e

Please sign in to comment.