Browse Source

Fixed animation render output and filter names

Krzysztof Krysiński 3 months ago
parent
commit
42c5fc1d6f

+ 4 - 1
src/PixiEditor/Data/Localization/Languages/en.json

@@ -597,6 +597,9 @@
   "BMP_FILE": "BMP Images",
   "BMP_FILE": "BMP Images",
   "IMAGE_FILES": "Image Files",
   "IMAGE_FILES": "Image Files",
   "VIDEO_FILES": "Video Files",
   "VIDEO_FILES": "Video Files",
+  "OPEN_TYPE_FONT": "OpenType Fonts",
+  "TRUE_TYPE_FONT": "TrueType Fonts",
+  "SVG_FILE": "Scalable Vector Graphics",
   "MP4_FILE": "MP4 Videos",
   "MP4_FILE": "MP4 Videos",
   "COLUMNS": "Columns",
   "COLUMNS": "Columns",
   "ROWS": "Rows",
   "ROWS": "Rows",
@@ -1042,5 +1045,5 @@
   "EXPORT_ZONE_NODE": "Export Zone",
   "EXPORT_ZONE_NODE": "Export Zone",
   "IS_DEFAULT_EXPORT": "Is Default Export",
   "IS_DEFAULT_EXPORT": "Is Default Export",
   "EXPORT_OUTPUT": "Export Output",
   "EXPORT_OUTPUT": "Export Output",
-  "EXPORT_SIZE": "Export Size"
+  "EXPORT_SIZE": "Export Size",
 }
 }

+ 1 - 1
src/PixiEditor/Models/Files/Mp4FileType.cs

@@ -5,5 +5,5 @@ namespace PixiEditor.Models.Files;
 internal class Mp4FileType : VideoFileType
 internal class Mp4FileType : VideoFileType
 {
 {
     public override string[] Extensions { get; } = { ".mp4" };
     public override string[] Extensions { get; } = { ".mp4" };
-    public override string DisplayName { get; } = new LocalizedString("MP4_FILE");
+    public override string DisplayName => new LocalizedString("MP4_FILE");
 }
 }

+ 3 - 2
src/PixiEditor/Models/Files/OtfFileType.cs

@@ -1,4 +1,5 @@
-using PixiEditor.Models.IO;
+using PixiEditor.Extensions.Common.Localization;
+using PixiEditor.Models.IO;
 using PixiEditor.ViewModels.Document;
 using PixiEditor.ViewModels.Document;
 
 
 namespace PixiEditor.Models.Files;
 namespace PixiEditor.Models.Files;
@@ -6,7 +7,7 @@ namespace PixiEditor.Models.Files;
 internal class OtfFileType : IoFileType
 internal class OtfFileType : IoFileType
 {
 {
     public override string[] Extensions { get; } = new[] { ".otf" };
     public override string[] Extensions { get; } = new[] { ".otf" };
-    public override string DisplayName { get; } = "OpenType Font";
+    public override string DisplayName => new LocalizedString("OPEN_TYPE_FONT");
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
 
 
     public override bool CanSave => false;
     public override bool CanSave => false;

+ 2 - 1
src/PixiEditor/Models/Files/SvgFileType.cs

@@ -3,6 +3,7 @@ using PixiEditor.ChangeableDocument.Rendering;
 using PixiEditor.Models.Handlers;
 using PixiEditor.Models.Handlers;
 using PixiEditor.Models.IO;
 using PixiEditor.Models.IO;
 using Drawie.Numerics;
 using Drawie.Numerics;
+using PixiEditor.Extensions.Common.Localization;
 using PixiEditor.SVG;
 using PixiEditor.SVG;
 using PixiEditor.SVG.Elements;
 using PixiEditor.SVG.Elements;
 using PixiEditor.SVG.Features;
 using PixiEditor.SVG.Features;
@@ -14,7 +15,7 @@ namespace PixiEditor.Models.Files;
 internal class SvgFileType : IoFileType
 internal class SvgFileType : IoFileType
 {
 {
     public override string[] Extensions { get; } = new[] { ".svg" };
     public override string[] Extensions { get; } = new[] { ".svg" };
-    public override string DisplayName { get; } = "Scalable Vector Graphics";
+    public override string DisplayName => new LocalizedString("SVG_FILE");
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
     public override SolidColorBrush EditorColor { get; } = new SolidColorBrush(Color.FromRgb(0, 128, 0));
     public override SolidColorBrush EditorColor { get; } = new SolidColorBrush(Color.FromRgb(0, 128, 0));
 
 

+ 3 - 2
src/PixiEditor/Models/Files/TtfFileType.cs

@@ -1,4 +1,5 @@
-using PixiEditor.Models.IO;
+using PixiEditor.Extensions.Common.Localization;
+using PixiEditor.Models.IO;
 using PixiEditor.ViewModels.Document;
 using PixiEditor.ViewModels.Document;
 
 
 namespace PixiEditor.Models.Files;
 namespace PixiEditor.Models.Files;
@@ -6,7 +7,7 @@ namespace PixiEditor.Models.Files;
 internal class TtfFileType : IoFileType
 internal class TtfFileType : IoFileType
 {
 {
     public override string[] Extensions { get; } = new[] { ".ttf" };
     public override string[] Extensions { get; } = new[] { ".ttf" };
-    public override string DisplayName { get; } = "TrueType Font";
+    public override string DisplayName => new LocalizedString("TRUE_TYPE_FONT");
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
     public override FileTypeDialogDataSet.SetKind SetKind { get; } = FileTypeDialogDataSet.SetKind.Vector;
 
 
     public override bool CanSave => false;
     public override bool CanSave => false;

+ 2 - 2
src/PixiEditor/Models/Files/VideoFileType.cs

@@ -35,7 +35,7 @@ internal abstract class VideoFileType : IoFileType
             }
             }
 
 
             return surface;
             return surface;
-        });
+        }, config.ExportOutput);
 
 
         job?.Report(0.5, new LocalizedString("RENDERING_VIDEO"));
         job?.Report(0.5, new LocalizedString("RENDERING_VIDEO"));
         CancellationToken token = job?.CancellationTokenSource.Token ?? CancellationToken.None;
         CancellationToken token = job?.CancellationTokenSource.Token ?? CancellationToken.None;
