修改结构
This commit is contained in:
@@ -6,6 +6,7 @@ using Spine;
|
|||||||
using Spine.Exporters;
|
using Spine.Exporters;
|
||||||
using SpineViewer.Extensions;
|
using SpineViewer.Extensions;
|
||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels.Exporters
|
namespace SpineViewer.ViewModels.Exporters
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels.Exporters
|
namespace SpineViewer.ViewModels.Exporters
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using SpineViewer.Extensions;
|
|||||||
using SpineViewer.Models;
|
using SpineViewer.Models;
|
||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
using SpineViewer.Services;
|
using SpineViewer.Services;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using SpineViewer.Extensions;
|
|||||||
using SpineViewer.Models;
|
using SpineViewer.Models;
|
||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
using SpineViewer.Services;
|
using SpineViewer.Services;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using SpineViewer.Extensions;
|
|||||||
using SpineViewer.Models;
|
using SpineViewer.Models;
|
||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
using SpineViewer.Services;
|
using SpineViewer.Services;
|
||||||
using SpineViewer.ViewModels;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -22,7 +21,7 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shell;
|
using System.Windows.Shell;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels
|
namespace SpineViewer.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
public class ExplorerListViewModel : ObservableObject
|
public class ExplorerListViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
@@ -19,7 +19,7 @@ using System.Windows.Controls;
|
|||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using System.Windows.Shell;
|
using System.Windows.Shell;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels
|
namespace SpineViewer.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MainWindow 上下文对象
|
/// MainWindow 上下文对象
|
||||||
@@ -101,31 +101,8 @@ namespace SpineViewer.ViewModels
|
|||||||
private void Debug_Execute()
|
private void Debug_Execute()
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var path = @"C:\Users\ljh\Desktop\a.mp4";
|
|
||||||
|
|
||||||
using var exporter = new FFmpegVideoExporter(_sfmlRenderer.Resolution);
|
MessagePopupService.Quest("测试一下");
|
||||||
using var view = _sfmlRenderer.GetView();
|
|
||||||
exporter.Center = view.Center;
|
|
||||||
exporter.Size = view.Size;
|
|
||||||
exporter.Rotation = view.Rotation;
|
|
||||||
exporter.Viewport = view.Viewport;
|
|
||||||
|
|
||||||
SpineObject[] spines;
|
|
||||||
lock (_spineObjectModels.Lock)
|
|
||||||
{
|
|
||||||
spines = _spineObjectModels.Select(it => it.GetSpineObject(true)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
exporter.Fps = 60;
|
|
||||||
exporter.Format = FFmpegVideoExporter.VideoFormat.Webm;
|
|
||||||
exporter.Duration = 3;
|
|
||||||
exporter.BackgroundColor = new(0, 0, 0, 0);
|
|
||||||
ProgressService.RunAsync((pr, ct) =>
|
|
||||||
{
|
|
||||||
exporter.ProgressReporter = (total, done, text) =>
|
|
||||||
{ pr.Total = total; pr.Done = done; pr.ProgressText = text; };
|
|
||||||
exporter.Export(path, ct, spines);
|
|
||||||
}, "测试一下");
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ using System.Windows;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels
|
namespace SpineViewer.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
public class SFMLRendererViewModel : ObservableObject
|
public class SFMLRendererViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
@@ -17,7 +17,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Shell;
|
using System.Windows.Shell;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels
|
namespace SpineViewer.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
public class SpineObjectListViewModel : ObservableObject
|
public class SpineObjectListViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
@@ -9,7 +9,7 @@ using System.Collections.ObjectModel;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace SpineViewer.ViewModels
|
namespace SpineViewer.ViewModels.MainWindow
|
||||||
{
|
{
|
||||||
public class SpineObjectTabViewModel : ObservableObject
|
public class SpineObjectTabViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
@@ -611,7 +611,7 @@ namespace SpineViewer.ViewModels
|
|||||||
// 但是目前无法识别是否增加了轨道, 因此总是重建列表
|
// 但是目前无法识别是否增加了轨道, 因此总是重建列表
|
||||||
|
|
||||||
// 由于某些原因, 直接使用 Clear 会和 UI 逻辑冲突产生报错, 因此需要放到 Dispatcher 里延迟执行
|
// 由于某些原因, 直接使用 Clear 会和 UI 逻辑冲突产生报错, 因此需要放到 Dispatcher 里延迟执行
|
||||||
App.Current.Dispatcher.BeginInvoke(
|
Application.Current.Dispatcher.BeginInvoke(
|
||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
_animationTracks.Clear();
|
_animationTracks.Clear();
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:vm="clr-namespace:SpineViewer.ViewModels"
|
xmlns:vm="clr-namespace:SpineViewer.ViewModels.MainWindow"
|
||||||
xmlns:ext="clr-namespace:SpineViewer.Extensions"
|
xmlns:ext="clr-namespace:SpineViewer.Extensions"
|
||||||
xmlns:SFMLRenderer="clr-namespace:SFMLRenderer;assembly=SFMLRenderer"
|
xmlns:SFMLRenderer="clr-namespace:SFMLRenderer;assembly=SFMLRenderer"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using NLog.Targets;
|
|||||||
using Spine;
|
using Spine;
|
||||||
using SpineViewer.Natives;
|
using SpineViewer.Natives;
|
||||||
using SpineViewer.Resources;
|
using SpineViewer.Resources;
|
||||||
using SpineViewer.ViewModels;
|
using SpineViewer.ViewModels.MainWindow;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|||||||
Reference in New Issue
Block a user