-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathSceneConfiguration.cs
37 lines (34 loc) · 1.32 KB
/
SceneConfiguration.cs
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
using Bonsai.Resources;
using System.ComponentModel;
namespace Bonsai.Shaders.Rendering
{
/// <summary>
/// Provides configuration information for scene resources.
/// </summary>
public class SceneConfiguration
{
/// <summary>
/// Gets or sets the name of the scene.
/// </summary>
[Description("The name of the scene.")]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name of the file from which to load the scene.
/// </summary>
[TypeConverter(typeof(ResourceFileNameConverter))]
[Editor(DesignTypes.OpenFileNameEditor, DesignTypes.UITypeEditor)]
[FileNameFilter("COLLADA Files (*.dae)|*.dae|Blender Files (*.blend)|*.blend|FBX Files (*.fbx)|*.fbx|OBJ Files (*.obj)|*.obj|STL Files (*.stl)|*.stl|All Files|*.*")]
[Description("The name of the file from which to load the scene.")]
public string FileName { get; set; }
/// <inheritdoc/>
public override string ToString()
{
var name = Name;
var fileName = FileName;
var typeName = GetType().Name;
if (string.IsNullOrEmpty(name)) return typeName;
else if (string.IsNullOrEmpty(fileName)) return name;
else return $"{name} [{fileName}]";
}
}
}