@@ -79,7 +79,7 @@ internal abstract class VideoFileType : IoFileType
             }
             }
 
 
             return surface;
             return surface;
-        });
+        }, config.ExportOutput);
 
 
         job?.Report(0.5, new LocalizedString("RENDERING_VIDEO"));
         job?.Report(0.5, new LocalizedString("RENDERING_VIDEO"));
         CancellationToken token = job?.CancellationTokenSource.Token ?? CancellationToken.None;
         CancellationToken token = job?.CancellationTokenSource.Token ?? CancellationToken.None;

+ 1 - 1
src/PixiEditor/Models/Files/WebpFileType.cs

@@ -8,7 +8,7 @@ internal class WebpFileType : ImageFileType
 {
 {
     public override string[] Extensions { get; } = [".webp"];
     public override string[] Extensions { get; } = [".webp"];
 
 
-    public override string DisplayName { get; } = new LocalizedString("WEBP_FILE");
+    public override string DisplayName => new LocalizedString("WEBP_FILE");
 
 
     public override EncodedImageFormat EncodedImageFormat { get; } = EncodedImageFormat.Webp;
     public override EncodedImageFormat EncodedImageFormat { get; } = EncodedImageFormat.Webp;
 
 

+ 2 - 2
src/PixiEditor/ViewModels/Document/DocumentViewModel.cs

@@ -1253,7 +1253,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
         }
         }
     }
     }
 
 
-    public bool RenderFrames(List<Image> frames, Func<Surface, Surface> processFrameAction = null)
+    public bool RenderFrames(List<Image> frames, Func<Surface, Surface> processFrameAction = null, string? renderOutput = null)
     {
     {
         var firstFrame = AnimationDataViewModel.GetFirstVisibleFrame();
         var firstFrame = AnimationDataViewModel.GetFirstVisibleFrame();
         var lastFrame = AnimationDataViewModel.GetLastVisibleFrame();
         var lastFrame = AnimationDataViewModel.GetLastVisibleFrame();
@@ -1261,7 +1261,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
         for (int i = firstFrame; i < lastFrame; i++)
         for (int i = firstFrame; i < lastFrame; i++)
         {
         {
             KeyFrameTime frameTime = new KeyFrameTime(i, (double)(i - firstFrame) / (lastFrame - firstFrame));
             KeyFrameTime frameTime = new KeyFrameTime(i, (double)(i - firstFrame) / (lastFrame - firstFrame));
-            var surface = TryRenderWholeImage(frameTime);
+            var surface = TryRenderWholeImage(frameTime, renderOutput);
             if (surface.IsT0)
             if (surface.IsT0)
             {
             {
                 return false;
                 return false;