3df loading working mostly
This commit is contained in:
parent
d191517b50
commit
fa28bca56f
10 changed files with 19 additions and 16 deletions
|
|
@ -998,7 +998,7 @@ namespace MatterHackers.MatterControl
|
|||
Object3D.AssetsPath = ApplicationDataStorage.Instance.LibraryAssetsPath;
|
||||
|
||||
this.Library = new LibraryConfig();
|
||||
this.Library.ContentProviders.Add(new[] { "stl", "obj", "amf", "mcx" }, new MeshContentProvider());
|
||||
this.Library.ContentProviders.Add(new[] { "stl", "obj", "3mf", "amf", "mcx" }, new MeshContentProvider());
|
||||
this.Library.ContentProviders.Add("gcode", new GCodeContentProvider());
|
||||
this.Library.ContentProviders.Add(new[] { "png", "gif", "jpg", "jpeg" }, new ImageContentProvider());
|
||||
this.Library.ContentProviders.Add(new[] { "scad" }, new OpenScadContentProvider());
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ namespace MatterHackers.MatterControl
|
|||
loadedItem = Object3D.Load(contentStream.Stream, Path.GetExtension(streamInterface.FileName), CancellationToken.None, null /*itemCache*/, progressReporter);
|
||||
|
||||
// Set MeshPath for non-mcx content. Avoid on mcx to ensure serialization of children
|
||||
if (item is FileSystemFileItem fileItem
|
||||
if (loadedItem != null
|
||||
&& item is FileSystemFileItem fileItem
|
||||
&& !string.Equals(Path.GetExtension(fileItem.FileName), ".mcx", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
loadedItem.MeshPath = fileItem.Path;
|
||||
|
|
|
|||
|
|
@ -215,8 +215,7 @@ namespace MatterHackers.MatterControl.Library.Export
|
|||
|
||||
var errors = new List<ValidationError>();
|
||||
|
||||
if (ApplicationSettings.ValidFileExtensions.IndexOf(sourceExtension, StringComparison.OrdinalIgnoreCase) >= 0
|
||||
|| string.Equals(sourceExtension, ".mcx", StringComparison.OrdinalIgnoreCase))
|
||||
if (ApplicationSettings.ValidFileExtensions.IndexOf(sourceExtension, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
if (CenterOnBed)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace MatterHackers.MatterControl.Library
|
|||
{
|
||||
string fileExtensionLower = Path.GetExtension(fileName).ToLower().Trim('.');
|
||||
return !string.IsNullOrEmpty(fileExtensionLower)
|
||||
&& ApplicationSettings.LibraryMeshFileExtensions.Contains(fileExtensionLower);
|
||||
&& ApplicationSettings.ValidFileExtensions.Contains(fileExtensionLower);
|
||||
}
|
||||
|
||||
public async Task LoadItemThumbnail(Action<ImageBuffer> thumbnailListener, Action<MeshContentProvider> buildThumbnail, ILibraryItem libraryItem, ILibraryContainer libraryContainer, int thumbWidth, int thumbHeight, ThemeConfig theme)
|
||||
|
|
|
|||
|
|
@ -589,13 +589,13 @@ namespace MatterHackers.MatterControl.PrintLibrary
|
|||
{
|
||||
Icon = StaticData.Instance.LoadIcon("cube.png", 16, 16).SetToColor(theme.TextColor),
|
||||
Title = "Add".Localize(),
|
||||
ToolTipText = "Add an.stl, .obj, .amf, .gcode or.zip file to the Library".Localize(),
|
||||
ToolTipText = "Add an.stl, .obj, .3mf, .amf, .gcode or.zip file to the Library".Localize(),
|
||||
Action = (selectedLibraryItems, listView) =>
|
||||
{
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
AggContext.FileDialogs.OpenFileDialog(
|
||||
new OpenFileDialogParams(ApplicationSettings.OpenPrintableFileParams, multiSelect: true),
|
||||
new OpenFileDialogParams(ApplicationSettings.OpenDesignFileParams, multiSelect: true),
|
||||
(openParams) =>
|
||||
{
|
||||
if (openParams.FileNames != null)
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@ namespace MatterHackers.MatterControl.PrintQueue
|
|||
case ".STL":
|
||||
return StlProcessing.GetEstimatedMemoryUse(fileLocation);
|
||||
|
||||
case ".3MF":
|
||||
case ".AMF":
|
||||
return AmfDocument.GetEstimatedMemoryUse(fileLocation);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,15 +47,11 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public class ApplicationSettings
|
||||
{
|
||||
public static string ValidFileExtensions { get; } = ".STL;.AMF;.OBJ";
|
||||
public static string ValidFileExtensions { get; } = ".stl,.obj,.3mf,.amf,.mcx";
|
||||
|
||||
public static string LibraryMeshFileExtensions { get; } = ".stl,.obj,.amf,.mcx";
|
||||
public static string LibraryFilterFileExtensions { get; } = ValidFileExtensions + ",.gcode";
|
||||
|
||||
public static string LibraryFilterFileExtensions { get; } = LibraryMeshFileExtensions + ",.gcode";
|
||||
|
||||
public static string OpenPrintableFileParams { get; } = "STL, AMF, OBJ, GCODE, MCX|*.stl;*.amf;*.obj;*.gcode;*.mcx";
|
||||
|
||||
public static string OpenDesignFileParams { get; } = "STL, AMF, OBJ, GCODE, MCX|*.stl;*.amf;*.obj;*.gcode;*.mcx";
|
||||
public static string OpenDesignFileParams { get; } = "STL, AMF, OBJ, 3MF, GCODE, MCX|*.stl;*.amf;*.obj;*.gcode;*.mcx";
|
||||
|
||||
private static ApplicationSettings globalInstance = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ namespace MatterHackers.MatterControl
|
|||
systemWindow.ShowAsSystemWindow();
|
||||
}
|
||||
|
||||
private static string[] shellFileExtensions = new string[] { ".stl", ".amf" };
|
||||
private static string[] shellFileExtensions = new string[] { ".stl", ".amf", ".3mf", ".obj" };
|
||||
|
||||
private static readonly object locker = new object();
|
||||
|
||||
|
|
|
|||
|
|
@ -973,6 +973,9 @@ Translated:Fit to Cylinder
|
|||
English:Flat
|
||||
Translated:Flat
|
||||
|
||||
English:Flattened
|
||||
Translated:Flattened
|
||||
|
||||
English:Force a retraction when moving between islands (distinct parts on the layer).
|
||||
Translated:Force a retraction when moving between islands (distinct parts on the layer).
|
||||
|
||||
|
|
@ -2575,6 +2578,9 @@ Translated:Sphere
|
|||
English:Spiral Vase
|
||||
Translated:Spiral Vase
|
||||
|
||||
English:Split
|
||||
Translated:Split
|
||||
|
||||
English:Split Mesh
|
||||
Translated:Split Mesh
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3ff85dfb5a47d603d123c185e4b6adb1e7dedabd
|
||||
Subproject commit a4ed28cd0824cc393a0af1bd1109541408a6a87a
|
||||
Loading…
Add table
Add a link
Reference in a new issue