- [Core] Project restructure

This commit is contained in:
Razmoth
2023-10-03 01:39:59 +04:00
parent caaab48cc0
commit ebf626d10a
127 changed files with 156 additions and 228 deletions

View File

@@ -7,7 +7,7 @@
<AssemblyVersion>1.00.00</AssemblyVersion>
<FileVersion>1.00.00</FileVersion>
<Copyright>Copyright © Razmoth 2022; Copyright © Perfare 2018-2022</Copyright>
<BaseOutputPath>..\AssetStudioGUI\bin</BaseOutputPath>
<BaseOutputPath>..\AssetStudio.GUI\bin</BaseOutputPath>
</PropertyGroup>
<ItemGroup>
@@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AssetStudioUtility\AssetStudioUtility.csproj" />
<ProjectReference Include="..\AssetStudio.Utility\AssetStudio.Utility.csproj" />
<ProjectReference Include="..\AssetStudio\AssetStudio.csproj" />
</ItemGroup>
@@ -29,13 +29,13 @@
</ItemGroup>
<Target Name="CopyExtraFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudio.FBXNative\bin\Win32\$(Configuration)\AssetStudio.FBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudio.FBXNative\bin\x64\$(Configuration)\AssetStudio.FBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
</Target>
<Target Name="PublishExtraFiles" AfterTargets="Publish">
<Copy SourceFiles="$(TargetDir)x86\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x86\AssetStudio.FBXNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\AssetStudio.FBXNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
</Target>
</Project>

View File

