-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathHelixViewerPanel.xaml.cs
More file actions
35 lines (25 loc) · 835 Bytes
/
Copy pathHelixViewerPanel.xaml.cs
File metadata and controls
35 lines (25 loc) · 835 Bytes
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
using HelixToolkit.Wpf;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Media3D;
namespace QuickLook.Plugin.HelixViewer
{
public partial class HelixViewerPanel : UserControl
{
public HelixViewerPanel(string path)
{
InitializeComponent();
var MLoader = new ModelImporter();
var M = MLoader.Load(path);
PreviewModel.Content = M;
GeometryModel3D model = M.Children[0] as GeometryModel3D;
DiffuseMaterial material = new DiffuseMaterial(new SolidColorBrush(Color.FromRgb(160,160,160)));
foreach(GeometryModel3D child in M.Children)
{
child.Material = material;
child.BackMaterial = material;
}
}
}
}