-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPickBlenderVersion.cs
More file actions
78 lines (65 loc) · 2.2 KB
/
PickBlenderVersion.cs
File metadata and controls
78 lines (65 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SharpOcarina
{
public partial class PickBlenderVersion : Form
{
public List<Byte> Data;
public string path = "";
public PickBlenderVersion()
{
InitializeComponent();
Init();
}
public void Init()
{
string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string blenderBasePath = System.IO.Path.Combine(appData, "Blender Foundation", "Blender");
List<string> versions = new List<string>();
if (Directory.Exists(blenderBasePath))
{
foreach (string dir in Directory.GetDirectories(blenderBasePath))
{
versions.Add(Path.GetFileName(dir));
}
}
if (versions.Count == 0)
{
MessageBox.Show("No 3.0+ blender installations found in your appdata folder", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
SongItem item = new SongItem();
item.Text = "Select a version";
item.Value = "";
BlenderVersionComboBox.Items.Add(item);
BlenderVersionComboBox.SelectedIndex = 0;
foreach (string v in versions)
{
item = new SongItem();
item.Text = v;
item.Value = blenderBasePath + "/" + v;
BlenderVersionComboBox.Items.Add(item);
}
}
private void Ok_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
private void SceneSettingComboBox_SelectionChangeCommitted(object sender, EventArgs e)
{
path = Convert.ToString(((SongItem)BlenderVersionComboBox.SelectedItem).Value);
}
private void PickBlenderVersion_FormClosed(object sender, FormClosedEventArgs e)
{
//path = "";
}
}
}