@@ -1,6 +1,4 @@
using AssetStudio;
namespace AssetStudioCLI
namespace AssetStudio.CLI
{
public class AssetItem
{

View File

@@ -5,9 +5,8 @@ using System.CommandLine;
using System.CommandLine.Binding;
using System.CommandLine.Parsing;
using System.Text.RegularExpressions;
using AssetStudio;
namespace AssetStudioCLI
namespace AssetStudio.CLI
{
public static class CommandLine
{

View File

@@ -1,12 +1,11 @@
using AssetStudio;
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace AssetStudioCLI
namespace AssetStudio.CLI
{
internal static class Exporter
{

View File

@@ -3,11 +3,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using AssetStudio;
using AssetStudioCLI.Properties;
using static AssetStudioCLI.Studio;
using AssetStudio.CLI.Properties;
using static AssetStudio.CLI.Studio;
namespace AssetStudioCLI
namespace AssetStudio.CLI
{
public class Program
{

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,9 +1,8 @@
using System;
using AssetStudio;
using System.ComponentModel;
using System.Configuration;
namespace AssetStudioCLI.Properties {
namespace AssetStudio.CLI.Properties {
public static class AppSettings
{
public static string Get(string key)

View File

@@ -1,18 +1,15 @@
using AssetStudio;
using System;
using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using static AssetStudioCLI.Exporter;
using Object = AssetStudio.Object;
using static AssetStudio.CLI.Exporter;
using System.Globalization;
using System.Xml;
namespace AssetStudioCLI
namespace AssetStudio.CLI
{
[Flags]
public enum MapOpType

View File

@@ -67,12 +67,12 @@ BEGIN
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "FileDescription", "AssetStudioFBXNative"
VALUE "FileDescription", "AssetStudio.FBXNative"
VALUE "FileVersion", "1.0.0.1"
VALUE "InternalName", "AssetStudioFBXNative.dll"
VALUE "InternalName", "AssetStudio.FBXNative.dll"
VALUE "LegalCopyright", "Copyright (C) Perfare 2018-2020; Copyright (C) hozuki 2020"
VALUE "OriginalFilename", "AssetStudioFBXNative.dll"
VALUE "ProductName", "AssetStudioFBXNative"
VALUE "OriginalFilename", "AssetStudio.FBXNative.dll"
VALUE "ProductName", "AssetStudio.FBXNative"
VALUE "ProductVersion", "1.0.0.1"
END
END

View File

@@ -24,6 +24,7 @@
<ProjectGuid>{11ea25a3-ed68-40ee-a9d0-7fde3b583027}</ProjectGuid>
<RootNamespace>AssetStudioFBXNative</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>AssetStudio.FBXNative</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -191,7 +192,7 @@
<None Include="cpp.hint" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="AssetStudioFBXNative.rc" />
<ResourceCompile Include="AssetStudio.FBXNative.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -67,7 +67,7 @@
<None Include="cpp.hint" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="AssetStudioFBXNative.rc">
<ResourceCompile Include="AssetStudio.FBXNative.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>

View File

@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by AssetStudioFBXNative.rc
// Used by AssetStudio.FBXNative.rc
// <20><EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ĭ<EFBFBD><C4AC>ֵ
//

View File

@@ -2,11 +2,11 @@
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="AssetStudioGUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="AssetStudio.GUI.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<AssetStudioGUI.Properties.Settings>
<AssetStudio.GUI.Properties.Settings>
<setting name="displayAll" serializeAs="String">
<value>False</value>
</setting>
@@ -124,6 +124,6 @@
<setting name="enableVerbose" serializeAs="String">
<value>False</value>
</setting>
</AssetStudioGUI.Properties.Settings>
</AssetStudio.GUI.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -1,6 +1,6 @@
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class AssetBrowser
{

View File

@@ -7,12 +7,12 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using AssetStudio;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class AssetBrowser : Form
{
private readonly AssetStudioGUIForm _parent;
public AssetBrowser(AssetStudioGUIForm form)
private readonly MainForm _parent;
public AssetBrowser(MainForm form)
{
InitializeComponent();
_parent = form;

View File

@@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AssetStudioUtility\AssetStudioUtility.csproj" />
<ProjectReference Include="..\AssetStudio.Utility\AssetStudio.Utility.csproj" />
<ProjectReference Include="..\AssetStudio\AssetStudio.csproj" />
</ItemGroup>
@@ -35,13 +35,13 @@
</ItemGroup>
<ItemGroup>
<ContentWithTargetPath Include="Libraries\x86\AssetStudioFBXNative.dll">
<ContentWithTargetPath Include="Libraries\x86\AssetStudio.FBXNative.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>x86\AssetStudioFBXNative.dll</TargetPath>
<TargetPath>x86\AssetStudio.FBXNative.dll</TargetPath>
</ContentWithTargetPath>
<ContentWithTargetPath Include="Libraries\x64\AssetStudioFBXNative.dll">
<ContentWithTargetPath Include="Libraries\x64\AssetStudio.FBXNative.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>x64\AssetStudioFBXNative.dll</TargetPath>
<TargetPath>x64\AssetStudio.FBXNative.dll</TargetPath>
</ContentWithTargetPath>
</ItemGroup>
@@ -105,12 +105,12 @@
</ItemGroup>
<Target Name="CopyExtraFiles" AfterTargets="AfterBuild">
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudio.FBXNative\bin\Win32\$(Configuration)\AssetStudio.FBXNative.dll" DestinationFolder="$(TargetDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(SolutionDir)AssetStudio.FBXNative\bin\x64\$(Configuration)\AssetStudio.FBXNative.dll" DestinationFolder="$(TargetDir)x64" ContinueOnError="true" />
</Target>
<Target Name="PublishExtraFiles" AfterTargets="Publish">
<Copy SourceFiles="$(TargetDir)x86\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x86\AssetStudio.FBXNative.dll" DestinationFolder="$(PublishDir)x86" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)x64\AssetStudio.FBXNative.dll" DestinationFolder="$(PublishDir)x64" ContinueOnError="true" />
</Target>
</Project>

View File

@@ -1,7 +1,6 @@
using System.Windows.Forms;
using AssetStudio;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
public class AssetItem : ListViewItem
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
internal class GOHierarchy : TreeView
{

View File

@@ -1,7 +1,6 @@
using System.Windows.Forms;
using AssetStudio;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
public class GameObjectTreeNode : TreeNode
{

View File

@@ -3,7 +3,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
internal class OpenFolderDialog
{

View File

@@ -1,9 +1,8 @@
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using AssetStudio;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
internal class TypeTreeItem : ListViewItem
{

View File

@@ -3,7 +3,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
public sealed class DirectBitmap : IDisposable
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Linq;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class ExportOptions
{

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
public partial class ExportOptions : Form
{

View File

@@ -1,12 +1,11 @@
using AssetStudio;
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
internal static class Exporter
{

View File

@@ -1,8 +1,7 @@
using AssetStudio;
using System;
using System;
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
class GUILogger : ILogger
{

View File

@@ -1,8 +1,8 @@
using System;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class AssetStudioGUIForm
partial class MainForm
{
/// <summary>
/// Required designer variable.
@@ -31,7 +31,7 @@ namespace AssetStudioGUI
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssetStudioGUIForm));
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
menuStrip1 = new System.Windows.Forms.MenuStrip();
fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
loadFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -96,6 +96,7 @@ namespace AssetStudioGUI
toolStripMenuItem11 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem12 = new System.Windows.Forms.ToolStripMenuItem();
toolStripMenuItem13 = new System.Windows.Forms.ToolStripMenuItem();
sceneHierarchy = new System.Windows.Forms.ToolStripMenuItem();
filterTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
allToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
debugMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -171,7 +172,6 @@ namespace AssetStudioGUI
exportAnimatorwithselectedAnimationClipMenuItem = new System.Windows.Forms.ToolStripMenuItem();
goToSceneHierarchyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
sceneHierarchy = new System.Windows.Forms.ToolStripMenuItem();
menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
splitContainer1.Panel1.SuspendLayout();
@@ -587,21 +587,21 @@ namespace AssetStudioGUI
// toolStripMenuItem17
//
toolStripMenuItem17.Name = "toolStripMenuItem17";
toolStripMenuItem17.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem17.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem17.Text = "All assets";
toolStripMenuItem17.Click += toolStripMenuItem17_Click;
//
// toolStripMenuItem24
//
toolStripMenuItem24.Name = "toolStripMenuItem24";
toolStripMenuItem24.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem24.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem24.Text = "Selected assets";
toolStripMenuItem24.Click += toolStripMenuItem24_Click;
//
// toolStripMenuItem25
//
toolStripMenuItem25.Name = "toolStripMenuItem25";
toolStripMenuItem25.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem25.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem25.Text = "Filtered assets";
toolStripMenuItem25.Click += toolStripMenuItem25_Click;
//
@@ -620,24 +620,31 @@ namespace AssetStudioGUI
// toolStripMenuItem11
//
toolStripMenuItem11.Name = "toolStripMenuItem11";
toolStripMenuItem11.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem11.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem11.Text = "All assets";
toolStripMenuItem11.Click += toolStripMenuItem11_Click;
//
// toolStripMenuItem12
//
toolStripMenuItem12.Name = "toolStripMenuItem12";
toolStripMenuItem12.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem12.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem12.Text = "Selected assets";
toolStripMenuItem12.Click += toolStripMenuItem12_Click;
//
// toolStripMenuItem13
//
toolStripMenuItem13.Name = "toolStripMenuItem13";
toolStripMenuItem13.Size = new System.Drawing.Size(180, 22);
toolStripMenuItem13.Size = new System.Drawing.Size(152, 22);
toolStripMenuItem13.Text = "Filtered assets";
toolStripMenuItem13.Click += toolStripMenuItem13_Click;
//
// sceneHierarchy
//
sceneHierarchy.Name = "sceneHierarchy";
sceneHierarchy.Size = new System.Drawing.Size(266, 22);
sceneHierarchy.Text = "Scene hierarchy";
sceneHierarchy.Click += sceneHierarchy_Click;
//
// filterTypeToolStripMenuItem
//
filterTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { allToolStripMenuItem });
@@ -703,7 +710,7 @@ namespace AssetStudioGUI
enableFileLogging.CheckState = System.Windows.Forms.CheckState.Checked;
enableFileLogging.Name = "enableFileLogging";
enableFileLogging.Size = new System.Drawing.Size(191, 22);
enableFileLogging.Text = "Enable File Logging";
enableFileLogging.Text = "Enable file logging";
enableFileLogging.CheckedChanged += enableFileLogging_CheckedChanged;
//
// enableVerbose
@@ -1337,22 +1344,7 @@ namespace AssetStudioGUI
showOriginalFileToolStripMenuItem.Visible = false;
showOriginalFileToolStripMenuItem.Click += showOriginalFileToolStripMenuItem_Click;
//
// sceneHierarchy
//
sceneHierarchy.Name = "sceneHierarchy";
sceneHierarchy.Size = new System.Drawing.Size(266, 22);
sceneHierarchy.Text = "Scene hierarchy";
sceneHierarchy.Click += sceneHierarchy_Click;
//
// enableFileLogging
//
this.enableFileLogging.CheckOnClick = true;
this.enableFileLogging.Name = "enableFileLogging";
this.enableFileLogging.Size = new System.Drawing.Size(191, 22);
this.enableFileLogging.Text = "Enable file logging";
this.enableFileLogging.CheckedChanged += new System.EventHandler(this.enableFileLogging_CheckedChanged);
//
// AssetStudioGUIForm
// MainForm
//
AllowDrop = true;
ClientSize = new System.Drawing.Size(1264, 681);
@@ -1362,11 +1354,11 @@ namespace AssetStudioGUI
KeyPreview = true;
MainMenuStrip = menuStrip1;
MinimumSize = new System.Drawing.Size(620, 372);
Name = "AssetStudioGUIForm";
Name = "MainForm";
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
Text = "AssetStudioGUI";
DragDrop += AssetStudioGUIForm_DragDrop;
DragEnter += AssetStudioGUIForm_DragEnter;
Text = "AssetStudio.GUI";
DragDrop += MainForm_DragDrop;
DragEnter += MainForm_DragEnter;
KeyDown += AssetStudioForm_KeyDown;
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();

View File

@@ -1,4 +1,4 @@
using AssetStudio;

using Newtonsoft.Json;
using OpenTK.Graphics.OpenGL;
using System;
@@ -15,19 +15,15 @@ using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
using static AssetStudioGUI.Studio;
using Font = AssetStudio.Font;
using Vector3 = OpenTK.Mathematics.Vector3;
using Vector4 = OpenTK.Mathematics.Vector4;
using Matrix4 = OpenTK.Mathematics.Matrix4;
using static AssetStudio.GUI.Studio;
using OpenTK.Graphics;
using OpenTK.Mathematics;
using Newtonsoft.Json.Converters;
using System.Text.RegularExpressions;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class AssetStudioGUIForm : Form
partial class MainForm : Form
{
private AssetItem lastSelectedItem;
private AssetBrowser assetBrowser;
@@ -59,10 +55,10 @@ namespace AssetStudioGUI
private int uniformViewMatrix;
private int uniformProjMatrix;
private int vao;
private Vector3[] vertexData;
private Vector3[] normalData;
private Vector3[] normal2Data;
private Vector4[] colorData;
private OpenTK.Mathematics.Vector3[] vertexData;
private OpenTK.Mathematics.Vector3[] normalData;
private OpenTK.Mathematics.Vector3[] normal2Data;
private OpenTK.Mathematics.Vector4[] colorData;
private Matrix4 modelMatrixData;
private Matrix4 viewMatrixData;
private Matrix4 projMatrixData;
@@ -85,7 +81,7 @@ namespace AssetStudioGUI
private GUILogger logger;
public AssetStudioGUIForm()
public MainForm()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
InitializeComponent();
@@ -171,7 +167,7 @@ namespace AssetStudioGUI
}
}
}
private void AssetStudioGUIForm_DragEnter(object sender, DragEventArgs e)
private void MainForm_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
@@ -179,7 +175,7 @@ namespace AssetStudioGUI
}
}
private async void AssetStudioGUIForm_DragDrop(object sender, DragEventArgs e)
private async void MainForm_DragDrop(object sender, DragEventArgs e)
{
var paths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (paths.Length > 0)
@@ -1145,7 +1141,7 @@ namespace AssetStudioGUI
{
count = 4;
}
vertexData = new Vector3[m_Mesh.m_VertexCount];
vertexData = new OpenTK.Mathematics.Vector3[m_Mesh.m_VertexCount];
// Calculate Bounding
float[] min = new float[3];
float[] max = new float[3];
@@ -1161,14 +1157,15 @@ namespace AssetStudioGUI
min[i] = Math.Min(min[i], m_Mesh.m_Vertices[v * count + i]);
max[i] = Math.Max(max[i], m_Mesh.m_Vertices[v * count + i]);
}
vertexData[v] = new Vector3(
vertexData[v] = new OpenTK.Mathematics.Vector3(
m_Mesh.m_Vertices[v * count],
m_Mesh.m_Vertices[v * count + 1],
m_Mesh.m_Vertices[v * count + 2]);
}
// Calculate modelMatrix
Vector3 dist = Vector3.One, offset = Vector3.Zero;
var dist = OpenTK.Mathematics.Vector3.One;
var offset = OpenTK.Mathematics.Vector3.Zero;
for (int i = 0; i < 3; i++)
{
dist[i] = max[i] - min[i];
@@ -1193,10 +1190,10 @@ namespace AssetStudioGUI
count = 3;
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
count = 4;
normalData = new Vector3[m_Mesh.m_VertexCount];
normalData = new OpenTK.Mathematics.Vector3[m_Mesh.m_VertexCount];
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
{
normalData[n] = new Vector3(
normalData[n] = new OpenTK.Mathematics.Vector3(
m_Mesh.m_Normals[n * count],
m_Mesh.m_Normals[n * count + 1],
m_Mesh.m_Normals[n * count + 2]);
@@ -1205,18 +1202,18 @@ namespace AssetStudioGUI
else
normalData = null;
// calculate normal by ourself
normal2Data = new Vector3[m_Mesh.m_VertexCount];
normal2Data = new OpenTK.Mathematics.Vector3[m_Mesh.m_VertexCount];
int[] normalCalculatedCount = new int[m_Mesh.m_VertexCount];
for (int i = 0; i < m_Mesh.m_VertexCount; i++)
{
normal2Data[i] = Vector3.Zero;
normal2Data[i] = OpenTK.Mathematics.Vector3.Zero;
normalCalculatedCount[i] = 0;
}
for (int i = 0; i < m_Mesh.m_Indices.Count; i = i + 3)
{
Vector3 dir1 = vertexData[indiceData[i + 1]] - vertexData[indiceData[i]];
Vector3 dir2 = vertexData[indiceData[i + 2]] - vertexData[indiceData[i]];
Vector3 normal = Vector3.Cross(dir1, dir2);
var dir1 = vertexData[indiceData[i + 1]] - vertexData[indiceData[i]];
var dir2 = vertexData[indiceData[i + 2]] - vertexData[indiceData[i]];
var normal = OpenTK.Mathematics.Vector3.Cross(dir1, dir2);
normal.Normalize();
for (int j = 0; j < 3; j++)
{
@@ -1227,7 +1224,7 @@ namespace AssetStudioGUI
for (int i = 0; i < m_Mesh.m_VertexCount; i++)
{
if (normalCalculatedCount[i] == 0)
normal2Data[i] = new Vector3(0, 1, 0);
normal2Data[i] = new OpenTK.Mathematics.Vector3(0, 1, 0);
else
normal2Data[i] /= normalCalculatedCount[i];
}
@@ -1235,10 +1232,10 @@ namespace AssetStudioGUI
#region Colors
if (m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
{
colorData = new Vector4[m_Mesh.m_VertexCount];
colorData = new OpenTK.Mathematics.Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(
colorData[c] = new OpenTK.Mathematics.Vector4(
m_Mesh.m_Colors[c * 3],
m_Mesh.m_Colors[c * 3 + 1],
m_Mesh.m_Colors[c * 3 + 2],
@@ -1247,10 +1244,10 @@ namespace AssetStudioGUI
}
else if (m_Mesh.m_Colors != null && m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 4)
{
colorData = new Vector4[m_Mesh.m_VertexCount];
colorData = new OpenTK.Mathematics.Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(
colorData[c] = new OpenTK.Mathematics.Vector4(
m_Mesh.m_Colors[c * 4],
m_Mesh.m_Colors[c * 4 + 1],
m_Mesh.m_Colors[c * 4 + 2],
@@ -1259,10 +1256,10 @@ namespace AssetStudioGUI
}
else
{
colorData = new Vector4[m_Mesh.m_VertexCount];
colorData = new OpenTK.Mathematics.Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(0.5f, 0.5f, 0.5f, 1.0f);
colorData[c] = new OpenTK.Mathematics.Vector4(0.5f, 0.5f, 0.5f, 1.0f);
}
}
#endregion
@@ -1303,14 +1300,14 @@ namespace AssetStudioGUI
{
viewMatrixData = Matrix4.CreateRotationY(-(float)Math.PI / 4) * Matrix4.CreateRotationX(-(float)Math.PI / 6);
#region Vertices
vertexData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new Vector3(x.Vertex.X, x.Vertex.Y, x.Vertex.Z)).ToArray();
vertexData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new OpenTK.Mathematics.Vector3(x.Vertex.X, x.Vertex.Y, x.Vertex.Z)).ToArray();
// Calculate Bounding
Vector3 min = vertexData.Aggregate(Vector3.ComponentMin);
Vector3 max = vertexData.Aggregate(Vector3.ComponentMax);
var min = vertexData.Aggregate(OpenTK.Mathematics.Vector3.ComponentMin);
var max = vertexData.Aggregate(OpenTK.Mathematics.Vector3.ComponentMax);
// Calculate modelMatrix
Vector3 dist = max - min;
Vector3 offset = (max - min) / 2;
var dist = max - min;
var offset = (max - min) / 2;
float d = Math.Max(1e-5f, dist.Length);
modelMatrixData = Matrix4.CreateTranslation(-offset) * Matrix4.CreateScale(2f / d);
#endregion
@@ -1334,17 +1331,17 @@ namespace AssetStudioGUI
indiceData = indices.ToArray();
#endregion
#region Normals
normalData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new Vector3(x.Normal.X, x.Normal.Y, x.Normal.Z)).ToArray();
normalData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new OpenTK.Mathematics.Vector3(x.Normal.X, x.Normal.Y, x.Normal.Z)).ToArray();
// calculate normal by ourself
normal2Data = new Vector3[vertexData.Length];
normal2Data = new OpenTK.Mathematics.Vector3[vertexData.Length];
int[] normalCalculatedCount = new int[vertexData.Length];
Array.Fill(normal2Data, Vector3.Zero);
Array.Fill(normal2Data, OpenTK.Mathematics.Vector3.Zero);
Array.Fill(normalCalculatedCount, 0);
for (int j = 0; j < indiceData.Length; j += 3)
{
Vector3 dir1 = vertexData[indiceData[j + 1]] - vertexData[indiceData[j]];
Vector3 dir2 = vertexData[indiceData[j + 2]] - vertexData[indiceData[j]];
Vector3 normal = Vector3.Cross(dir1, dir2);
var dir1 = vertexData[indiceData[j + 1]] - vertexData[indiceData[j]];
var dir2 = vertexData[indiceData[j + 2]] - vertexData[indiceData[j]];
var normal = OpenTK.Mathematics.Vector3.Cross(dir1, dir2);
normal.Normalize();
for (int k = 0; k < 3; k++)
{
@@ -1355,13 +1352,13 @@ namespace AssetStudioGUI
for (int j = 0; j < vertexData.Length; j++)
{
if (normalCalculatedCount[j] == 0)
normal2Data[j] = new Vector3(0, 1, 0);
normal2Data[j] = new OpenTK.Mathematics.Vector3(0, 1, 0);
else
normal2Data[j] /= normalCalculatedCount[j];
}
#endregion
#region Colors
colorData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new Vector4(x.Color.R, x.Color.G, x.Color.B, x.Color.A)).ToArray();
colorData = model.MeshList.SelectMany(x => x.VertexList).Select(x => new OpenTK.Mathematics.Vector4(x.Color.R, x.Color.G, x.Color.B, x.Color.A)).ToArray();
#endregion
glControl.Visible = true;
CreateVAO();
@@ -2690,24 +2687,24 @@ namespace AssetStudioGUI
GL.DeleteShader(address);
}
private static void CreateVBO(out int vboAddress, Vector3[] data, int address)
private static void CreateVBO(out int vboAddress, OpenTK.Mathematics.Vector3[] data, int address)
{
GL.GenBuffers(1, out vboAddress);
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
GL.BufferData(BufferTarget.ArrayBuffer,
(IntPtr)(data.Length * Vector3.SizeInBytes),
(IntPtr)(data.Length * OpenTK.Mathematics.Vector3.SizeInBytes),
data,
BufferUsageHint.StaticDraw);
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
GL.EnableVertexAttribArray(address);
}
private static void CreateVBO(out int vboAddress, Vector4[] data, int address)
private static void CreateVBO(out int vboAddress, OpenTK.Mathematics.Vector4[] data, int address)
{
GL.GenBuffers(1, out vboAddress);
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
GL.BufferData(BufferTarget.ArrayBuffer,
(IntPtr)(data.Length * Vector4.SizeInBytes),
(IntPtr)(data.Length * OpenTK.Mathematics.Vector4.SizeInBytes),
data,
BufferUsageHint.StaticDraw);
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);

View File

@@ -120,9 +120,6 @@
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>312, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>432, 17</value>
</metadata>
<data name="fontPreviewBox.Text" xml:space="preserve">
<value>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWYZ
1234567890.:,;'\"(!?)+-*/=
@@ -141,6 +138,9 @@ The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>432, 17</value>
</metadata>
<metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>553, 17</value>
</metadata>

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
static class Program
{
@@ -17,7 +17,7 @@ namespace AssetStudioGUI
Application.SetHighDpiMode(HighDpiMode.SystemAware);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new AssetStudioGUIForm());
Application.Run(new MainForm());
}
}
}

View File

@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AssetStudioGUI.Properties {
namespace AssetStudio.GUI.Properties {
using System;
@@ -39,7 +39,7 @@ namespace AssetStudioGUI.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AssetStudioGUI.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AssetStudio.GUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;

View File

@@ -8,11 +8,11 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AssetStudioGUI.Properties {
namespace AssetStudio.GUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -371,6 +371,18 @@ namespace AssetStudioGUI.Properties {
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportUV0UV1 {
get {
return ((bool)(this["exportUV0UV1"]));
}
set {
this["exportUV0UV1"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
@@ -430,6 +442,7 @@ namespace AssetStudioGUI.Properties {
this["enableModelPreview"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
@@ -489,35 +502,5 @@ namespace AssetStudioGUI.Properties {
this["enableVerbose"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportUV0UV1
{
get
{
return ((bool)(this["exportUV0UV1"]));
}
set
{
this["exportUV0UV1"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool isFileLogging
{
get
{
return ((bool)(this["isFileLogging"]));
}
set
{
this["isFileLogging"] = value;
}
}
}
}

View File

@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="AssetStudioGUI.Properties" GeneratedClassName="Settings">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="AssetStudio.GUI.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="displayAll" Type="System.Boolean" Scope="User">

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,5 +1,4 @@
using AssetStudio;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
@@ -8,11 +7,9 @@ using System.Linq;
using System.Threading;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
using static AssetStudioGUI.Exporter;
using Object = AssetStudio.Object;
using static AssetStudio.GUI.Exporter;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
internal enum ExportType
{

View File

@@ -1,4 +1,4 @@
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
partial class UnityCNForm
{

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
using AssetStudio;
using System.Linq;
namespace AssetStudioGUI
namespace AssetStudio.GUI
{
public partial class UnityCNForm : Form
{

View File

@@ -19,7 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\AssetStudio.PInvoke\AssetStudio.PInvoke.csproj" />
<ProjectReference Include="..\AssetStudioFBXWrapper\AssetStudioFBXWrapper.csproj" />
<ProjectReference Include="..\AssetStudio.FBXWrapper\AssetStudio.FBXWrapper.csproj" />
<ProjectReference Include="..\AssetStudio\AssetStudio.csproj" />
</ItemGroup>

Some files were not shown because too many files have changed in this diff Show More