Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df3e5b31cd | ||
|
|
a04c0d0223 | ||
|
|
d1ec1c29a4 | ||
|
|
a928660dd3 | ||
|
|
e37a04e05b | ||
|
|
2c721272dd | ||
|
|
6f3b438d92 | ||
|
|
f8e7303169 | ||
|
|
bd18bfb8ea | ||
|
|
86843f81da | ||
|
|
60cc81b2dd | ||
|
|
cfbcdecfe6 | ||
|
|
45b9b781b1 | ||
|
|
29068481f5 | ||
|
|
384dd2e4e3 | ||
|
|
b4bce77381 |
10
README.md
10
README.md
@@ -1,6 +1,7 @@
|
||||
**Unity Studio** is a tool for exploring, extracting and exporting assets from Unity games and apps.
|
||||
# UnityStudio
|
||||
Latest build: [](https://ci.appveyor.com/project/Perfare/unitystudio/branch/master/artifacts)
|
||||
|
||||
It is the continuation of my Unity Importer script for 3ds Max, and comprises all my research and reverse engineering of Unity file formats. It has been thoroughly tested with Unity builds from most platforms, ranging from Web, PC, Linux, MacOS to Xbox360, PS3, Android and iOS, and it is currently maintained to be compatible with Unity builds from 2.5.0 up to the 5.5.1f1 version.
|
||||
Unity Studio is a tool for exploring, extracting and exporting assets from Unity games and apps. It has been tested with Unity builds from most platforms, ranging from Web, PC, Linux, MacOS to Xbox360, PS3, Android and iOS, and it is currently maintained to be compatible with Unity builds from 2.5 up to the 5.6 version.
|
||||
|
||||
## Current features
|
||||
|
||||
@@ -9,14 +10,15 @@ It is the continuation of my Unity Importer script for 3ds Max, and comprises al
|
||||
* DDS (Alpha8, ARGB4444, RGB24, RGBA32, ARGB32, RGB565, R16, DXT1, DXT5, RGBA4444, BGRA32)
|
||||
* PVR (YUY2, PVRTC_RGB2, PVRTC_RGBA2, PVRTC_RGB4, PVRTC_RGBA4, ETC_RGB4, ETC2_RGB, ETC2_RGBA1, ETC2_RGBA8, ASTC_RGB_4x4, ASTC_RGB_5x5, ASTC_RGB_6x6, ASTC_RGB_8x8, ASTC_RGB_10x10, ASTC_RGB_12x12, ASTC_RGBA_4x4, ASTC_RGBA_5x5, ASTC_RGBA_6x6, ASTC_RGBA_8x8, ASTC_RGBA_10x10, ASTC_RGBA_12x12, ETC_RGB4_3DS, ETC_RGBA8_3DS)
|
||||
* KTX (RHalf, RGHalf, RGBAHalf, RFloat, RGFloat, RGBAFloat, BC4, BC5, BC6H, BC7, ATC_RGB4, ATC_RGBA8, EAC_R, EAC_R_SIGNED, EAC_RG, EAC_RG_SIGNED)
|
||||
* **AudioClip**: fsb, mp3, ogg, wav, m4a, xbox wav (including streams from resource files)
|
||||
* **AudioClip**: fsb, mp3, ogg, wav, m4a, xbox wav
|
||||
* **Font**: ttf, otf
|
||||
* **Mesh**: obj
|
||||
* **TextAsset**
|
||||
* **Shader**
|
||||
* **MonoBehaviour**
|
||||
* Support convert all textures to bmp, png or jpeg
|
||||
* Support convert FSB file to wav
|
||||
* Export to FBX, with complete hierarchy, transformations, materials and textures. Geometry is exported with normals, tangents, UV coordinates, vertex colors and deformers. Skeleton nodes can be exported either as bones or dummy deformers..
|
||||
* Export to FBX, with complete hierarchy, transformations, materials and textures. Geometry is exported with normals, tangents, UV coordinates, vertex colors and deformers. Skeleton nodes can be exported either as bones or dummy deformers.
|
||||
* Real-time preview window for the above-mentioned assets
|
||||
* Diagnostics mode with useful tools for research
|
||||
|
||||
|
||||
@@ -5,22 +5,22 @@ VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity Studio", "Unity Studio\Unity Studio.csproj", "{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity Studio-x86", "Unity Studio\Unity Studio-x86.csproj", "{F5E07FB2-95E4-417F-943F-D439D9A03BBA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x64.Build.0 = Debug|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.Build.0 = Debug|x86
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x64.ActiveCfg = Release|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x64.Build.0 = Release|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.ActiveCfg = Release|x86
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.Build.0 = Release|x86
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|Any CPU.ActiveCfg = Release|x64
|
||||
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|Any CPU.Build.0 = Release|x64
|
||||
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Release|Any CPU.ActiveCfg = Release|x86
|
||||
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Release|Any CPU.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -7,46 +7,46 @@ namespace SevenZip.Compression.LZMA
|
||||
public static class SevenZipHelper
|
||||
{
|
||||
|
||||
static int dictionary = 1 << 23;
|
||||
static int dictionary = 1 << 23;
|
||||
|
||||
// static Int32 posStateBits = 2;
|
||||
// static Int32 litContextBits = 3; // for normal files
|
||||
// static Int32 posStateBits = 2;
|
||||
// static Int32 litContextBits = 3; // for normal files
|
||||
// UInt32 litContextBits = 0; // for 32-bit data
|
||||
// static Int32 litPosBits = 0;
|
||||
// static Int32 litPosBits = 0;
|
||||
// UInt32 litPosBits = 2; // for 32-bit data
|
||||
// static Int32 algorithm = 2;
|
||||
// static Int32 numFastBytes = 128;
|
||||
// static Int32 algorithm = 2;
|
||||
// static Int32 numFastBytes = 128;
|
||||
|
||||
static bool eos = false;
|
||||
static bool eos = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static CoderPropID[] propIDs =
|
||||
{
|
||||
CoderPropID.DictionarySize,
|
||||
CoderPropID.PosStateBits,
|
||||
CoderPropID.LitContextBits,
|
||||
CoderPropID.LitPosBits,
|
||||
CoderPropID.Algorithm,
|
||||
CoderPropID.NumFastBytes,
|
||||
CoderPropID.MatchFinder,
|
||||
CoderPropID.EndMarker
|
||||
};
|
||||
static CoderPropID[] propIDs =
|
||||
{
|
||||
CoderPropID.DictionarySize,
|
||||
CoderPropID.PosStateBits,
|
||||
CoderPropID.LitContextBits,
|
||||
CoderPropID.LitPosBits,
|
||||
CoderPropID.Algorithm,
|
||||
CoderPropID.NumFastBytes,
|
||||
CoderPropID.MatchFinder,
|
||||
CoderPropID.EndMarker
|
||||
};
|
||||
|
||||
// these are the default properties, keeping it simple for now:
|
||||
static object[] properties =
|
||||
{
|
||||
(Int32)(dictionary),
|
||||
(Int32)(2),
|
||||
(Int32)(3),
|
||||
(Int32)(0),
|
||||
(Int32)(2),
|
||||
(Int32)(128),
|
||||
"bt4",
|
||||
eos
|
||||
};
|
||||
static object[] properties =
|
||||
{
|
||||
(Int32)(dictionary),
|
||||
(Int32)(2),
|
||||
(Int32)(3),
|
||||
(Int32)(0),
|
||||
(Int32)(2),
|
||||
(Int32)(128),
|
||||
"bt4",
|
||||
eos
|
||||
};
|
||||
|
||||
|
||||
public static byte[] Compress(byte[] inputBytes)
|
||||
@@ -54,7 +54,7 @@ namespace SevenZip.Compression.LZMA
|
||||
|
||||
MemoryStream inStream = new MemoryStream(inputBytes);
|
||||
MemoryStream outStream = new MemoryStream();
|
||||
SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
|
||||
Encoder encoder = new Encoder();
|
||||
encoder.SetCoderProperties(propIDs, properties);
|
||||
encoder.WriteCoderProperties(outStream);
|
||||
long fileSize = inStream.Length;
|
||||
@@ -68,8 +68,8 @@ namespace SevenZip.Compression.LZMA
|
||||
{
|
||||
MemoryStream newInStream = new MemoryStream(inputBytes);
|
||||
|
||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
||||
|
||||
Decoder decoder = new Decoder();
|
||||
|
||||
newInStream.Seek(0, 0);
|
||||
MemoryStream newOutStream = new MemoryStream();
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace SevenZip.Compression.LZMA
|
||||
|
||||
public static MemoryStream StreamDecompress(MemoryStream newInStream)
|
||||
{
|
||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
||||
Decoder decoder = new Decoder();
|
||||
|
||||
newInStream.Seek(0, 0);
|
||||
MemoryStream newOutStream = new MemoryStream();
|
||||
@@ -124,7 +124,7 @@ namespace SevenZip.Compression.LZMA
|
||||
|
||||
public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
|
||||
{
|
||||
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
|
||||
Decoder decoder = new Decoder();
|
||||
|
||||
newInStream.Seek(0, 0);
|
||||
MemoryStream newOutStream = new MemoryStream();
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace Unity_Studio
|
||||
public AboutBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Text = String.Format("About {0}", AssemblyTitle);
|
||||
this.labelProductName.Text = AssemblyProduct;
|
||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
||||
this.labelCopyright.Text = AssemblyCopyright;
|
||||
this.labelCompanyName.Text = AssemblyCompany;
|
||||
this.textBoxDescription.Text = AssemblyDescription;
|
||||
Text = $"About {AssemblyTitle}";
|
||||
labelProductName.Text = AssemblyProduct;
|
||||
labelVersion.Text = $"Version {AssemblyVersion}";
|
||||
labelCopyright.Text = AssemblyCopyright;
|
||||
labelCompanyName.Text = AssemblyCompany;
|
||||
textBoxDescription.Text = AssemblyDescription;
|
||||
}
|
||||
|
||||
#region Assembly Attribute Accessors
|
||||
@@ -40,13 +40,7 @@ namespace Unity_Studio
|
||||
}
|
||||
}
|
||||
|
||||
public string AssemblyVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
}
|
||||
}
|
||||
public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
|
||||
public string AssemblyDescription
|
||||
{
|
||||
@@ -103,7 +97,7 @@ namespace Unity_Studio
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ namespace Unity_Studio
|
||||
showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
|
||||
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
|
||||
convertfsb.Checked = (bool)Properties.Settings.Default["convertfsb"];
|
||||
string str = Properties.Settings.Default["convertType"] as string;
|
||||
var str = (string)Properties.Settings.Default["convertType"];
|
||||
foreach (Control c in panel1.Controls)
|
||||
{
|
||||
if (c.Text == str)
|
||||
{
|
||||
(c as RadioButton).Checked = true;
|
||||
((RadioButton)c).Checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -57,21 +57,21 @@ namespace Unity_Studio
|
||||
Properties.Settings.Default["convertfsb"] = convertfsb.Checked;
|
||||
foreach (Control c in panel1.Controls)
|
||||
{
|
||||
if ((c as RadioButton).Checked)
|
||||
if (((RadioButton)c).Checked)
|
||||
{
|
||||
Properties.Settings.Default["convertType"] = c.Text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Properties.Settings.Default.Save();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void fbxCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void exportDeformers_CheckedChanged(object sender, EventArgs e)
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Unity_Studio
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
OpenTK.Toolkit.Init(new OpenTK.ToolkitOptions { EnableHighResolution = false });
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new UnityStudioForm());
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.6.6.0")]
|
||||
[assembly: AssemblyFileVersion("0.6.6.0")]
|
||||
[assembly: AssemblyVersion("0.7.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.0.0")]
|
||||
|
||||
12
Unity Studio/Properties/Settings.Designer.cs
generated
12
Unity Studio/Properties/Settings.Designer.cs
generated
@@ -226,5 +226,17 @@ namespace Unity_Studio.Properties {
|
||||
this["convertType"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool displayOriginalName {
|
||||
get {
|
||||
return ((bool)(this["displayOriginalName"]));
|
||||
}
|
||||
set {
|
||||
this["displayOriginalName"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,5 +53,8 @@
|
||||
<Setting Name="convertType" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">PNG</Value>
|
||||
</Setting>
|
||||
<Setting Name="displayOriginalName" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
52
Unity Studio/Unity Classes/AssetBundle.cs
Normal file
52
Unity Studio/Unity Classes/AssetBundle.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Unity_Studio
|
||||
{
|
||||
|
||||
class AssetBundle
|
||||
{
|
||||
public class AssetInfo
|
||||
{
|
||||
public int preloadIndex;
|
||||
public int preloadSize;
|
||||
public PPtr asset;
|
||||
}
|
||||
|
||||
public class ContainerData
|
||||
{
|
||||
public string first;
|
||||
public AssetInfo second;
|
||||
}
|
||||
|
||||
|
||||
public List<ContainerData> m_Container = new List<ContainerData>();
|
||||
|
||||
public AssetBundle(AssetPreloadData preloadData)
|
||||
{
|
||||
var sourceFile = preloadData.sourceFile;
|
||||
var a_Stream = preloadData.sourceFile.a_Stream;
|
||||
a_Stream.Position = preloadData.Offset;
|
||||
|
||||
var m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
var size = a_Stream.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
sourceFile.ReadPPtr();
|
||||
}
|
||||
size = a_Stream.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
var temp = new ContainerData();
|
||||
temp.first = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
temp.second = new AssetInfo();
|
||||
temp.second.preloadIndex = a_Stream.ReadInt32();
|
||||
temp.second.preloadSize = a_Stream.ReadInt32();
|
||||
temp.second.asset = sourceFile.ReadPPtr();
|
||||
m_Container.Add(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,23 +94,21 @@ namespace Unity_Studio
|
||||
|
||||
if (readSwitch)
|
||||
{
|
||||
m_AudioData = new byte[m_Size];
|
||||
|
||||
if (m_Source == null)
|
||||
{
|
||||
a_Stream.Read(m_AudioData, 0, (int)m_Size);
|
||||
m_AudioData = a_Stream.ReadBytes((int)m_Size);
|
||||
}
|
||||
else if (File.Exists(m_Source) ||
|
||||
File.Exists(m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(m_Source))))
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(File.OpenRead(m_Source));
|
||||
reader.BaseStream.Position = m_Offset;
|
||||
reader.Read(m_AudioData, 0, (int)m_Size);
|
||||
m_AudioData = reader.ReadBytes((int)m_Size);
|
||||
reader.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndianStream estream = null;
|
||||
EndianStream estream;
|
||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
|
||||
{
|
||||
estream.Position = m_Offset;
|
||||
|
||||
@@ -58,10 +58,10 @@ namespace Unity_Studio
|
||||
m_Tag = a_Stream.ReadUInt16();
|
||||
m_IsActive = a_Stream.ReadBoolean();
|
||||
|
||||
base.Text = m_Name;
|
||||
Text = m_Name;
|
||||
preloadData.Text = m_Name;
|
||||
//name should be unique
|
||||
base.Name = uniqueID;
|
||||
Name = uniqueID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Unity_Studio
|
||||
public TexEnv[] m_TexEnvs;
|
||||
public strFloatPair[] m_Floats;
|
||||
public strColorPair[] m_Colors;
|
||||
|
||||
|
||||
public Material(AssetPreloadData preloadData)
|
||||
{
|
||||
var sourceFile = preloadData.sourceFile;
|
||||
@@ -44,6 +44,11 @@ namespace Unity_Studio
|
||||
{
|
||||
m_ShaderKeywords = new string[1] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
|
||||
uint m_LightmapFlags = a_Stream.ReadUInt32();
|
||||
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 6) || sourceFile.version[0] > 5)//5.6.0 and up
|
||||
{
|
||||
var m_EnableInstancingVariants = a_Stream.ReadBoolean();
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceFile.version[0] > 4 || (sourceFile.version[0] == 4 && sourceFile.version[1] >= 3)) { m_CustomRenderQueue = a_Stream.ReadInt32(); }
|
||||
@@ -56,9 +61,17 @@ namespace Unity_Studio
|
||||
stringTagMap[i] = new string[2] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()), a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
|
||||
}
|
||||
}
|
||||
|
||||
//m_SavedProperties
|
||||
m_TexEnvs = new TexEnv[a_Stream.ReadInt32()];
|
||||
//disabledShaderPasses
|
||||
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 6) || sourceFile.version[0] > 5)//5.6.0 and up
|
||||
{
|
||||
var size = a_Stream.ReadInt32();
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
}
|
||||
}
|
||||
//m_SavedProperties
|
||||
m_TexEnvs = new TexEnv[a_Stream.ReadInt32()];
|
||||
for (int i = 0; i < m_TexEnvs.Length; i++)
|
||||
{
|
||||
TexEnv m_TexEnv = new TexEnv()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,16 +23,7 @@ namespace Unity_Studio
|
||||
if (readSwitch)
|
||||
{
|
||||
preloadData.extension = ".txt";
|
||||
a_Stream.Position = preloadData.Offset;
|
||||
ClassStruct classStructure;
|
||||
if (sourceFile.ClassStructures.TryGetValue(preloadData.Type1, out classStructure))
|
||||
{
|
||||
var member = classStructure.members;
|
||||
var sb = new StringBuilder();
|
||||
Read(sb, member, a_Stream);
|
||||
serializedText = sb.ToString();
|
||||
}
|
||||
else
|
||||
if ((serializedText = preloadData.ViewStruct()) == null)
|
||||
{
|
||||
var str = "PPtr<GameObject> m_GameObject\r\n";
|
||||
str += "\tint m_FileID = " + m_GameObject.m_FileID + "\r\n";
|
||||
@@ -58,124 +49,5 @@ namespace Unity_Studio
|
||||
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
|
||||
}
|
||||
}
|
||||
|
||||
private void Read(StringBuilder sb, List<ClassMember> members, EndianStream a_Stream)
|
||||
{
|
||||
for (int i = 0; i < members.Count; i++)
|
||||
{
|
||||
var member = members[i];
|
||||
var level = member.Level;
|
||||
var varTypeStr = member.Type;
|
||||
var varNameStr = member.Name;
|
||||
if (varTypeStr == "SInt8")//sbyte
|
||||
{
|
||||
var value = a_Stream.ReadSByte();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "UInt8")//byte
|
||||
{
|
||||
var value = a_Stream.ReadByte();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "short" || varTypeStr == "SInt16")//Int16
|
||||
{
|
||||
var value = a_Stream.ReadInt16();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "UInt16" || varTypeStr == "unsigned short")//UInt16
|
||||
{
|
||||
var value = a_Stream.ReadUInt16();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "int" || varTypeStr == "SInt32")//Int32
|
||||
{
|
||||
var value = a_Stream.ReadInt32();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "UInt32" || varTypeStr == "unsigned int")//UInt32
|
||||
{
|
||||
var value = a_Stream.ReadUInt32();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "long long" || varTypeStr == "SInt64")//Int64
|
||||
{
|
||||
var value = a_Stream.ReadInt64();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "UInt64" || varTypeStr == "unsigned long long")//UInt64
|
||||
{
|
||||
var value = a_Stream.ReadUInt64();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "float")//float
|
||||
{
|
||||
var value = a_Stream.ReadSingle();
|
||||
sb.AppendFormat("{0}{1} {2} = {3:f}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "double")//double
|
||||
{
|
||||
var value = a_Stream.ReadDouble();
|
||||
sb.AppendFormat("{0}{1} {2} = {3:f4}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "bool")//bool
|
||||
{
|
||||
var value = a_Stream.ReadBoolean();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
else if (varTypeStr == "string")//string
|
||||
{
|
||||
var value = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
sb.AppendFormat("{0}{1} {2} = \"{3}\"\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
i += 3;//skip
|
||||
}
|
||||
else if (varTypeStr == "Array")//Array
|
||||
{
|
||||
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
|
||||
var size = a_Stream.ReadInt32();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), "int", "size", size);
|
||||
var array = ReadArray(members, level, i);
|
||||
for (int j = 0; j < size; j++)
|
||||
{
|
||||
sb.AppendFormat("{0}[{1}]\r\n", (new string('\t', level + 1)), j);
|
||||
Read(sb, array, a_Stream);
|
||||
}
|
||||
i += array.Count + 1;//skip
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<ClassMember> ReadArray(List<ClassMember> members, int level, int index)
|
||||
{
|
||||
var member2 = new List<ClassMember>();
|
||||
for (int i = index + 2; i < members.Count; i++)//skip int size
|
||||
{
|
||||
var member = members[i];
|
||||
var level2 = member.Level;
|
||||
if (level2 <= level)
|
||||
{
|
||||
return member2;
|
||||
}
|
||||
else
|
||||
{
|
||||
member2.Add(member);
|
||||
}
|
||||
}
|
||||
return member2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,13 @@ namespace Unity_Studio
|
||||
{
|
||||
if (readSwitch)
|
||||
{
|
||||
m_Script = Encoding.UTF8.GetBytes("Serialized Shader can't be read");
|
||||
string str;
|
||||
if ((str = preloadData.ViewStruct()) != null)
|
||||
{
|
||||
m_Script = Encoding.UTF8.GetBytes(preloadData.ViewStruct());
|
||||
}
|
||||
else
|
||||
m_Script = Encoding.UTF8.GetBytes("Serialized Shader can't be read");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Unity_Studio
|
||||
}
|
||||
|
||||
m_IsReadable = a_Stream.ReadBoolean(); //2.6.0 and up
|
||||
m_ReadAllowed = a_Stream.ReadBoolean(); //3.0.0 and up
|
||||
m_ReadAllowed = a_Stream.ReadBoolean(); //3.0.0 - 5.4
|
||||
a_Stream.AlignStream(4);
|
||||
|
||||
m_ImageCount = a_Stream.ReadInt32();
|
||||
@@ -168,15 +168,14 @@ namespace Unity_Studio
|
||||
if (File.Exists(path) ||
|
||||
File.Exists(path = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(path))))
|
||||
{
|
||||
image_data = new byte[image_data_size];
|
||||
BinaryReader reader = new BinaryReader(File.OpenRead(path));
|
||||
reader.BaseStream.Position = offset;
|
||||
reader.Read(image_data, 0, image_data_size);
|
||||
image_data = reader.ReadBytes(image_data_size);
|
||||
reader.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndianStream estream = null;
|
||||
EndianStream estream;
|
||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
||||
{
|
||||
estream.Position = offset;
|
||||
@@ -186,8 +185,7 @@ namespace Unity_Studio
|
||||
}
|
||||
else
|
||||
{
|
||||
image_data = new byte[image_data_size];
|
||||
a_Stream.Read(image_data, 0, image_data_size);
|
||||
image_data = a_Stream.ReadBytes(image_data_size);
|
||||
}
|
||||
|
||||
switch (m_TextureFormat)
|
||||
|
||||
@@ -20,5 +20,127 @@ namespace Unity_Studio
|
||||
|
||||
public AssetsFile sourceFile;
|
||||
public string uniqueID;
|
||||
|
||||
public string ViewStruct()
|
||||
{
|
||||
var a_Stream = sourceFile.a_Stream;
|
||||
a_Stream.Position = Offset;
|
||||
ClassStruct classStructure;
|
||||
if (sourceFile.ClassStructures.TryGetValue(Type1, out classStructure))
|
||||
{
|
||||
var member = classStructure.members;
|
||||
var sb = new StringBuilder();
|
||||
Read(sb, member, a_Stream);
|
||||
return sb.ToString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void Read(StringBuilder sb, List<ClassMember> members, EndianStream a_Stream)
|
||||
{
|
||||
for (int i = 0; i < members.Count; i++)
|
||||
{
|
||||
var member = members[i];
|
||||
var level = member.Level;
|
||||
var varTypeStr = member.Type;
|
||||
var varNameStr = member.Name;
|
||||
object value = null;
|
||||
var align = (member.Flag & 0x4000) != 0;
|
||||
var append = true;
|
||||
if (varTypeStr == "SInt8")//sbyte
|
||||
{
|
||||
value = a_Stream.ReadSByte();
|
||||
}
|
||||
else if (varTypeStr == "UInt8")//byte
|
||||
{
|
||||
value = a_Stream.ReadByte();
|
||||
}
|
||||
else if (varTypeStr == "short" || varTypeStr == "SInt16")//Int16
|
||||
{
|
||||
value = a_Stream.ReadInt16();
|
||||
}
|
||||
else if (varTypeStr == "UInt16" || varTypeStr == "unsigned short")//UInt16
|
||||
{
|
||||
value = a_Stream.ReadUInt16();
|
||||
}
|
||||
else if (varTypeStr == "int" || varTypeStr == "SInt32")//Int32
|
||||
{
|
||||
value = a_Stream.ReadInt32();
|
||||
}
|
||||
else if (varTypeStr == "UInt32" || varTypeStr == "unsigned int")//UInt32
|
||||
{
|
||||
value = a_Stream.ReadUInt32();
|
||||
}
|
||||
else if (varTypeStr == "long long" || varTypeStr == "SInt64")//Int64
|
||||
{
|
||||
value = a_Stream.ReadInt64();
|
||||
}
|
||||
else if (varTypeStr == "UInt64" || varTypeStr == "unsigned long long")//UInt64
|
||||
{
|
||||
value = a_Stream.ReadUInt64();
|
||||
}
|
||||
else if (varTypeStr == "float")//float
|
||||
{
|
||||
value = a_Stream.ReadSingle();
|
||||
}
|
||||
else if (varTypeStr == "double")//double
|
||||
{
|
||||
value = a_Stream.ReadDouble();
|
||||
}
|
||||
else if (varTypeStr == "bool")//bool
|
||||
{
|
||||
value = a_Stream.ReadBoolean();
|
||||
}
|
||||
else if (varTypeStr == "string")//string
|
||||
{
|
||||
append = false;
|
||||
var str = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
sb.AppendFormat("{0}{1} {2} = \"{3}\"\r\n", (new string('\t', level)), varTypeStr, varNameStr, str);
|
||||
i += 3;//skip
|
||||
}
|
||||
else if (varTypeStr == "Array")//Array
|
||||
{
|
||||
append = false;
|
||||
if ((members[i - 1].Flag & 0x4000) != 0)
|
||||
align = true;
|
||||
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
|
||||
var size = a_Stream.ReadInt32();
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), "int", "size", size);
|
||||
var array = ReadArray(members, level, i);
|
||||
for (int j = 0; j < size; j++)
|
||||
{
|
||||
sb.AppendFormat("{0}[{1}]\r\n", (new string('\t', level + 1)), j);
|
||||
Read(sb, array, a_Stream);
|
||||
}
|
||||
i += array.Count + 1;//skip
|
||||
}
|
||||
else
|
||||
{
|
||||
append = false;
|
||||
align = false;
|
||||
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
|
||||
}
|
||||
if (append)
|
||||
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
|
||||
if (align)
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ClassMember> ReadArray(List<ClassMember> members, int level, int index)
|
||||
{
|
||||
var member2 = new List<ClassMember>();
|
||||
for (int i = index + 2; i < members.Count; i++)//skip int size
|
||||
{
|
||||
var member = members[i];
|
||||
var level2 = member.Level;
|
||||
if (level2 <= level)
|
||||
{
|
||||
return member2;
|
||||
}
|
||||
member2.Add(member);
|
||||
}
|
||||
return member2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,7 @@ namespace Unity_Studio
|
||||
private List<int[]> classIDs = new List<int[]>();//use for 5.5.0
|
||||
|
||||
public static string[] buildTypeSplit = { ".", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
public static string[] strverSplit = {
|
||||
".", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
|
||||
"u", "v", "w", "x", "y", "z", "\n"
|
||||
};
|
||||
public static string[] strverSplit = { ".", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "\n", "-", "_" };
|
||||
|
||||
#region cmmon string
|
||||
private static Dictionary<int, string> baseStrings = new Dictionary<int, string>()
|
||||
@@ -234,6 +231,7 @@ namespace Unity_Studio
|
||||
case 16: platformStr = "Google NaCl"; break;
|
||||
case 21: platformStr = "WP8"; break;
|
||||
case 25: platformStr = "Linux"; break;
|
||||
case 29: platformStr = "Wii U"; break;
|
||||
default: platformStr = "Unknown Platform"; break;
|
||||
}
|
||||
|
||||
@@ -367,8 +365,7 @@ namespace Unity_Studio
|
||||
int index = a_Stream.ReadInt32();
|
||||
int isArray = a_Stream.ReadInt32();
|
||||
int num0 = a_Stream.ReadInt32();
|
||||
int num1 = a_Stream.ReadInt16();
|
||||
int num2 = a_Stream.ReadInt16();
|
||||
int flag = a_Stream.ReadInt32();
|
||||
int childrenCount = a_Stream.ReadInt32();
|
||||
|
||||
//Debug.WriteLine(baseFormat + " " + baseName + " " + childrenCount);
|
||||
@@ -377,7 +374,8 @@ namespace Unity_Studio
|
||||
Level = level - 1,
|
||||
Type = varType,
|
||||
Name = varName,
|
||||
Size = size
|
||||
Size = size,
|
||||
Flag = flag
|
||||
});
|
||||
for (int i = 0; i < childrenCount; i++) { readBase(cb, level + 1); }
|
||||
}
|
||||
@@ -450,11 +448,11 @@ namespace Unity_Studio
|
||||
test = a_Stream.ReadUInt16();
|
||||
string varNameStr;
|
||||
if (test == 0) { varNameStr = varStrings.Substring(varNameIndex, varStrings.IndexOf('\0', varNameIndex) - varNameIndex); }
|
||||
else { varNameStr = baseStrings.ContainsKey(varTypeIndex) ? baseStrings[varNameIndex] : varNameIndex.ToString(); }
|
||||
else { varNameStr = baseStrings.ContainsKey(varNameIndex) ? baseStrings[varNameIndex] : varNameIndex.ToString(); }
|
||||
|
||||
int size = a_Stream.ReadInt32();
|
||||
int index = a_Stream.ReadInt32();
|
||||
int num1 = a_Stream.ReadInt32();
|
||||
int flag = a_Stream.ReadInt32();
|
||||
|
||||
if (index == 0) { className = varTypeStr + " " + varNameStr; }
|
||||
else
|
||||
@@ -464,7 +462,8 @@ namespace Unity_Studio
|
||||
Level = level - 1,
|
||||
Type = varTypeStr,
|
||||
Name = varNameStr,
|
||||
Size = size
|
||||
Size = size,
|
||||
Flag = flag
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Lz4;
|
||||
using SevenZip.Compression.LZMA;
|
||||
|
||||
namespace Unity_Studio
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace Unity_Studio
|
||||
byte[] lzmaBuffer = new byte[lzmaSize];
|
||||
b_Stream.Read(lzmaBuffer, 0, lzmaSize);
|
||||
|
||||
using (var lzmaStream = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
|
||||
using (var lzmaStream = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
|
||||
{
|
||||
getFiles(lzmaStream, 0);
|
||||
}
|
||||
@@ -166,15 +166,14 @@ namespace Unity_Studio
|
||||
EndianStream blocksInfo;
|
||||
switch (flag & 0x3F)
|
||||
{
|
||||
default:
|
||||
case 0://None
|
||||
default://None
|
||||
{
|
||||
blocksInfo = new EndianStream(new MemoryStream(blocksInfoBytes), EndianType.BigEndian);
|
||||
break;
|
||||
}
|
||||
case 1://LZMA
|
||||
{
|
||||
blocksInfo = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
|
||||
blocksInfo = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
|
||||
break;
|
||||
}
|
||||
case 2://LZ4
|
||||
@@ -206,8 +205,7 @@ namespace Unity_Studio
|
||||
var compressedBytes = b_Stream.ReadBytes(compressedSize);
|
||||
switch (flag & 0x3F)
|
||||
{
|
||||
default:
|
||||
case 0://None
|
||||
default://None
|
||||
{
|
||||
assetsDataStream.Write(compressedBytes, 0, compressedSize);
|
||||
break;
|
||||
@@ -217,7 +215,7 @@ namespace Unity_Studio
|
||||
var uncompressedBytes = new byte[uncompressedSize];
|
||||
using (var mstream = new MemoryStream(compressedBytes))
|
||||
{
|
||||
var decoder = SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
|
||||
var decoder = SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
|
||||
decoder.Read(uncompressedBytes, 0, uncompressedSize);
|
||||
decoder.Dispose();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Unity_Studio
|
||||
public string Type;
|
||||
public string Name;
|
||||
public int Size;
|
||||
public int Flag;
|
||||
}
|
||||
|
||||
public static class ClassIDReference
|
||||
|
||||
@@ -20,115 +20,115 @@ namespace Unity_Studio
|
||||
|
||||
public EndianStream(Stream stream, EndianType endian) : base(stream) { }
|
||||
|
||||
public long Position { get { return base.BaseStream.Position; } set { base.BaseStream.Position = value; } }
|
||||
public long Position { get { return BaseStream.Position; } set { BaseStream.Position = value; } }
|
||||
|
||||
public override short ReadInt16()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a16 = base.ReadBytes(2);
|
||||
a16 = ReadBytes(2);
|
||||
Array.Reverse(a16);
|
||||
return BitConverter.ToInt16(a16, 0);
|
||||
}
|
||||
else return base.ReadInt16();
|
||||
return base.ReadInt16();
|
||||
}
|
||||
|
||||
public override int ReadInt32()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a32 = base.ReadBytes(4);
|
||||
a32 = ReadBytes(4);
|
||||
Array.Reverse(a32);
|
||||
return BitConverter.ToInt32(a32, 0);
|
||||
}
|
||||
else return base.ReadInt32();
|
||||
return base.ReadInt32();
|
||||
}
|
||||
|
||||
public override long ReadInt64()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a64 = base.ReadBytes(8);
|
||||
a64 = ReadBytes(8);
|
||||
Array.Reverse(a64);
|
||||
return BitConverter.ToInt64(a64, 0);
|
||||
}
|
||||
else return base.ReadInt64();
|
||||
return base.ReadInt64();
|
||||
}
|
||||
|
||||
public override ushort ReadUInt16()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a16 = base.ReadBytes(2);
|
||||
a16 = ReadBytes(2);
|
||||
Array.Reverse(a16);
|
||||
return BitConverter.ToUInt16(a16, 0);
|
||||
}
|
||||
else return base.ReadUInt16();
|
||||
return base.ReadUInt16();
|
||||
}
|
||||
|
||||
public override uint ReadUInt32()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a32 = base.ReadBytes(4);
|
||||
a32 = ReadBytes(4);
|
||||
Array.Reverse(a32);
|
||||
return BitConverter.ToUInt32(a32, 0);
|
||||
}
|
||||
else return base.ReadUInt32();
|
||||
return base.ReadUInt32();
|
||||
}
|
||||
|
||||
public override ulong ReadUInt64()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a64 = base.ReadBytes(8);
|
||||
a64 = ReadBytes(8);
|
||||
Array.Reverse(a64);
|
||||
return BitConverter.ToUInt64(a64, 0);
|
||||
}
|
||||
else return base.ReadUInt64();
|
||||
return base.ReadUInt64();
|
||||
}
|
||||
|
||||
public override float ReadSingle()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a32 = base.ReadBytes(4);
|
||||
a32 = ReadBytes(4);
|
||||
Array.Reverse(a32);
|
||||
return BitConverter.ToSingle(a32, 0);
|
||||
}
|
||||
else return base.ReadSingle();
|
||||
return base.ReadSingle();
|
||||
}
|
||||
|
||||
public override double ReadDouble()
|
||||
{
|
||||
if (endian == EndianType.BigEndian)
|
||||
{
|
||||
a64 = base.ReadBytes(8);
|
||||
a64 = ReadBytes(8);
|
||||
Array.Reverse(a64);
|
||||
return BitConverter.ToUInt64(a64, 0);
|
||||
}
|
||||
else return base.ReadDouble();
|
||||
return base.ReadDouble();
|
||||
}
|
||||
|
||||
public string ReadASCII(int length)
|
||||
{
|
||||
return Encoding.ASCII.GetString(base.ReadBytes(length));
|
||||
return Encoding.ASCII.GetString(ReadBytes(length));
|
||||
}
|
||||
|
||||
public void AlignStream(int alignment)
|
||||
{
|
||||
long pos = base.BaseStream.Position;
|
||||
long pos = BaseStream.Position;
|
||||
//long padding = alignment - pos + (pos / alignment) * alignment;
|
||||
//if (padding != alignment) { base.BaseStream.Position += padding; }
|
||||
if ((pos % alignment) != 0) { base.BaseStream.Position += alignment - (pos % alignment); }
|
||||
if ((pos % alignment) != 0) { BaseStream.Position += alignment - (pos % alignment); }
|
||||
}
|
||||
|
||||
public string ReadAlignedString(int length)
|
||||
{
|
||||
if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
|
||||
if (length > 0 && length < (BaseStream.Length - BaseStream.Position))//crude failsafe
|
||||
{
|
||||
byte[] stringData = new byte[length];
|
||||
base.Read(stringData, 0, length);
|
||||
Read(stringData, 0, length);
|
||||
var result = Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
||||
|
||||
/*string result = "";
|
||||
@@ -142,7 +142,7 @@ namespace Unity_Studio
|
||||
AlignStream(4);
|
||||
return result;
|
||||
}
|
||||
else { return ""; }
|
||||
return "";
|
||||
}
|
||||
|
||||
public string ReadStringToNull()
|
||||
|
||||
@@ -7,538 +7,525 @@ using System.IO;
|
||||
|
||||
namespace Lz4
|
||||
{
|
||||
public class Lz4DecoderStream : Stream
|
||||
{
|
||||
public Lz4DecoderStream()
|
||||
{
|
||||
}
|
||||
public class Lz4DecoderStream : Stream
|
||||
{
|
||||
public Lz4DecoderStream(Stream input, long inputLength = long.MaxValue)
|
||||
{
|
||||
Reset(input, inputLength);
|
||||
}
|
||||
|
||||
public Lz4DecoderStream( Stream input, long inputLength = long.MaxValue )
|
||||
{
|
||||
Reset( input, inputLength );
|
||||
}
|
||||
public void Reset(Stream input, long inputLength = long.MaxValue)
|
||||
{
|
||||
this.inputLength = inputLength;
|
||||
this.input = input;
|
||||
|
||||
public void Reset( Stream input, long inputLength = long.MaxValue )
|
||||
{
|
||||
this.inputLength = inputLength;
|
||||
this.input = input;
|
||||
phase = DecodePhase.ReadToken;
|
||||
|
||||
phase = DecodePhase.ReadToken;
|
||||
|
||||
decodeBufferPos = 0;
|
||||
|
||||
litLen = 0;
|
||||
matLen = 0;
|
||||
matDst = 0;
|
||||
decodeBufferPos = 0;
|
||||
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen;
|
||||
}
|
||||
litLen = 0;
|
||||
matLen = 0;
|
||||
matDst = 0;
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
this.input = null;
|
||||
}
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen;
|
||||
}
|
||||
|
||||
private long inputLength;
|
||||
private Stream input;
|
||||
public override void Close()
|
||||
{
|
||||
input = null;
|
||||
}
|
||||
|
||||
//because we might not be able to match back across invocations,
|
||||
//we have to keep the last window's worth of bytes around for reuse
|
||||
//we use a circular buffer for this - every time we write into this
|
||||
//buffer, we also write the same into our output buffer
|
||||
private long inputLength;
|
||||
private Stream input;
|
||||
|
||||
private const int DecBufLen = 0x10000;
|
||||
private const int DecBufMask = 0xFFFF;
|
||||
//because we might not be able to match back across invocations,
|
||||
//we have to keep the last window's worth of bytes around for reuse
|
||||
//we use a circular buffer for this - every time we write into this
|
||||
//buffer, we also write the same into our output buffer
|
||||
|
||||
private const int InBufLen = 128;
|
||||
private const int DecBufLen = 0x10000;
|
||||
private const int DecBufMask = 0xFFFF;
|
||||
|
||||
private byte[] decodeBuffer = new byte[DecBufLen + InBufLen];
|
||||
private int decodeBufferPos, inBufPos, inBufEnd;
|
||||
private const int InBufLen = 128;
|
||||
|
||||
//we keep track of which phase we're in so that we can jump right back
|
||||
//into the correct part of decoding
|
||||
private byte[] decodeBuffer = new byte[DecBufLen + InBufLen];
|
||||
private int decodeBufferPos, inBufPos, inBufEnd;
|
||||
|
||||
private DecodePhase phase;
|
||||
//we keep track of which phase we're in so that we can jump right back
|
||||
//into the correct part of decoding
|
||||
|
||||
private enum DecodePhase
|
||||
{
|
||||
ReadToken,
|
||||
ReadExLiteralLength,
|
||||
CopyLiteral,
|
||||
ReadOffset,
|
||||
ReadExMatchLength,
|
||||
CopyMatch,
|
||||
}
|
||||
private DecodePhase phase;
|
||||
|
||||
//state within interruptable phases and across phase boundaries is
|
||||
//kept here - again, so that we can punt out and restart freely
|
||||
private enum DecodePhase
|
||||
{
|
||||
ReadToken,
|
||||
ReadExLiteralLength,
|
||||
CopyLiteral,
|
||||
ReadOffset,
|
||||
ReadExMatchLength,
|
||||
CopyMatch,
|
||||
}
|
||||
|
||||
private int litLen, matLen, matDst;
|
||||
//state within interruptable phases and across phase boundaries is
|
||||
//kept here - again, so that we can punt out and restart freely
|
||||
|
||||
public override int Read( byte[] buffer, int offset, int count )
|
||||
{
|
||||
private int litLen, matLen, matDst;
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
#if CHECK_ARGS
|
||||
if( buffer == null )
|
||||
throw new ArgumentNullException( "buffer" );
|
||||
if( offset < 0 || count < 0 || buffer.Length - count < offset )
|
||||
throw new ArgumentOutOfRangeException();
|
||||
if (buffer == null)
|
||||
throw new ArgumentNullException("buffer");
|
||||
if (offset < 0 || count < 0 || buffer.Length - count < offset)
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
||||
if( input == null )
|
||||
throw new InvalidOperationException();
|
||||
if (input == null)
|
||||
throw new InvalidOperationException();
|
||||
#endif
|
||||
int nRead, nToRead = count;
|
||||
int nRead, nToRead = count;
|
||||
|
||||
var decBuf = decodeBuffer;
|
||||
var decBuf = decodeBuffer;
|
||||
|
||||
//the stringy gotos are obnoxious, but their purpose is to
|
||||
//make it *blindingly* obvious how the state machine transitions
|
||||
//back and forth as it reads - remember, we can yield out of
|
||||
//this routine in several places, and we must be able to re-enter
|
||||
//and pick up where we left off!
|
||||
//the stringy gotos are obnoxious, but their purpose is to
|
||||
//make it *blindingly* obvious how the state machine transitions
|
||||
//back and forth as it reads - remember, we can yield out of
|
||||
//this routine in several places, and we must be able to re-enter
|
||||
//and pick up where we left off!
|
||||
|
||||
#if LOCAL_SHADOW
|
||||
var phase = this.phase;
|
||||
var inBufPos = this.inBufPos;
|
||||
var inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
switch( phase )
|
||||
{
|
||||
case DecodePhase.ReadToken:
|
||||
goto readToken;
|
||||
switch (phase)
|
||||
{
|
||||
case DecodePhase.ReadToken:
|
||||
goto readToken;
|
||||
|
||||
case DecodePhase.ReadExLiteralLength:
|
||||
goto readExLiteralLength;
|
||||
case DecodePhase.ReadExLiteralLength:
|
||||
goto readExLiteralLength;
|
||||
|
||||
case DecodePhase.CopyLiteral:
|
||||
goto copyLiteral;
|
||||
case DecodePhase.CopyLiteral:
|
||||
goto copyLiteral;
|
||||
|
||||
case DecodePhase.ReadOffset:
|
||||
goto readOffset;
|
||||
case DecodePhase.ReadOffset:
|
||||
goto readOffset;
|
||||
|
||||
case DecodePhase.ReadExMatchLength:
|
||||
goto readExMatchLength;
|
||||
case DecodePhase.ReadExMatchLength:
|
||||
goto readExMatchLength;
|
||||
|
||||
case DecodePhase.CopyMatch:
|
||||
goto copyMatch;
|
||||
}
|
||||
case DecodePhase.CopyMatch:
|
||||
goto copyMatch;
|
||||
}
|
||||
|
||||
readToken:
|
||||
int tok;
|
||||
if( inBufPos < inBufEnd )
|
||||
{
|
||||
tok = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
readToken:
|
||||
int tok;
|
||||
if (inBufPos < inBufEnd)
|
||||
{
|
||||
tok = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LOCAL_SHADOW
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
|
||||
tok = ReadByteCore();
|
||||
tok = ReadByteCore();
|
||||
#if LOCAL_SHADOW
|
||||
inBufPos = this.inBufPos;
|
||||
inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
#if CHECK_EOF
|
||||
if( tok == -1 )
|
||||
goto finish;
|
||||
if (tok == -1)
|
||||
goto finish;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
litLen = tok >> 4;
|
||||
matLen = (tok & 0xF) + 4;
|
||||
litLen = tok >> 4;
|
||||
matLen = (tok & 0xF) + 4;
|
||||
|
||||
switch( litLen )
|
||||
{
|
||||
case 0:
|
||||
phase = DecodePhase.ReadOffset;
|
||||
goto readOffset;
|
||||
switch (litLen)
|
||||
{
|
||||
case 0:
|
||||
phase = DecodePhase.ReadOffset;
|
||||
goto readOffset;
|
||||
|
||||
case 0xF:
|
||||
phase = DecodePhase.ReadExLiteralLength;
|
||||
goto readExLiteralLength;
|
||||
case 0xF:
|
||||
phase = DecodePhase.ReadExLiteralLength;
|
||||
goto readExLiteralLength;
|
||||
|
||||
default:
|
||||
phase = DecodePhase.CopyLiteral;
|
||||
goto copyLiteral;
|
||||
}
|
||||
default:
|
||||
phase = DecodePhase.CopyLiteral;
|
||||
goto copyLiteral;
|
||||
}
|
||||
|
||||
readExLiteralLength:
|
||||
int exLitLen;
|
||||
if( inBufPos < inBufEnd )
|
||||
{
|
||||
exLitLen = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
readExLiteralLength:
|
||||
int exLitLen;
|
||||
if (inBufPos < inBufEnd)
|
||||
{
|
||||
exLitLen = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LOCAL_SHADOW
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
exLitLen = ReadByteCore();
|
||||
#if LOCAL_SHADOW
|
||||
exLitLen = ReadByteCore();
|
||||
#if LOCAL_SHADOW
|
||||
inBufPos = this.inBufPos;
|
||||
inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
|
||||
#if CHECK_EOF
|
||||
if( exLitLen == -1 )
|
||||
goto finish;
|
||||
if (exLitLen == -1)
|
||||
goto finish;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
litLen += exLitLen;
|
||||
if( exLitLen == 255 )
|
||||
goto readExLiteralLength;
|
||||
litLen += exLitLen;
|
||||
if (exLitLen == 255)
|
||||
goto readExLiteralLength;
|
||||
|
||||
phase = DecodePhase.CopyLiteral;
|
||||
goto copyLiteral;
|
||||
phase = DecodePhase.CopyLiteral;
|
||||
goto copyLiteral;
|
||||
|
||||
copyLiteral:
|
||||
int nReadLit = litLen < nToRead ? litLen : nToRead;
|
||||
if( nReadLit != 0 )
|
||||
{
|
||||
if( inBufPos + nReadLit <= inBufEnd )
|
||||
{
|
||||
int ofs = offset;
|
||||
copyLiteral:
|
||||
int nReadLit = litLen < nToRead ? litLen : nToRead;
|
||||
if (nReadLit != 0)
|
||||
{
|
||||
if (inBufPos + nReadLit <= inBufEnd)
|
||||
{
|
||||
int ofs = offset;
|
||||
|
||||
for( int c = nReadLit; c-- != 0; )
|
||||
buffer[ofs++] = decBuf[inBufPos++];
|
||||
for (int c = nReadLit; c-- != 0;)
|
||||
buffer[ofs++] = decBuf[inBufPos++];
|
||||
|
||||
nRead = nReadLit;
|
||||
}
|
||||
else
|
||||
{
|
||||
nRead = nReadLit;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LOCAL_SHADOW
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
nRead = ReadCore( buffer, offset, nReadLit );
|
||||
nRead = ReadCore(buffer, offset, nReadLit);
|
||||
#if LOCAL_SHADOW
|
||||
inBufPos = this.inBufPos;
|
||||
inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
#if CHECK_EOF
|
||||
if( nRead == 0 )
|
||||
goto finish;
|
||||
if (nRead == 0)
|
||||
goto finish;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
offset += nRead;
|
||||
nToRead -= nRead;
|
||||
offset += nRead;
|
||||
nToRead -= nRead;
|
||||
|
||||
litLen -= nRead;
|
||||
litLen -= nRead;
|
||||
|
||||
if( litLen != 0 )
|
||||
goto copyLiteral;
|
||||
}
|
||||
if (litLen != 0)
|
||||
goto copyLiteral;
|
||||
}
|
||||
|
||||
if( nToRead == 0 )
|
||||
goto finish;
|
||||
if (nToRead == 0)
|
||||
goto finish;
|
||||
|
||||
phase = DecodePhase.ReadOffset;
|
||||
goto readOffset;
|
||||
phase = DecodePhase.ReadOffset;
|
||||
goto readOffset;
|
||||
|
||||
readOffset:
|
||||
if( inBufPos + 1 < inBufEnd )
|
||||
{
|
||||
matDst = (decBuf[inBufPos + 1] << 8) | decBuf[inBufPos];
|
||||
inBufPos += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
readOffset:
|
||||
if (inBufPos + 1 < inBufEnd)
|
||||
{
|
||||
matDst = (decBuf[inBufPos + 1] << 8) | decBuf[inBufPos];
|
||||
inBufPos += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LOCAL_SHADOW
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
matDst = ReadOffsetCore();
|
||||
matDst = ReadOffsetCore();
|
||||
#if LOCAL_SHADOW
|
||||
inBufPos = this.inBufPos;
|
||||
inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
#if CHECK_EOF
|
||||
if( matDst == -1 )
|
||||
goto finish;
|
||||
if (matDst == -1)
|
||||
goto finish;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if( matLen == 15 + 4 )
|
||||
{
|
||||
phase = DecodePhase.ReadExMatchLength;
|
||||
goto readExMatchLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
phase = DecodePhase.CopyMatch;
|
||||
goto copyMatch;
|
||||
}
|
||||
if (matLen == 15 + 4)
|
||||
{
|
||||
phase = DecodePhase.ReadExMatchLength;
|
||||
goto readExMatchLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
phase = DecodePhase.CopyMatch;
|
||||
goto copyMatch;
|
||||
}
|
||||
|
||||
readExMatchLength:
|
||||
int exMatLen;
|
||||
if( inBufPos < inBufEnd )
|
||||
{
|
||||
exMatLen = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
readExMatchLength:
|
||||
int exMatLen;
|
||||
if (inBufPos < inBufEnd)
|
||||
{
|
||||
exMatLen = decBuf[inBufPos++];
|
||||
}
|
||||
else
|
||||
{
|
||||
#if LOCAL_SHADOW
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
exMatLen = ReadByteCore();
|
||||
exMatLen = ReadByteCore();
|
||||
#if LOCAL_SHADOW
|
||||
inBufPos = this.inBufPos;
|
||||
inBufEnd = this.inBufEnd;
|
||||
#endif
|
||||
#if CHECK_EOF
|
||||
if( exMatLen == -1 )
|
||||
goto finish;
|
||||
if (exMatLen == -1)
|
||||
goto finish;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
matLen += exMatLen;
|
||||
if( exMatLen == 255 )
|
||||
goto readExMatchLength;
|
||||
matLen += exMatLen;
|
||||
if (exMatLen == 255)
|
||||
goto readExMatchLength;
|
||||
|
||||
phase = DecodePhase.CopyMatch;
|
||||
goto copyMatch;
|
||||
phase = DecodePhase.CopyMatch;
|
||||
goto copyMatch;
|
||||
|
||||
copyMatch:
|
||||
int nCpyMat = matLen < nToRead ? matLen : nToRead;
|
||||
if( nCpyMat != 0 )
|
||||
{
|
||||
nRead = count - nToRead;
|
||||
copyMatch:
|
||||
int nCpyMat = matLen < nToRead ? matLen : nToRead;
|
||||
if (nCpyMat != 0)
|
||||
{
|
||||
nRead = count - nToRead;
|
||||
|
||||
int bufDst = matDst - nRead;
|
||||
if( bufDst > 0 )
|
||||
{
|
||||
//offset is fairly far back, we need to pull from the buffer
|
||||
int bufDst = matDst - nRead;
|
||||
if (bufDst > 0)
|
||||
{
|
||||
//offset is fairly far back, we need to pull from the buffer
|
||||
|
||||
int bufSrc = decodeBufferPos - bufDst;
|
||||
if( bufSrc < 0 )
|
||||
bufSrc += DecBufLen;
|
||||
int bufCnt = bufDst < nCpyMat ? bufDst : nCpyMat;
|
||||
int bufSrc = decodeBufferPos - bufDst;
|
||||
if (bufSrc < 0)
|
||||
bufSrc += DecBufLen;
|
||||
int bufCnt = bufDst < nCpyMat ? bufDst : nCpyMat;
|
||||
|
||||
for( int c = bufCnt; c-- != 0; )
|
||||
buffer[offset++] = decBuf[bufSrc++ & DecBufMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
bufDst = 0;
|
||||
}
|
||||
for (int c = bufCnt; c-- != 0;)
|
||||
buffer[offset++] = decBuf[bufSrc++ & DecBufMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
bufDst = 0;
|
||||
}
|
||||
|
||||
int sOfs = offset - matDst;
|
||||
for( int i = bufDst; i < nCpyMat; i++ )
|
||||
buffer[offset++] = buffer[sOfs++];
|
||||
int sOfs = offset - matDst;
|
||||
for (int i = bufDst; i < nCpyMat; i++)
|
||||
buffer[offset++] = buffer[sOfs++];
|
||||
|
||||
nToRead -= nCpyMat;
|
||||
matLen -= nCpyMat;
|
||||
}
|
||||
nToRead -= nCpyMat;
|
||||
matLen -= nCpyMat;
|
||||
}
|
||||
|
||||
if( nToRead == 0 )
|
||||
goto finish;
|
||||
if (nToRead == 0)
|
||||
goto finish;
|
||||
|
||||
phase = DecodePhase.ReadToken;
|
||||
goto readToken;
|
||||
phase = DecodePhase.ReadToken;
|
||||
goto readToken;
|
||||
|
||||
finish:
|
||||
nRead = count - nToRead;
|
||||
finish:
|
||||
nRead = count - nToRead;
|
||||
|
||||
int nToBuf = nRead < DecBufLen ? nRead : DecBufLen;
|
||||
int repPos = offset - nToBuf;
|
||||
int nToBuf = nRead < DecBufLen ? nRead : DecBufLen;
|
||||
int repPos = offset - nToBuf;
|
||||
|
||||
if( nToBuf == DecBufLen )
|
||||
{
|
||||
Buffer.BlockCopy( buffer, repPos, decBuf, 0, DecBufLen );
|
||||
decodeBufferPos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int decPos = decodeBufferPos;
|
||||
if (nToBuf == DecBufLen)
|
||||
{
|
||||
Buffer.BlockCopy(buffer, repPos, decBuf, 0, DecBufLen);
|
||||
decodeBufferPos = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int decPos = decodeBufferPos;
|
||||
|
||||
while( nToBuf-- != 0 )
|
||||
decBuf[decPos++ & DecBufMask] = buffer[repPos++];
|
||||
while (nToBuf-- != 0)
|
||||
decBuf[decPos++ & DecBufMask] = buffer[repPos++];
|
||||
|
||||
decodeBufferPos = decPos & DecBufMask;
|
||||
}
|
||||
decodeBufferPos = decPos & DecBufMask;
|
||||
}
|
||||
|
||||
#if LOCAL_SHADOW
|
||||
this.phase = phase;
|
||||
this.inBufPos = inBufPos;
|
||||
#endif
|
||||
return nRead;
|
||||
}
|
||||
return nRead;
|
||||
}
|
||||
|
||||
private int ReadByteCore()
|
||||
{
|
||||
var buf = decodeBuffer;
|
||||
private int ReadByteCore()
|
||||
{
|
||||
var buf = decodeBuffer;
|
||||
|
||||
if( inBufPos == inBufEnd )
|
||||
{
|
||||
int nRead = input.Read( buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength );
|
||||
if (inBufPos == inBufEnd)
|
||||
{
|
||||
int nRead = input.Read(buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength);
|
||||
|
||||
#if CHECK_EOF
|
||||
if( nRead == 0 )
|
||||
return -1;
|
||||
if (nRead == 0)
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
inputLength -= nRead;
|
||||
inputLength -= nRead;
|
||||
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
}
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
}
|
||||
|
||||
return buf[inBufPos++];
|
||||
}
|
||||
return buf[inBufPos++];
|
||||
}
|
||||
|
||||
private int ReadOffsetCore()
|
||||
{
|
||||
var buf = decodeBuffer;
|
||||
private int ReadOffsetCore()
|
||||
{
|
||||
var buf = decodeBuffer;
|
||||
|
||||
if( inBufPos == inBufEnd )
|
||||
{
|
||||
int nRead = input.Read( buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength );
|
||||
if (inBufPos == inBufEnd)
|
||||
{
|
||||
int nRead = input.Read(buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength);
|
||||
|
||||
#if CHECK_EOF
|
||||
if( nRead == 0 )
|
||||
return -1;
|
||||
if (nRead == 0)
|
||||
return -1;
|
||||
#endif
|
||||
|
||||
inputLength -= nRead;
|
||||
inputLength -= nRead;
|
||||
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
}
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
}
|
||||
|
||||
if( inBufEnd - inBufPos == 1 )
|
||||
{
|
||||
buf[DecBufLen] = buf[inBufPos];
|
||||
if (inBufEnd - inBufPos == 1)
|
||||
{
|
||||
buf[DecBufLen] = buf[inBufPos];
|
||||
|
||||
int nRead = input.Read( buf, DecBufLen + 1,
|
||||
InBufLen - 1 < inputLength ? InBufLen - 1 : (int)inputLength );
|
||||
int nRead = input.Read(buf, DecBufLen + 1,
|
||||
InBufLen - 1 < inputLength ? InBufLen - 1 : (int)inputLength);
|
||||
|
||||
#if CHECK_EOF
|
||||
if( nRead == 0 )
|
||||
{
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + 1;
|
||||
if (nRead == 0)
|
||||
{
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
inputLength -= nRead;
|
||||
inputLength -= nRead;
|
||||
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead + 1;
|
||||
}
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead + 1;
|
||||
}
|
||||
|
||||
int ret = (buf[inBufPos + 1] << 8) | buf[inBufPos];
|
||||
inBufPos += 2;
|
||||
int ret = (buf[inBufPos + 1] << 8) | buf[inBufPos];
|
||||
inBufPos += 2;
|
||||
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private int ReadCore( byte[] buffer, int offset, int count )
|
||||
{
|
||||
int nToRead = count;
|
||||
private int ReadCore(byte[] buffer, int offset, int count)
|
||||
{
|
||||
int nToRead = count;
|
||||
|
||||
var buf = decodeBuffer;
|
||||
int inBufLen = inBufEnd - inBufPos;
|
||||
var buf = decodeBuffer;
|
||||
int inBufLen = inBufEnd - inBufPos;
|
||||
|
||||
int fromBuf = nToRead < inBufLen ? nToRead : inBufLen;
|
||||
if( fromBuf != 0 )
|
||||
{
|
||||
var bufPos = inBufPos;
|
||||
int fromBuf = nToRead < inBufLen ? nToRead : inBufLen;
|
||||
if (fromBuf != 0)
|
||||
{
|
||||
var bufPos = inBufPos;
|
||||
|
||||
for( int c = fromBuf; c-- != 0; )
|
||||
buffer[offset++] = buf[bufPos++];
|
||||
for (int c = fromBuf; c-- != 0;)
|
||||
buffer[offset++] = buf[bufPos++];
|
||||
|
||||
inBufPos = bufPos;
|
||||
nToRead -= fromBuf;
|
||||
}
|
||||
inBufPos = bufPos;
|
||||
nToRead -= fromBuf;
|
||||
}
|
||||
|
||||
if( nToRead != 0 )
|
||||
{
|
||||
int nRead;
|
||||
if (nToRead != 0)
|
||||
{
|
||||
int nRead;
|
||||
|
||||
if( nToRead >= InBufLen )
|
||||
{
|
||||
nRead = input.Read( buffer, offset,
|
||||
nToRead < inputLength ? nToRead : (int)inputLength );
|
||||
nToRead -= nRead;
|
||||
}
|
||||
else
|
||||
{
|
||||
nRead = input.Read( buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength );
|
||||
if (nToRead >= InBufLen)
|
||||
{
|
||||
nRead = input.Read(buffer, offset,
|
||||
nToRead < inputLength ? nToRead : (int)inputLength);
|
||||
nToRead -= nRead;
|
||||
}
|
||||
else
|
||||
{
|
||||
nRead = input.Read(buf, DecBufLen,
|
||||
InBufLen < inputLength ? InBufLen : (int)inputLength);
|
||||
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
inBufPos = DecBufLen;
|
||||
inBufEnd = DecBufLen + nRead;
|
||||
|
||||
fromBuf = nToRead < nRead ? nToRead : nRead;
|
||||
fromBuf = nToRead < nRead ? nToRead : nRead;
|
||||
|
||||
var bufPos = inBufPos;
|
||||
var bufPos = inBufPos;
|
||||
|
||||
for( int c = fromBuf; c-- != 0; )
|
||||
buffer[offset++] = buf[bufPos++];
|
||||
for (int c = fromBuf; c-- != 0;)
|
||||
buffer[offset++] = buf[bufPos++];
|
||||
|
||||
inBufPos = bufPos;
|
||||
nToRead -= fromBuf;
|
||||
}
|
||||
inBufPos = bufPos;
|
||||
nToRead -= fromBuf;
|
||||
}
|
||||
|
||||
inputLength -= nRead;
|
||||
}
|
||||
inputLength -= nRead;
|
||||
}
|
||||
|
||||
return count - nToRead;
|
||||
}
|
||||
return count - nToRead;
|
||||
}
|
||||
|
||||
#region Stream internals
|
||||
#region Stream internals
|
||||
|
||||
public override bool CanRead
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
public override bool CanRead => true;
|
||||
|
||||
public override bool CanSeek
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
public override bool CanSeek => false;
|
||||
|
||||
public override bool CanWrite
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
public override bool CanWrite => false;
|
||||
|
||||
public override void Flush()
|
||||
{
|
||||
}
|
||||
public override void Flush()
|
||||
{
|
||||
}
|
||||
|
||||
public override long Length
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
}
|
||||
public override long Length
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
}
|
||||
|
||||
public override long Position
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
set { throw new NotSupportedException(); }
|
||||
}
|
||||
public override long Position
|
||||
{
|
||||
get { throw new NotSupportedException(); }
|
||||
set { throw new NotSupportedException(); }
|
||||
}
|
||||
|
||||
public override long Seek( long offset, SeekOrigin origin )
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void SetLength( long value )
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override void Write( byte[] buffer, int offset, int count )
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Web.Script.Serialization;
|
||||
using ManagedFbx;
|
||||
|
||||
|
||||
namespace Unity_Studio
|
||||
@@ -239,7 +240,7 @@ namespace Unity_Studio
|
||||
return extractedCount;
|
||||
}
|
||||
|
||||
public static void BuildAssetStructures(bool loadAssetsMenuItem, bool displayAll, bool buildHierarchyMenuItem, bool buildClassStructuresMenuItem)
|
||||
public static void BuildAssetStructures(bool loadAssetsMenuItem, bool displayAll, bool buildHierarchyMenuItem, bool buildClassStructuresMenuItem, bool displayOriginalName)
|
||||
{
|
||||
#region first loop - read asset data & create list
|
||||
if (loadAssetsMenuItem)
|
||||
@@ -254,7 +255,7 @@ namespace Unity_Studio
|
||||
StatusStripUpdate("Building asset list from " + Path.GetFileName(assetsFile.filePath));
|
||||
|
||||
string fileID = i.ToString(fileIDfmt);
|
||||
|
||||
AssetBundle ab = null;
|
||||
foreach (var asset in assetsFile.preloadTable.Values)
|
||||
{
|
||||
asset.uniqueID = fileID + asset.uniqueID;
|
||||
@@ -280,7 +281,6 @@ namespace Unity_Studio
|
||||
assetsFile.TransformList.Add(asset.m_PathID, m_Rect.m_Transform);
|
||||
break;
|
||||
}
|
||||
//case 21: //Material
|
||||
case 28: //Texture2D
|
||||
{
|
||||
Texture2D m_Texture2D = new Texture2D(asset, false);
|
||||
@@ -324,8 +324,18 @@ namespace Unity_Studio
|
||||
productName = plSet.productName;
|
||||
break;
|
||||
}
|
||||
case 21: //Material
|
||||
case 43: //Mesh
|
||||
{
|
||||
Mesh m_Mesh = new Mesh(asset, false);
|
||||
exportable = true;
|
||||
break;
|
||||
}
|
||||
case 142: //AssetBundle
|
||||
{
|
||||
ab = new AssetBundle(asset);
|
||||
break;
|
||||
}
|
||||
case 21: //Material
|
||||
case 74: //AnimationClip
|
||||
case 90: //Avatar
|
||||
case 91: //AnimatorController
|
||||
@@ -360,10 +370,20 @@ namespace Unity_Studio
|
||||
{
|
||||
asset.Text += " #" + asset.uniqueID;
|
||||
}
|
||||
asset.Text = FixFileName(asset.Text);
|
||||
assetsFile.exportableAssets.Add(asset);
|
||||
}
|
||||
ProgressBarPerformStep();
|
||||
}
|
||||
if (displayOriginalName)
|
||||
{
|
||||
assetsFile.exportableAssets.ForEach(x =>
|
||||
{
|
||||
var replacename = ab?.m_Container.Find(y => y.second.asset.m_PathID == x.m_PathID)?.first;
|
||||
if (!string.IsNullOrEmpty(replacename))
|
||||
x.Text = replacename.Replace(Path.GetExtension(replacename), "");
|
||||
});
|
||||
}
|
||||
exportableAssets.AddRange(assetsFile.exportableAssets);
|
||||
//if (assetGroup.Items.Count > 0) { listView1.Groups.Add(assetGroup); }
|
||||
}
|
||||
@@ -380,6 +400,7 @@ namespace Unity_Studio
|
||||
fileNodes = new List<GameObject>();
|
||||
if (buildHierarchyMenuItem)
|
||||
{
|
||||
SetProgressBarMaximum(1);
|
||||
SetProgressBarValue(1);
|
||||
SetProgressBarMaximum(assetsfileList.Sum(x => x.GameObjectList.Values.Count) + 1);
|
||||
foreach (var assetsFile in assetsfileList)
|
||||
@@ -919,7 +940,7 @@ namespace Unity_Studio
|
||||
//StatusStripUpdate("Writing Geometry");
|
||||
foreach (var MeshPD in Meshes)
|
||||
{
|
||||
Mesh m_Mesh = new Mesh(MeshPD);
|
||||
Mesh m_Mesh = new Mesh(MeshPD, true);
|
||||
MeshFBX(m_Mesh, MeshPD.uniqueID, ob);
|
||||
|
||||
//write data 8MB at a time
|
||||
@@ -950,7 +971,7 @@ namespace Unity_Studio
|
||||
//find a way to test if a mesh instance was loaded previously and if it uses the same skeleton, then create instance or copy
|
||||
var keepID = MeshPD.uniqueID;
|
||||
MeshPD.uniqueID = SkinnedMeshPD.uniqueID;
|
||||
Mesh m_Mesh = new Mesh(MeshPD);
|
||||
Mesh m_Mesh = new Mesh(MeshPD, true);
|
||||
MeshFBX(m_Mesh, MeshPD.uniqueID, ob);
|
||||
|
||||
//write data 8MB at a time
|
||||
@@ -1084,10 +1105,6 @@ namespace Unity_Studio
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//bool stop = true;
|
||||
}
|
||||
}
|
||||
|
||||
MeshPD.uniqueID = keepID;
|
||||
@@ -1120,7 +1137,7 @@ namespace Unity_Studio
|
||||
//TODO check texture type and set path accordingly; eg. CubeMap, Texture3D
|
||||
string texPathName = Path.GetDirectoryName(FBXfile) + "\\Texture2D\\";
|
||||
ExportTexture(TexturePD, texPathName, false);
|
||||
texPathName += TexturePD.Text + ".png";//必须是png文件
|
||||
texPathName = Path.GetFullPath(Path.Combine(texPathName, $"{TexturePD.Text}.png"));//必须是png文件
|
||||
ob.AppendFormat("\n\tTexture: 7{0}, \"Texture::{1}\", \"\" {{", TexturePD.uniqueID, TexturePD.Text);
|
||||
ob.Append("\n\t\tType: \"TextureVideoClip\"");
|
||||
ob.Append("\n\t\tVersion: 202");
|
||||
@@ -1131,7 +1148,7 @@ namespace Unity_Studio
|
||||
ob.Append("\n\t\t}");
|
||||
ob.AppendFormat("\n\t\tMedia: \"Video::{0}\"", TexturePD.Text);
|
||||
ob.AppendFormat("\n\t\tFileName: \"{0}\"", texPathName);
|
||||
ob.AppendFormat("\n\t\tRelativeFilename: \"Texture2D\\{0}\"", Path.GetFileName(texPathName));
|
||||
ob.AppendFormat("\n\t\tRelativeFilename: \"{0}\"", texPathName.Replace($"{Path.GetDirectoryName(FBXfile)}\\", ""));
|
||||
ob.Append("\n\t}");
|
||||
|
||||
ob.AppendFormat("\n\tVideo: 8{0}, \"Video::{1}\", \"Clip\" {{", TexturePD.uniqueID, TexturePD.Text);
|
||||
@@ -1140,7 +1157,7 @@ namespace Unity_Studio
|
||||
ob.AppendFormat("\n\t\t\tP: \"Path\", \"KString\", \"XRefUrl\", \"\", \"{0}\"", texPathName);
|
||||
ob.Append("\n\t\t}");
|
||||
ob.AppendFormat("\n\t\tFileName: \"{0}\"", texPathName);
|
||||
ob.AppendFormat("\n\t\tRelativeFilename: \"Texture2D\\{0}\"", Path.GetFileName(texPathName));
|
||||
ob.AppendFormat("\n\t\tRelativeFilename: \"{0}\"", texPathName.Replace($"{Path.GetDirectoryName(FBXfile)}\\", ""));
|
||||
ob.Append("\n\t}");
|
||||
|
||||
//connect video to texture
|
||||
@@ -1632,7 +1649,8 @@ namespace Unity_Studio
|
||||
public static bool ExportAudioClip(AssetPreloadData asset, string exportFilename, string exportFileextension)
|
||||
{
|
||||
var oldextension = exportFileextension;
|
||||
if ((bool)Properties.Settings.Default["convertfsb"] && exportFileextension == ".fsb")
|
||||
var convertfsb = (bool)Properties.Settings.Default["convertfsb"];
|
||||
if (convertfsb && exportFileextension == ".fsb")
|
||||
{
|
||||
exportFileextension = ".wav";
|
||||
}
|
||||
@@ -1640,7 +1658,7 @@ namespace Unity_Studio
|
||||
if (ExportFileExists(exportFullname))
|
||||
return false;
|
||||
var m_AudioClip = new AudioClip(asset, true);
|
||||
if ((bool)Properties.Settings.Default["convertfsb"] && oldextension == ".fsb")
|
||||
if (convertfsb && oldextension == ".fsb")
|
||||
{
|
||||
FMOD.System system;
|
||||
FMOD.Sound sound;
|
||||
@@ -1733,6 +1751,131 @@ namespace Unity_Studio
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExportMesh(Mesh m_Mesh, string exportPath)
|
||||
{
|
||||
Scene m_scene = Scene.CreateScene("Scene");
|
||||
SceneNode root = m_scene.RootNode;
|
||||
SceneNode meshnode = Scene.CreateNode(m_scene, m_Mesh.m_Name);
|
||||
SceneNode.AddChild(root, meshnode);
|
||||
ManagedFbx.Mesh mesh = Scene.CreateMesh(m_scene, meshnode, "Mesh");
|
||||
if (m_Mesh.m_VertexCount > 0)
|
||||
{
|
||||
#region Vertices
|
||||
int count = 3;
|
||||
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
|
||||
{
|
||||
count = 4;
|
||||
}
|
||||
var vertices = new Vector3[m_Mesh.m_VertexCount];
|
||||
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
||||
{
|
||||
vertices[v] = new Vector3(
|
||||
m_Mesh.m_Vertices[v * count],
|
||||
m_Mesh.m_Vertices[v * count + 1],
|
||||
m_Mesh.m_Vertices[v * count + 2]);
|
||||
}
|
||||
mesh.Vertices = vertices;
|
||||
#endregion
|
||||
#region Indicies
|
||||
List<int> indices = new List<int>();
|
||||
for (int i = 0; i < m_Mesh.m_Indices.Count; i = i + 3)
|
||||
{
|
||||
indices.Add((int)m_Mesh.m_Indices[i]);
|
||||
indices.Add((int)m_Mesh.m_Indices[i + 1]);
|
||||
indices.Add((int)m_Mesh.m_Indices[i + 2]);
|
||||
}
|
||||
mesh.AddPolygons(indices, 0);
|
||||
#endregion
|
||||
#region Normals
|
||||
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
|
||||
{
|
||||
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
|
||||
{
|
||||
count = 3;
|
||||
}
|
||||
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
|
||||
{
|
||||
count = 4;
|
||||
}
|
||||
|
||||
var normals = new Vector3[m_Mesh.m_VertexCount];
|
||||
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
||||
{
|
||||
normals[n] = new Vector3(
|
||||
m_Mesh.m_Normals[n * count],
|
||||
m_Mesh.m_Normals[n * count + 1],
|
||||
m_Mesh.m_Normals[n * count + 2]);
|
||||
}
|
||||
mesh.Normals = normals;
|
||||
}
|
||||
#endregion
|
||||
#region Colors
|
||||
if (m_Mesh.m_Colors == null)
|
||||
{
|
||||
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colors[c] = new Colour(
|
||||
0.5f, 0.5f, 0.5f, 1.0f);
|
||||
}
|
||||
mesh.VertexColours = colors;
|
||||
}
|
||||
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||
{
|
||||
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colors[c] = new Colour(
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
1.0f);
|
||||
}
|
||||
mesh.VertexColours = colors;
|
||||
}
|
||||
else
|
||||
{
|
||||
var colors = new Colour[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colors[c] = new Colour(
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
m_Mesh.m_Colors[c * 4 + 3]);
|
||||
}
|
||||
mesh.VertexColours = colors;
|
||||
}
|
||||
#endregion
|
||||
#region UV
|
||||
if (m_Mesh.m_UV1 != null && m_Mesh.m_UV1.Length == m_Mesh.m_VertexCount * 2)
|
||||
{
|
||||
var uv = new Vector2[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
uv[c] = new Vector2(m_Mesh.m_UV1[c * 2], m_Mesh.m_UV1[c * 2 + 1]);
|
||||
}
|
||||
mesh.TextureCoords = uv;
|
||||
}
|
||||
else if (m_Mesh.m_UV2 != null && m_Mesh.m_UV2.Length == m_Mesh.m_VertexCount * 2)
|
||||
{
|
||||
var uv = new Vector2[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
uv[c] = new Vector2(m_Mesh.m_UV2[c * 2], m_Mesh.m_UV2[c * 2 + 1]);
|
||||
}
|
||||
mesh.TextureCoords = uv;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
SceneNode.AddMesh(meshnode, mesh);
|
||||
|
||||
//m_scene.Save(exportPath); //default is .fbx
|
||||
//m_scene.Save(exportPath + ".fbx");
|
||||
m_scene.Save(exportPath + ".obj");
|
||||
//m_scene.Save(exportPath + ".dae");
|
||||
}
|
||||
|
||||
public static bool ExportFileExists(string filename)
|
||||
{
|
||||
if (File.Exists(filename))
|
||||
@@ -1742,5 +1885,11 @@ namespace Unity_Studio
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(filename));
|
||||
return false;
|
||||
}
|
||||
|
||||
private static string FixFileName(string str)
|
||||
{
|
||||
if (str.Length >= 260) return Path.GetRandomFileName();
|
||||
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
262
Unity Studio/Unity Studio-x86.csproj
Normal file
262
Unity Studio/Unity Studio-x86.csproj
Normal file
@@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F5E07FB2-95E4-417F-943F-D439D9A03BBA}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Unity_Studio</RootNamespace>
|
||||
<AssemblyName>Unity Studio</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\unity.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ManagedFbx, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\x86\ManagedFbx.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\OpenTK.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK.GLControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\OpenTK.GLControl.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Half, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\System.Half.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="7zip\Common\CommandLineParser.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Common\CRC.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Common\InBuffer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Common\OutBuffer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZMA\LzmaBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZMA\LzmaDecoder.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZMA\LzmaEncoder.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZ\IMatchFinder.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZ\LzBinTree.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZ\LzInWindow.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\LZ\LzOutWindow.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\RangeCoder\RangeCoder.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\RangeCoder\RangeCoderBit.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\Compress\RangeCoder\RangeCoderBitTree.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\ICoder.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="7zip\SevenZipHelper.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AboutBox.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AboutBox.Designer.cs">
|
||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Unity Classes\AssetBundle.cs" />
|
||||
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
|
||||
<Compile Include="Unity Classes\AudioClip.cs" />
|
||||
<Compile Include="Unity Classes\BuildSettings.cs" />
|
||||
<Compile Include="Unity Studio Classes\BundleFile.cs" />
|
||||
<Compile Include="Unity Studio Classes\UnityStudio.cs" />
|
||||
<Compile Include="Unity Studio Classes\ClassIDReference.cs" />
|
||||
<Compile Include="Unity Studio Classes\EndianStream.cs" />
|
||||
<Compile Include="ExportOptions.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExportOptions.Designer.cs">
|
||||
<DependentUpon>ExportOptions.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FMOD Studio API\fmod.cs" />
|
||||
<Compile Include="FMOD Studio API\fmod_dsp.cs" />
|
||||
<Compile Include="FMOD Studio API\fmod_errors.cs" />
|
||||
<Compile Include="Unity Classes\Font.cs" />
|
||||
<Compile Include="GOHierarchy.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Unity Studio Classes\Lz4DecoderStream.cs" />
|
||||
<Compile Include="Unity Classes\Material.cs" />
|
||||
<Compile Include="Unity Classes\Mesh.cs" />
|
||||
<Compile Include="Unity Classes\GameObject.cs" />
|
||||
<Compile Include="Unity Studio Classes\helpers.cs" />
|
||||
<Compile Include="Unity Classes\MonoBehaviour.cs" />
|
||||
<Compile Include="Unity Classes\PlayerSettings.cs" />
|
||||
<Compile Include="Unity Classes\RectTransform.cs" />
|
||||
<Compile Include="Unity Classes\MeshRenderer.cs" />
|
||||
<Compile Include="Unity Classes\Shader.cs" />
|
||||
<Compile Include="Unity Classes\SkinnedMeshRenderer.cs" />
|
||||
<Compile Include="Unity Classes\MeshFilter.cs" />
|
||||
<Compile Include="Unity Classes\TextAsset.cs" />
|
||||
<Compile Include="Unity Classes\Texture2D.cs" />
|
||||
<Compile Include="Unity Classes\Transform.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Unity Studio Classes\AssetsFile.cs" />
|
||||
<Compile Include="UnityStudioForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UnityStudioForm.Designer.cs">
|
||||
<DependentUpon>UnityStudioForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="AboutBox.resx">
|
||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ExportOptions.resx">
|
||||
<DependentUpon>ExportOptions.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="UnityStudioForm.resx">
|
||||
<DependentUpon>UnityStudioForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="fs.glsl">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="vs.glsl">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 4.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\unity.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\preview.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy /y "$(ProjectDir)library" "$(TargetDir)"
|
||||
xcopy /y "$(ProjectDir)library\$(PlatformName)" "$(TargetDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -14,6 +14,7 @@
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
@@ -26,31 +27,9 @@
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\unity.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
@@ -72,19 +51,37 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ManagedFbx, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\x64\ManagedFbx.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\OpenTK.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="OpenTK.GLControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\OpenTK.GLControl.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Half, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>library\System.Half.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
@@ -144,6 +141,7 @@
|
||||
<Compile Include="AboutBox.Designer.cs">
|
||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Unity Classes\AssetBundle.cs" />
|
||||
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
|
||||
<Compile Include="Unity Classes\AudioClip.cs" />
|
||||
<Compile Include="Unity Classes\BuildSettings.cs" />
|
||||
@@ -210,6 +208,9 @@
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<None Include="app.config" />
|
||||
<None Include="fs.glsl">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -219,6 +220,9 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<None Include="vs.glsl">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
|
||||
191
Unity Studio/UnityStudioForm.Designer.cs
generated
191
Unity Studio/UnityStudioForm.Designer.cs
generated
@@ -45,6 +45,7 @@
|
||||
this.exportClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.displayAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.displayOriginalName = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.enablePreview = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.displayInfo = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openAfterExport = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -52,6 +53,7 @@
|
||||
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportAll3DMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.all3DObjectssplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportSelected3DMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.exportAllAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -62,7 +64,7 @@
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||
this.sceneTreeView = new Unity_Studio.GOHierarchy();
|
||||
this.sceneTreeView = new GOHierarchy();
|
||||
this.treeSearch = new System.Windows.Forms.TextBox();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.assetListView = new System.Windows.Forms.ListView();
|
||||
@@ -87,6 +89,7 @@
|
||||
this.FMODplayButton = new System.Windows.Forms.Button();
|
||||
this.fontPreviewBox = new System.Windows.Forms.RichTextBox();
|
||||
this.textPreviewBox = new System.Windows.Forms.TextBox();
|
||||
this.glControl1 = new OpenTK.GLControl();
|
||||
this.classPreviewPanel = new System.Windows.Forms.Panel();
|
||||
this.classTextBox = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
@@ -96,12 +99,12 @@
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.timer = new System.Windows.Forms.Timer(this.components);
|
||||
this.timerOpenTK = new System.Windows.Forms.Timer(this.components);
|
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.openFolderDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
this.saveFolderDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.all3DObjectssplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
@@ -111,6 +114,7 @@
|
||||
this.tabPage1.SuspendLayout();
|
||||
this.tabPage2.SuspendLayout();
|
||||
this.progressbarPanel.SuspendLayout();
|
||||
this.glControl1.SuspendLayout();
|
||||
this.previewPanel.SuspendLayout();
|
||||
this.FMODpanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.FMODprogressBar)).BeginInit();
|
||||
@@ -130,7 +134,7 @@
|
||||
this.helpToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(1264, 25);
|
||||
this.menuStrip1.Size = new System.Drawing.Size(1264, 24);
|
||||
this.menuStrip1.TabIndex = 0;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
@@ -143,39 +147,39 @@
|
||||
this.extractBundleToolStripMenuItem,
|
||||
this.extractFolderToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(39, 21);
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "File";
|
||||
//
|
||||
// loadFileToolStripMenuItem
|
||||
//
|
||||
this.loadFileToolStripMenuItem.Name = "loadFileToolStripMenuItem";
|
||||
this.loadFileToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.loadFileToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.loadFileToolStripMenuItem.Text = "Load file...";
|
||||
this.loadFileToolStripMenuItem.Click += new System.EventHandler(this.loadFile_Click);
|
||||
//
|
||||
// loadFolderToolStripMenuItem
|
||||
//
|
||||
this.loadFolderToolStripMenuItem.Name = "loadFolderToolStripMenuItem";
|
||||
this.loadFolderToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.loadFolderToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.loadFolderToolStripMenuItem.Text = "Load folder...";
|
||||
this.loadFolderToolStripMenuItem.Click += new System.EventHandler(this.loadFolder_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(165, 6);
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(155, 6);
|
||||
//
|
||||
// extractBundleToolStripMenuItem
|
||||
//
|
||||
this.extractBundleToolStripMenuItem.Name = "extractBundleToolStripMenuItem";
|
||||
this.extractBundleToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.extractBundleToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.extractBundleToolStripMenuItem.Text = "Extract bundle...";
|
||||
this.extractBundleToolStripMenuItem.Click += new System.EventHandler(this.extractBundleToolStripMenuItem_Click);
|
||||
//
|
||||
// extractFolderToolStripMenuItem
|
||||
//
|
||||
this.extractFolderToolStripMenuItem.Name = "extractFolderToolStripMenuItem";
|
||||
this.extractFolderToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
|
||||
this.extractFolderToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
|
||||
this.extractFolderToolStripMenuItem.Text = "Extract folder...";
|
||||
this.extractFolderToolStripMenuItem.Click += new System.EventHandler(this.extractFolderToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -188,7 +192,7 @@
|
||||
this.toolStripSeparator2,
|
||||
this.exportClassStructuresMenuItem});
|
||||
this.debugMenuItem.Name = "debugMenuItem";
|
||||
this.debugMenuItem.Size = new System.Drawing.Size(87, 21);
|
||||
this.debugMenuItem.Size = new System.Drawing.Size(80, 20);
|
||||
this.debugMenuItem.Text = "Diagnostics";
|
||||
this.debugMenuItem.Visible = false;
|
||||
//
|
||||
@@ -196,14 +200,14 @@
|
||||
//
|
||||
this.buildClassStructuresMenuItem.CheckOnClick = true;
|
||||
this.buildClassStructuresMenuItem.Name = "buildClassStructuresMenuItem";
|
||||
this.buildClassStructuresMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.buildClassStructuresMenuItem.Size = new System.Drawing.Size(208, 22);
|
||||
this.buildClassStructuresMenuItem.Text = "Build class structures";
|
||||
//
|
||||
// dontLoadAssetsMenuItem
|
||||
//
|
||||
this.dontLoadAssetsMenuItem.CheckOnClick = true;
|
||||
this.dontLoadAssetsMenuItem.Name = "dontLoadAssetsMenuItem";
|
||||
this.dontLoadAssetsMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.dontLoadAssetsMenuItem.Size = new System.Drawing.Size(208, 22);
|
||||
this.dontLoadAssetsMenuItem.Text = "Don\'t load assets";
|
||||
this.dontLoadAssetsMenuItem.CheckedChanged += new System.EventHandler(this.dontLoadAssetsMenuItem_CheckedChanged);
|
||||
//
|
||||
@@ -211,18 +215,18 @@
|
||||
//
|
||||
this.dontBuildHierarchyMenuItem.CheckOnClick = true;
|
||||
this.dontBuildHierarchyMenuItem.Name = "dontBuildHierarchyMenuItem";
|
||||
this.dontBuildHierarchyMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.dontBuildHierarchyMenuItem.Size = new System.Drawing.Size(208, 22);
|
||||
this.dontBuildHierarchyMenuItem.Text = "Don\'t build hierarchy tree";
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
|
||||
//
|
||||
// exportClassStructuresMenuItem
|
||||
//
|
||||
this.exportClassStructuresMenuItem.Name = "exportClassStructuresMenuItem";
|
||||
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(208, 22);
|
||||
this.exportClassStructuresMenuItem.Text = "Export class structures";
|
||||
this.exportClassStructuresMenuItem.Click += new System.EventHandler(this.exportClassStructuresMenuItem_Click);
|
||||
//
|
||||
@@ -230,15 +234,25 @@
|
||||
//
|
||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.displayAll,
|
||||
this.displayOriginalName,
|
||||
this.enablePreview,
|
||||
this.displayInfo,
|
||||
this.openAfterExport,
|
||||
this.assetGroupOptions,
|
||||
this.showExpOpt});
|
||||
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21);
|
||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||
this.optionsToolStripMenuItem.Text = "Options";
|
||||
//
|
||||
// displayOriginalName
|
||||
//
|
||||
this.displayOriginalName.CheckOnClick = true;
|
||||
this.displayOriginalName.Name = "displayOriginalName";
|
||||
this.displayOriginalName.Size = new System.Drawing.Size(252, 22);
|
||||
this.displayOriginalName.Text = "Display asset original name";
|
||||
this.displayOriginalName.ToolTipText = "Check this option will use asset original name when display and export";
|
||||
this.displayOriginalName.CheckedChanged += new System.EventHandler(this.MenuItem_CheckedChanged);
|
||||
//
|
||||
// displayAll
|
||||
//
|
||||
this.displayAll.CheckOnClick = true;
|
||||
@@ -290,7 +304,7 @@
|
||||
"Group exported assets by source file",
|
||||
"Do not group exported assets"});
|
||||
this.assetGroupOptions.Name = "assetGroupOptions";
|
||||
this.assetGroupOptions.Size = new System.Drawing.Size(192, 25);
|
||||
this.assetGroupOptions.Size = new System.Drawing.Size(192, 23);
|
||||
this.assetGroupOptions.SelectedIndexChanged += new System.EventHandler(this.assetGroupOptions_SelectedIndexChanged);
|
||||
//
|
||||
// showExpOpt
|
||||
@@ -311,46 +325,53 @@
|
||||
this.exportSelectedAssetsMenuItem,
|
||||
this.exportFilteredAssetsMenuItem});
|
||||
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
|
||||
this.exportToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
|
||||
this.exportToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
|
||||
this.exportToolStripMenuItem.Text = "Export";
|
||||
//
|
||||
// exportAll3DMenuItem
|
||||
//
|
||||
this.exportAll3DMenuItem.Name = "exportAll3DMenuItem";
|
||||
this.exportAll3DMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.exportAll3DMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.exportAll3DMenuItem.Text = "All 3D objects";
|
||||
this.exportAll3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
|
||||
//
|
||||
// all3DObjectssplitToolStripMenuItem
|
||||
//
|
||||
this.all3DObjectssplitToolStripMenuItem.Name = "all3DObjectssplitToolStripMenuItem";
|
||||
this.all3DObjectssplitToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.all3DObjectssplitToolStripMenuItem.Text = "All 3D objects (split)";
|
||||
this.all3DObjectssplitToolStripMenuItem.Click += new System.EventHandler(this.all3DObjectssplitToolStripMenuItem_Click);
|
||||
//
|
||||
// exportSelected3DMenuItem
|
||||
//
|
||||
this.exportSelected3DMenuItem.Name = "exportSelected3DMenuItem";
|
||||
this.exportSelected3DMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.exportSelected3DMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.exportSelected3DMenuItem.Text = "Selected 3D objects";
|
||||
this.exportSelected3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(189, 6);
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(176, 6);
|
||||
//
|
||||
// exportAllAssetsMenuItem
|
||||
//
|
||||
this.exportAllAssetsMenuItem.Name = "exportAllAssetsMenuItem";
|
||||
this.exportAllAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.exportAllAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.exportAllAssetsMenuItem.Text = "All assets";
|
||||
this.exportAllAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
|
||||
//
|
||||
// exportSelectedAssetsMenuItem
|
||||
//
|
||||
this.exportSelectedAssetsMenuItem.Name = "exportSelectedAssetsMenuItem";
|
||||
this.exportSelectedAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.exportSelectedAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.exportSelectedAssetsMenuItem.Text = "Selected assets";
|
||||
this.exportSelectedAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
|
||||
//
|
||||
// exportFilteredAssetsMenuItem
|
||||
//
|
||||
this.exportFilteredAssetsMenuItem.Name = "exportFilteredAssetsMenuItem";
|
||||
this.exportFilteredAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.exportFilteredAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.exportFilteredAssetsMenuItem.Text = "Filtered assets";
|
||||
this.exportFilteredAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
|
||||
//
|
||||
@@ -359,13 +380,13 @@
|
||||
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.aboutToolStripMenuItem});
|
||||
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
|
||||
this.helpToolStripMenuItem.Size = new System.Drawing.Size(47, 21);
|
||||
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||
this.helpToolStripMenuItem.Text = "Help";
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
@@ -373,7 +394,7 @@
|
||||
//
|
||||
this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
@@ -388,7 +409,7 @@
|
||||
this.splitContainer1.Panel2.Controls.Add(this.classPreviewPanel);
|
||||
this.splitContainer1.Panel2.Controls.Add(this.statusStrip1);
|
||||
this.splitContainer1.Panel2MinSize = 400;
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1264, 605);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1264, 659);
|
||||
this.splitContainer1.SplitterDistance = 420;
|
||||
this.splitContainer1.TabIndex = 2;
|
||||
this.splitContainer1.TabStop = false;
|
||||
@@ -402,7 +423,7 @@
|
||||
this.tabControl1.Name = "tabControl1";
|
||||
this.tabControl1.Padding = new System.Drawing.Point(17, 3);
|
||||
this.tabControl1.SelectedIndex = 0;
|
||||
this.tabControl1.Size = new System.Drawing.Size(418, 583);
|
||||
this.tabControl1.Size = new System.Drawing.Size(418, 635);
|
||||
this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
|
||||
this.tabControl1.TabIndex = 0;
|
||||
this.tabControl1.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabPageSelected);
|
||||
@@ -435,7 +456,7 @@
|
||||
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.treeSearch.Location = new System.Drawing.Point(0, 0);
|
||||
this.treeSearch.Name = "treeSearch";
|
||||
this.treeSearch.Size = new System.Drawing.Size(410, 21);
|
||||
this.treeSearch.Size = new System.Drawing.Size(410, 20);
|
||||
this.treeSearch.TabIndex = 0;
|
||||
this.treeSearch.Text = " Search ";
|
||||
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
|
||||
@@ -450,7 +471,7 @@
|
||||
this.tabPage2.Controls.Add(this.listSearch);
|
||||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Size = new System.Drawing.Size(410, 557);
|
||||
this.tabPage2.Size = new System.Drawing.Size(410, 609);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Asset List";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
@@ -467,9 +488,9 @@
|
||||
this.assetListView.GridLines = true;
|
||||
this.assetListView.HideSelection = false;
|
||||
this.assetListView.LabelEdit = true;
|
||||
this.assetListView.Location = new System.Drawing.Point(0, 21);
|
||||
this.assetListView.Location = new System.Drawing.Point(0, 20);
|
||||
this.assetListView.Name = "assetListView";
|
||||
this.assetListView.Size = new System.Drawing.Size(410, 536);
|
||||
this.assetListView.Size = new System.Drawing.Size(410, 589);
|
||||
this.assetListView.TabIndex = 1;
|
||||
this.assetListView.UseCompatibleStateImageBehavior = false;
|
||||
this.assetListView.View = System.Windows.Forms.View.Details;
|
||||
@@ -499,7 +520,7 @@
|
||||
this.listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.listSearch.Location = new System.Drawing.Point(0, 0);
|
||||
this.listSearch.Name = "listSearch";
|
||||
this.listSearch.Size = new System.Drawing.Size(410, 21);
|
||||
this.listSearch.Size = new System.Drawing.Size(410, 20);
|
||||
this.listSearch.TabIndex = 0;
|
||||
this.listSearch.Text = " Filter ";
|
||||
this.listSearch.TextChanged += new System.EventHandler(this.ListSearchTextChanged);
|
||||
@@ -510,10 +531,10 @@
|
||||
//
|
||||
this.progressbarPanel.Controls.Add(this.progressBar1);
|
||||
this.progressbarPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.progressbarPanel.Location = new System.Drawing.Point(0, 583);
|
||||
this.progressbarPanel.Location = new System.Drawing.Point(0, 635);
|
||||
this.progressbarPanel.Name = "progressbarPanel";
|
||||
this.progressbarPanel.Padding = new System.Windows.Forms.Padding(1, 3, 1, 1);
|
||||
this.progressbarPanel.Size = new System.Drawing.Size(418, 20);
|
||||
this.progressbarPanel.Size = new System.Drawing.Size(418, 22);
|
||||
this.progressbarPanel.TabIndex = 2;
|
||||
//
|
||||
// progressBar1
|
||||
@@ -521,23 +542,24 @@
|
||||
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.progressBar1.Location = new System.Drawing.Point(1, 3);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(416, 16);
|
||||
this.progressBar1.Size = new System.Drawing.Size(416, 18);
|
||||
this.progressBar1.Step = 1;
|
||||
this.progressBar1.TabIndex = 1;
|
||||
//
|
||||
// previewPanel
|
||||
//
|
||||
this.previewPanel.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
this.previewPanel.BackgroundImage = Properties.Resources.preview;
|
||||
this.previewPanel.BackgroundImage = global::Unity_Studio.Properties.Resources.preview;
|
||||
this.previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.previewPanel.Controls.Add(this.assetInfoLabel);
|
||||
this.previewPanel.Controls.Add(this.FMODpanel);
|
||||
this.previewPanel.Controls.Add(this.fontPreviewBox);
|
||||
this.previewPanel.Controls.Add(this.textPreviewBox);
|
||||
this.previewPanel.Controls.Add(this.glControl1);
|
||||
this.previewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.previewPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.previewPanel.Name = "previewPanel";
|
||||
this.previewPanel.Size = new System.Drawing.Size(838, 581);
|
||||
this.previewPanel.Size = new System.Drawing.Size(838, 635);
|
||||
this.previewPanel.TabIndex = 1;
|
||||
//
|
||||
// assetInfoLabel
|
||||
@@ -545,9 +567,9 @@
|
||||
this.assetInfoLabel.AutoSize = true;
|
||||
this.assetInfoLabel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.assetInfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.assetInfoLabel.Location = new System.Drawing.Point(4, 7);
|
||||
this.assetInfoLabel.Location = new System.Drawing.Point(4, 8);
|
||||
this.assetInfoLabel.Name = "assetInfoLabel";
|
||||
this.assetInfoLabel.Size = new System.Drawing.Size(0, 12);
|
||||
this.assetInfoLabel.Size = new System.Drawing.Size(0, 13);
|
||||
this.assetInfoLabel.TabIndex = 0;
|
||||
//
|
||||
// FMODpanel
|
||||
@@ -564,9 +586,9 @@
|
||||
this.FMODpanel.Controls.Add(this.FMODstopButton);
|
||||
this.FMODpanel.Controls.Add(this.FMODpauseButton);
|
||||
this.FMODpanel.Controls.Add(this.FMODplayButton);
|
||||
this.FMODpanel.Location = new System.Drawing.Point(220, 191);
|
||||
this.FMODpanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.FMODpanel.Name = "FMODpanel";
|
||||
this.FMODpanel.Size = new System.Drawing.Size(400, 185);
|
||||
this.FMODpanel.Size = new System.Drawing.Size(838, 635);
|
||||
this.FMODpanel.TabIndex = 2;
|
||||
this.FMODpanel.Visible = false;
|
||||
//
|
||||
@@ -574,26 +596,26 @@
|
||||
//
|
||||
this.FMODcopyright.AutoSize = true;
|
||||
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
|
||||
this.FMODcopyright.Location = new System.Drawing.Point(117, 173);
|
||||
this.FMODcopyright.Location = new System.Drawing.Point(249, 380);
|
||||
this.FMODcopyright.Name = "FMODcopyright";
|
||||
this.FMODcopyright.Size = new System.Drawing.Size(341, 12);
|
||||
this.FMODcopyright.Size = new System.Drawing.Size(283, 13);
|
||||
this.FMODcopyright.TabIndex = 9;
|
||||
this.FMODcopyright.Text = "Audio Engine supplied by FMOD by Firelight Technologies.";
|
||||
//
|
||||
// FMODinfoLabel
|
||||
//
|
||||
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODinfoLabel.Location = new System.Drawing.Point(82, 50);
|
||||
this.FMODinfoLabel.Location = new System.Drawing.Point(305, 271);
|
||||
this.FMODinfoLabel.Name = "FMODinfoLabel";
|
||||
this.FMODinfoLabel.Size = new System.Drawing.Size(176, 12);
|
||||
this.FMODinfoLabel.Size = new System.Drawing.Size(176, 13);
|
||||
this.FMODinfoLabel.TabIndex = 8;
|
||||
//
|
||||
// FMODtimerLabel
|
||||
//
|
||||
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODtimerLabel.Location = new System.Drawing.Point(212, 50);
|
||||
this.FMODtimerLabel.Location = new System.Drawing.Point(435, 271);
|
||||
this.FMODtimerLabel.Name = "FMODtimerLabel";
|
||||
this.FMODtimerLabel.Size = new System.Drawing.Size(158, 12);
|
||||
this.FMODtimerLabel.Size = new System.Drawing.Size(158, 13);
|
||||
this.FMODtimerLabel.TabIndex = 7;
|
||||
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0";
|
||||
this.FMODtimerLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
@@ -601,19 +623,19 @@
|
||||
// FMODstatusLabel
|
||||
//
|
||||
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FMODstatusLabel.Location = new System.Drawing.Point(26, 50);
|
||||
this.FMODstatusLabel.Location = new System.Drawing.Point(249, 271);
|
||||
this.FMODstatusLabel.Name = "FMODstatusLabel";
|
||||
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 12);
|
||||
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 13);
|
||||
this.FMODstatusLabel.TabIndex = 6;
|
||||
this.FMODstatusLabel.Text = "Stopped";
|
||||
//
|
||||
// FMODprogressBar
|
||||
//
|
||||
this.FMODprogressBar.AutoSize = false;
|
||||
this.FMODprogressBar.Location = new System.Drawing.Point(29, 67);
|
||||
this.FMODprogressBar.Location = new System.Drawing.Point(252, 290);
|
||||
this.FMODprogressBar.Maximum = 1000;
|
||||
this.FMODprogressBar.Name = "FMODprogressBar";
|
||||
this.FMODprogressBar.Size = new System.Drawing.Size(348, 22);
|
||||
this.FMODprogressBar.Size = new System.Drawing.Size(348, 24);
|
||||
this.FMODprogressBar.TabIndex = 5;
|
||||
this.FMODprogressBar.TickStyle = System.Windows.Forms.TickStyle.None;
|
||||
this.FMODprogressBar.Scroll += new System.EventHandler(this.FMODprogressBar_Scroll);
|
||||
@@ -623,7 +645,7 @@
|
||||
// FMODvolumeBar
|
||||
//
|
||||
this.FMODvolumeBar.LargeChange = 2;
|
||||
this.FMODvolumeBar.Location = new System.Drawing.Point(273, 95);
|
||||
this.FMODvolumeBar.Location = new System.Drawing.Point(496, 320);
|
||||
this.FMODvolumeBar.Name = "FMODvolumeBar";
|
||||
this.FMODvolumeBar.Size = new System.Drawing.Size(104, 45);
|
||||
this.FMODvolumeBar.TabIndex = 4;
|
||||
@@ -634,9 +656,9 @@
|
||||
// FMODloopButton
|
||||
//
|
||||
this.FMODloopButton.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.FMODloopButton.Location = new System.Drawing.Point(212, 95);
|
||||
this.FMODloopButton.Location = new System.Drawing.Point(435, 320);
|
||||
this.FMODloopButton.Name = "FMODloopButton";
|
||||
this.FMODloopButton.Size = new System.Drawing.Size(55, 42);
|
||||
this.FMODloopButton.Size = new System.Drawing.Size(55, 46);
|
||||
this.FMODloopButton.TabIndex = 3;
|
||||
this.FMODloopButton.Text = "Loop";
|
||||
this.FMODloopButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -645,9 +667,9 @@
|
||||
//
|
||||
// FMODstopButton
|
||||
//
|
||||
this.FMODstopButton.Location = new System.Drawing.Point(151, 95);
|
||||
this.FMODstopButton.Location = new System.Drawing.Point(374, 320);
|
||||
this.FMODstopButton.Name = "FMODstopButton";
|
||||
this.FMODstopButton.Size = new System.Drawing.Size(55, 42);
|
||||
this.FMODstopButton.Size = new System.Drawing.Size(55, 46);
|
||||
this.FMODstopButton.TabIndex = 2;
|
||||
this.FMODstopButton.Text = "Stop";
|
||||
this.FMODstopButton.UseVisualStyleBackColor = true;
|
||||
@@ -655,9 +677,9 @@
|
||||
//
|
||||
// FMODpauseButton
|
||||
//
|
||||
this.FMODpauseButton.Location = new System.Drawing.Point(90, 95);
|
||||
this.FMODpauseButton.Location = new System.Drawing.Point(313, 320);
|
||||
this.FMODpauseButton.Name = "FMODpauseButton";
|
||||
this.FMODpauseButton.Size = new System.Drawing.Size(55, 42);
|
||||
this.FMODpauseButton.Size = new System.Drawing.Size(55, 46);
|
||||
this.FMODpauseButton.TabIndex = 1;
|
||||
this.FMODpauseButton.Text = "Pause";
|
||||
this.FMODpauseButton.UseVisualStyleBackColor = true;
|
||||
@@ -665,9 +687,9 @@
|
||||
//
|
||||
// FMODplayButton
|
||||
//
|
||||
this.FMODplayButton.Location = new System.Drawing.Point(29, 95);
|
||||
this.FMODplayButton.Location = new System.Drawing.Point(252, 320);
|
||||
this.FMODplayButton.Name = "FMODplayButton";
|
||||
this.FMODplayButton.Size = new System.Drawing.Size(55, 42);
|
||||
this.FMODplayButton.Size = new System.Drawing.Size(55, 46);
|
||||
this.FMODplayButton.TabIndex = 0;
|
||||
this.FMODplayButton.Text = "Play";
|
||||
this.FMODplayButton.UseVisualStyleBackColor = true;
|
||||
@@ -681,7 +703,7 @@
|
||||
this.fontPreviewBox.Name = "fontPreviewBox";
|
||||
this.fontPreviewBox.ReadOnly = true;
|
||||
this.fontPreviewBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
|
||||
this.fontPreviewBox.Size = new System.Drawing.Size(838, 581);
|
||||
this.fontPreviewBox.Size = new System.Drawing.Size(838, 635);
|
||||
this.fontPreviewBox.TabIndex = 0;
|
||||
this.fontPreviewBox.Text = resources.GetString("fontPreviewBox.Text");
|
||||
this.fontPreviewBox.Visible = false;
|
||||
@@ -696,18 +718,29 @@
|
||||
this.textPreviewBox.Name = "textPreviewBox";
|
||||
this.textPreviewBox.ReadOnly = true;
|
||||
this.textPreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.textPreviewBox.Size = new System.Drawing.Size(838, 581);
|
||||
this.textPreviewBox.Size = new System.Drawing.Size(838, 635);
|
||||
this.textPreviewBox.TabIndex = 2;
|
||||
this.textPreviewBox.Visible = false;
|
||||
this.textPreviewBox.WordWrap = false;
|
||||
//
|
||||
// glControl1
|
||||
//
|
||||
this.glControl1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.glControl1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.glControl1.Location = new System.Drawing.Point(0, 0);
|
||||
this.glControl1.Name = "glControl1";
|
||||
this.glControl1.Size = new System.Drawing.Size(838, 635);
|
||||
this.glControl1.TabIndex = 4;
|
||||
this.glControl1.VSync = false;
|
||||
this.glControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint);
|
||||
//
|
||||
// classPreviewPanel
|
||||
//
|
||||
this.classPreviewPanel.Controls.Add(this.classTextBox);
|
||||
this.classPreviewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.classPreviewPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.classPreviewPanel.Name = "classPreviewPanel";
|
||||
this.classPreviewPanel.Size = new System.Drawing.Size(838, 581);
|
||||
this.classPreviewPanel.Size = new System.Drawing.Size(838, 635);
|
||||
this.classPreviewPanel.TabIndex = 3;
|
||||
this.classPreviewPanel.Visible = false;
|
||||
//
|
||||
@@ -719,7 +752,7 @@
|
||||
this.classTextBox.Name = "classTextBox";
|
||||
this.classTextBox.ReadOnly = true;
|
||||
this.classTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.classTextBox.Size = new System.Drawing.Size(838, 581);
|
||||
this.classTextBox.Size = new System.Drawing.Size(838, 635);
|
||||
this.classTextBox.TabIndex = 3;
|
||||
this.classTextBox.WordWrap = false;
|
||||
//
|
||||
@@ -727,7 +760,7 @@
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toolStripStatusLabel1});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 581);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 635);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(838, 22);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
@@ -783,6 +816,11 @@
|
||||
//
|
||||
this.timer.Interval = 10;
|
||||
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
||||
//
|
||||
// timerOpenTK
|
||||
//
|
||||
this.timerOpenTK.Interval = 1000 / 6;
|
||||
this.timerOpenTK.Tick += new System.EventHandler(this.timerOpenTK_Tick);
|
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
@@ -813,24 +851,17 @@
|
||||
this.saveFolderDialog1.RestoreDirectory = true;
|
||||
this.saveFolderDialog1.Title = "Browse for folder";
|
||||
//
|
||||
// all3DObjectssplitToolStripMenuItem
|
||||
//
|
||||
this.all3DObjectssplitToolStripMenuItem.Name = "all3DObjectssplitToolStripMenuItem";
|
||||
this.all3DObjectssplitToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
|
||||
this.all3DObjectssplitToolStripMenuItem.Text = "All 3D objects (split)";
|
||||
this.all3DObjectssplitToolStripMenuItem.Click += new System.EventHandler(this.all3DObjectssplitToolStripMenuItem_Click);
|
||||
//
|
||||
// UnityStudioForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1264, 630);
|
||||
this.ClientSize = new System.Drawing.Size(1264, 683);
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Icon = Properties.Resources.unity;
|
||||
this.Icon = global::Unity_Studio.Properties.Resources.unity;
|
||||
this.KeyPreview = true;
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.MinimumSize = new System.Drawing.Size(620, 372);
|
||||
this.MinimumSize = new System.Drawing.Size(620, 400);
|
||||
this.Name = "UnityStudioForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Unity Studio";
|
||||
@@ -848,6 +879,7 @@
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage2.PerformLayout();
|
||||
this.progressbarPanel.ResumeLayout(false);
|
||||
this.glControl1.ResumeLayout(false);
|
||||
this.previewPanel.ResumeLayout(false);
|
||||
this.previewPanel.PerformLayout();
|
||||
this.FMODpanel.ResumeLayout(false);
|
||||
@@ -904,9 +936,11 @@
|
||||
private System.Windows.Forms.Label FMODtimerLabel;
|
||||
private System.Windows.Forms.Label FMODinfoLabel;
|
||||
private System.Windows.Forms.Timer timer;
|
||||
private System.Windows.Forms.Timer timerOpenTK;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem displayAll;
|
||||
private System.Windows.Forms.ToolStripMenuItem displayOriginalName;
|
||||
private System.Windows.Forms.ToolStripMenuItem enablePreview;
|
||||
private System.Windows.Forms.ToolStripMenuItem displayInfo;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
@@ -938,6 +972,7 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem exportClassStructuresMenuItem;
|
||||
private System.Windows.Forms.Label FMODcopyright;
|
||||
private System.Windows.Forms.ToolStripMenuItem all3DObjectssplitToolStripMenuItem;
|
||||
private OpenTK.GLControl glControl1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Text;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics.OpenGL;
|
||||
using static Unity_Studio.UnityStudio;
|
||||
|
||||
|
||||
namespace Unity_Studio
|
||||
{
|
||||
partial class UnityStudioForm : Form
|
||||
@@ -34,6 +35,28 @@ namespace Unity_Studio
|
||||
|
||||
private Bitmap imageTexture;
|
||||
|
||||
#region OpenTK variables
|
||||
int pgmID;
|
||||
int vsID;
|
||||
int fsID;
|
||||
int attributeVertexPosition;
|
||||
int attributeNormalDirection;
|
||||
int attributeVertexColor;
|
||||
int uniformViewMatrix;
|
||||
int vao;
|
||||
int vboPositions;
|
||||
int vboNormals;
|
||||
int vboColors;
|
||||
int vboViewMatrix;
|
||||
int eboElements;
|
||||
Vector3[] vertexData;
|
||||
Vector3[] normalData;
|
||||
Vector4[] colorData;
|
||||
Matrix4[] viewMatrixData;
|
||||
int[] indiceData;
|
||||
bool wireFrameView;
|
||||
#endregion
|
||||
|
||||
//asset list sorting helpers
|
||||
private int firstSortColumn = -1;
|
||||
private int secondSortColumn;
|
||||
@@ -50,7 +73,7 @@ namespace Unity_Studio
|
||||
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
|
||||
|
||||
|
||||
private void loadFile_Click(object sender, System.EventArgs e)
|
||||
private void loadFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
@@ -58,7 +81,7 @@ namespace Unity_Studio
|
||||
mainPath = Path.GetDirectoryName(openFileDialog1.FileNames[0]);
|
||||
ThreadPool.QueueUserWorkItem(state =>
|
||||
{
|
||||
if (openFileDialog1.FilterIndex == 1)
|
||||
if (openFileDialog1.FilterIndex == 1 || openFileDialog1.FilterIndex == 3)
|
||||
{
|
||||
MergeSplitAssets(mainPath);
|
||||
|
||||
@@ -95,7 +118,7 @@ namespace Unity_Studio
|
||||
}
|
||||
}
|
||||
|
||||
private void loadFolder_Click(object sender, System.EventArgs e)
|
||||
private void loadFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
/*FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
|
||||
|
||||
@@ -245,17 +268,17 @@ namespace Unity_Studio
|
||||
bool optionBuildHierarchyMenuItem = !dontBuildHierarchyMenuItem.Checked;
|
||||
bool optionBuildClassStructuresMenuItem = buildClassStructuresMenuItem.Checked;
|
||||
|
||||
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem);
|
||||
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem, displayOriginalName.Checked);
|
||||
|
||||
BeginInvoke(new Action(() =>
|
||||
{
|
||||
if (productName != "")
|
||||
{
|
||||
this.Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||
Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||
}
|
||||
else if (assetsfileList.Count > 0)
|
||||
{
|
||||
this.Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||
Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
|
||||
}
|
||||
if (!dontLoadAssetsMenuItem.Checked)
|
||||
{
|
||||
@@ -302,6 +325,96 @@ namespace Unity_Studio
|
||||
if (tabControl1.TabPages.Contains(tabPage3)) { tabControl1.TabPages.Remove(tabPage3); }
|
||||
else { tabControl1.TabPages.Add(tabPage3); }
|
||||
}
|
||||
|
||||
if (glControl1.Visible == true)
|
||||
{
|
||||
// --> Right
|
||||
if (e.KeyCode == Keys.D)
|
||||
{
|
||||
if (e.Shift && e.KeyCode == Keys.D) //Move
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateTranslation(0.1f, 0, 0);
|
||||
}
|
||||
else //Rotate
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateRotationY(0.1f);
|
||||
}
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// <-- Left
|
||||
if (e.KeyCode == Keys.A)
|
||||
{
|
||||
if (e.Shift && e.KeyCode == Keys.A) //Move
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateTranslation(-0.1f, 0, 0);
|
||||
}
|
||||
else //Rotate
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateRotationY(-0.1f);
|
||||
}
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// Up
|
||||
if (e.KeyCode == Keys.W)
|
||||
{
|
||||
if (e.Control && e.KeyCode == Keys.W) //Toggle WireFrame
|
||||
{
|
||||
wireFrameView = !wireFrameView;
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
else if (e.Shift && e.KeyCode == Keys.W) //Move
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateTranslation(0, 0.1f, 0);
|
||||
}
|
||||
else //Rotate
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateRotationX(0.1f);
|
||||
}
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// Down
|
||||
if (e.KeyCode == Keys.S)
|
||||
{
|
||||
if (e.Shift && e.KeyCode == Keys.S) //Move
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateTranslation(0, -0.1f, 0);
|
||||
}
|
||||
else //Rotate
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateRotationX(-0.1f);
|
||||
}
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// Zoom Out
|
||||
if (e.KeyCode == Keys.Q)
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateScale(0.9f);
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// Zoom In
|
||||
if (e.KeyCode == Keys.E)
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateScale(1.1f);
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
|
||||
// Toggle Timer
|
||||
if (e.KeyCode == Keys.T)
|
||||
{
|
||||
timerOpenTK.Enabled = !timerOpenTK.Enabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dontLoadAssetsMenuItem_CheckedChanged(object sender, EventArgs e)
|
||||
@@ -483,7 +596,7 @@ namespace Unity_Studio
|
||||
if (treeSearch.Text == " Search ")
|
||||
{
|
||||
treeSearch.Text = "";
|
||||
treeSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
treeSearch.ForeColor = SystemColors.WindowText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -492,7 +605,7 @@ namespace Unity_Studio
|
||||
if (treeSearch.Text == "")
|
||||
{
|
||||
treeSearch.Text = " Search ";
|
||||
treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
treeSearch.ForeColor = SystemColors.GrayText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,28 +689,12 @@ namespace Unity_Studio
|
||||
resizeAssetListColumns();
|
||||
}
|
||||
|
||||
/*private void splitContainer1_Resize(object sender, EventArgs e)
|
||||
{
|
||||
switch (tabControl1.SelectedIndex)
|
||||
{
|
||||
case 1: resizeAssetListColumns(); break;
|
||||
}
|
||||
}
|
||||
|
||||
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
|
||||
{
|
||||
switch (tabControl1.SelectedIndex)
|
||||
{
|
||||
case 1: resizeAssetListColumns(); break;
|
||||
}
|
||||
}*/
|
||||
|
||||
private void listSearch_Enter(object sender, EventArgs e)
|
||||
{
|
||||
if (listSearch.Text == " Filter ")
|
||||
{
|
||||
listSearch.Text = "";
|
||||
listSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
listSearch.ForeColor = SystemColors.WindowText;
|
||||
enableFiltering = true;
|
||||
}
|
||||
}
|
||||
@@ -608,7 +705,7 @@ namespace Unity_Studio
|
||||
{
|
||||
enableFiltering = false;
|
||||
listSearch.Text = " Filter ";
|
||||
listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
listSearch.ForeColor = SystemColors.GrayText;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,7 +716,7 @@ namespace Unity_Studio
|
||||
assetListView.BeginUpdate();
|
||||
assetListView.SelectedIndices.Clear();
|
||||
//visibleListAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.StartsWith(ListSearch.Text, System.StringComparison.CurrentCultureIgnoreCase));
|
||||
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, System.StringComparison.CurrentCultureIgnoreCase) >= 0);
|
||||
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, StringComparison.CurrentCultureIgnoreCase) >= 0);
|
||||
assetListView.VirtualListSize = visibleAssets.Count;
|
||||
assetListView.EndUpdate();
|
||||
}
|
||||
@@ -645,7 +742,7 @@ namespace Unity_Studio
|
||||
{
|
||||
int xdiff = reverseSort ? b.Text.CompareTo(a.Text) : a.Text.CompareTo(b.Text);
|
||||
if (xdiff != 0) return xdiff;
|
||||
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
|
||||
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
@@ -653,7 +750,7 @@ namespace Unity_Studio
|
||||
{
|
||||
int xdiff = reverseSort ? b.TypeString.CompareTo(a.TypeString) : a.TypeString.CompareTo(b.TypeString);
|
||||
if (xdiff != 0) return xdiff;
|
||||
else return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
|
||||
return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
@@ -661,7 +758,7 @@ namespace Unity_Studio
|
||||
{
|
||||
int xdiff = reverseSort ? b.Size.CompareTo(a.Size) : a.Size.CompareTo(b.Size);
|
||||
if (xdiff != 0) return xdiff;
|
||||
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
|
||||
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -674,13 +771,14 @@ namespace Unity_Studio
|
||||
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
|
||||
{
|
||||
previewPanel.BackgroundImage = Properties.Resources.preview;
|
||||
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
previewPanel.BackgroundImageLayout = ImageLayout.Center;
|
||||
assetInfoLabel.Visible = false;
|
||||
assetInfoLabel.Text = null;
|
||||
textPreviewBox.Visible = false;
|
||||
fontPreviewBox.Visible = false;
|
||||
pfc.Dispose();
|
||||
FMODpanel.Visible = false;
|
||||
glControl1.Visible = false;
|
||||
lastLoadedAsset = null;
|
||||
StatusStripUpdate("");
|
||||
|
||||
@@ -860,9 +958,117 @@ namespace Unity_Studio
|
||||
break;
|
||||
}
|
||||
#endregion
|
||||
#region Mesh
|
||||
case 43: //Mesh
|
||||
{
|
||||
glControl1.Visible = true;
|
||||
viewMatrixData = new Matrix4[] {
|
||||
Matrix4.Identity
|
||||
* Matrix4.CreateTranslation( 0.0f, -1.0f, 0.0f )
|
||||
* Matrix4.CreateRotationY(-90.0f)};
|
||||
var m_Mesh = new Mesh(asset, true);
|
||||
if (m_Mesh.m_VertexCount > 0)
|
||||
{
|
||||
#region Vertices
|
||||
int count = 3;
|
||||
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
|
||||
{
|
||||
count = 4;
|
||||
}
|
||||
vertexData = new Vector3[m_Mesh.m_VertexCount];
|
||||
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
|
||||
{
|
||||
vertexData[v] = new Vector3(
|
||||
m_Mesh.m_Vertices[v * count],
|
||||
m_Mesh.m_Vertices[v * count + 1],
|
||||
m_Mesh.m_Vertices[v * count + 2]);
|
||||
}
|
||||
#endregion
|
||||
#region Indicies
|
||||
indiceData = new int[m_Mesh.m_Indices.Count];
|
||||
for (int i = 0; i < m_Mesh.m_Indices.Count; i = i + 3)
|
||||
{
|
||||
indiceData[i] = (int)m_Mesh.m_Indices[i];
|
||||
indiceData[i + 1] = (int)m_Mesh.m_Indices[i + 1];
|
||||
indiceData[i + 2] = (int)m_Mesh.m_Indices[i + 2];
|
||||
}
|
||||
#endregion
|
||||
#region Normals
|
||||
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
|
||||
{
|
||||
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
|
||||
{
|
||||
count = 3;
|
||||
}
|
||||
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
|
||||
{
|
||||
count = 4;
|
||||
}
|
||||
|
||||
normalData = new Vector3[m_Mesh.m_VertexCount];
|
||||
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
|
||||
{
|
||||
normalData[n] = new Vector3(
|
||||
m_Mesh.m_Normals[n * count],
|
||||
m_Mesh.m_Normals[n * count + 1],
|
||||
m_Mesh.m_Normals[n * count + 2]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Colors
|
||||
if (m_Mesh.m_Colors == null)
|
||||
{
|
||||
colorData = new 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);
|
||||
}
|
||||
}
|
||||
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
|
||||
{
|
||||
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colorData[c] = new Vector4(
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
1.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
colorData = new Vector4[m_Mesh.m_VertexCount];
|
||||
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
|
||||
{
|
||||
colorData[c] = new Vector4(
|
||||
m_Mesh.m_Colors[c * 4],
|
||||
m_Mesh.m_Colors[c * 4 + 1],
|
||||
m_Mesh.m_Colors[c * 4 + 2],
|
||||
m_Mesh.m_Colors[c * 4 + 3]);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
createVAO();
|
||||
StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version)
|
||||
+ " | 'T'=Start/Stop Rotation | 'WASD'=Manual Rotate | "
|
||||
+ "'Shift WASD'=Move | 'Q/E'=Zoom | 'Ctl W' =Wireframe");
|
||||
}
|
||||
break;
|
||||
#endregion
|
||||
|
||||
default:
|
||||
{
|
||||
StatusStripUpdate("Only supported export the raw file.");
|
||||
string str;
|
||||
if ((str = asset.ViewStruct()) != null)
|
||||
{
|
||||
textPreviewBox.Text = str;
|
||||
textPreviewBox.Visible = true;
|
||||
}
|
||||
else
|
||||
StatusStripUpdate("Only supported export the raw file.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1169,7 +1375,7 @@ namespace Unity_Studio
|
||||
//Environment.Exit(-1);
|
||||
return true;
|
||||
}
|
||||
else { return false; }
|
||||
return false;
|
||||
}
|
||||
|
||||
private void all3DObjectssplitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -1336,9 +1542,10 @@ namespace Unity_Studio
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
Shader m_Shader = new Shader(asset, true);
|
||||
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
|
||||
{
|
||||
ExportShader(new Shader(asset, true), exportpath + asset.Text + ".txt");
|
||||
ExportShader(m_Shader, exportpath + asset.Text + ".txt");
|
||||
exportedCount++;
|
||||
}
|
||||
break;
|
||||
@@ -1365,6 +1572,15 @@ namespace Unity_Studio
|
||||
ExportFont(m_Font, exportpath + asset.Text + asset.extension);
|
||||
exportedCount++;
|
||||
}
|
||||
break;
|
||||
case 43: //Mesh
|
||||
Mesh m_Mesh = new Mesh(asset, true);
|
||||
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
|
||||
{
|
||||
ExportMesh(m_Mesh, exportpath + asset.Text);
|
||||
exportedCount++;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
|
||||
@@ -1465,6 +1681,7 @@ namespace Unity_Studio
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
|
||||
InitializeComponent();
|
||||
displayOriginalName.Checked = (bool)Properties.Settings.Default["displayOriginalName"];
|
||||
displayAll.Checked = (bool)Properties.Settings.Default["displayAll"];
|
||||
displayInfo.Checked = (bool)Properties.Settings.Default["displayInfo"];
|
||||
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
|
||||
@@ -1479,6 +1696,126 @@ namespace Unity_Studio
|
||||
UnityStudio.ProgressBarMaximumAdd = ProgressBarMaximumAdd;
|
||||
}
|
||||
|
||||
private void timerOpenTK_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (glControl1.Visible == true)
|
||||
{
|
||||
viewMatrixData[0] *= Matrix4.CreateRotationY(-0.1f);
|
||||
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
|
||||
glControl1.Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void initOpenTK()
|
||||
{
|
||||
GL.Viewport(0, 0, glControl1.ClientSize.Width, glControl1.ClientSize.Height);
|
||||
GL.ClearColor(Color.CadetBlue);
|
||||
pgmID = GL.CreateProgram();
|
||||
loadShader("vs.glsl", ShaderType.VertexShader, pgmID, out vsID);
|
||||
loadShader("fs.glsl", ShaderType.FragmentShader, pgmID, out fsID);
|
||||
GL.LinkProgram(pgmID);
|
||||
GL.UseProgram(pgmID);
|
||||
attributeVertexPosition = GL.GetAttribLocation(pgmID, "vertexPosition");
|
||||
attributeNormalDirection = GL.GetAttribLocation(pgmID, "normalDirection");
|
||||
attributeVertexColor = GL.GetAttribLocation(pgmID, "vertexColor");
|
||||
uniformViewMatrix = GL.GetUniformLocation(pgmID, "viewMatrix");
|
||||
glControl1.Visible = false;
|
||||
}
|
||||
|
||||
private void loadShader(string filename, ShaderType type, int program, out int address)
|
||||
{
|
||||
address = GL.CreateShader(type);
|
||||
using (StreamReader sr = new StreamReader(filename))
|
||||
{
|
||||
GL.ShaderSource(address, sr.ReadToEnd());
|
||||
}
|
||||
GL.CompileShader(address);
|
||||
GL.AttachShader(program, address);
|
||||
GL.DeleteShader(address);
|
||||
}
|
||||
|
||||
private void createVBO(out int vboAddress, Vector3[] data, int address)
|
||||
{
|
||||
GL.GenBuffers(1, out vboAddress);
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||
GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
|
||||
(IntPtr)(data.Length * Vector3.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
|
||||
GL.EnableVertexAttribArray(address);
|
||||
}
|
||||
|
||||
private void createVBO(out int vboAddress, Vector4[] data, int address)
|
||||
{
|
||||
GL.GenBuffers(1, out vboAddress);
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
|
||||
GL.BufferData<Vector4>(BufferTarget.ArrayBuffer,
|
||||
(IntPtr)(data.Length * Vector4.SizeInBytes),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);
|
||||
GL.EnableVertexAttribArray(address);
|
||||
}
|
||||
|
||||
private void createVBO(out int vboAddress, Matrix4[] data, int address)
|
||||
{
|
||||
GL.GenBuffers(1, out vboAddress);
|
||||
GL.UniformMatrix4(address, false, ref data[0]);
|
||||
}
|
||||
|
||||
private void createEBO(out int address, int[] data)
|
||||
{
|
||||
GL.GenBuffers(1, out address);
|
||||
GL.BindBuffer(BufferTarget.ElementArrayBuffer, address);
|
||||
GL.BufferData(BufferTarget.ElementArrayBuffer,
|
||||
(IntPtr)(data.Length * sizeof(int)),
|
||||
data,
|
||||
BufferUsageHint.StaticDraw);
|
||||
}
|
||||
|
||||
private void createVAO()
|
||||
{
|
||||
timerOpenTK.Stop();
|
||||
GL.DeleteVertexArray(vao);
|
||||
GL.GenVertexArrays(1, out vao);
|
||||
GL.BindVertexArray(vao);
|
||||
createVBO(out vboPositions, vertexData, attributeVertexPosition);
|
||||
createVBO(out vboNormals, normalData, attributeNormalDirection);
|
||||
createVBO(out vboColors, colorData, attributeVertexColor);
|
||||
createVBO(out vboViewMatrix, viewMatrixData, uniformViewMatrix);
|
||||
createEBO(out eboElements, indiceData);
|
||||
GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
|
||||
GL.BindVertexArray(0);
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
initOpenTK();
|
||||
}
|
||||
|
||||
private void glControl1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
glControl1.MakeCurrent();
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
GL.Enable(EnableCap.DepthTest);
|
||||
GL.DepthFunc(DepthFunction.Less);
|
||||
GL.BindVertexArray(vao);
|
||||
if (wireFrameView == true)
|
||||
{
|
||||
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line); //Wireframe
|
||||
}
|
||||
else
|
||||
{
|
||||
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
|
||||
}
|
||||
GL.DrawElements(BeginMode.Triangles, indiceData.Length, DrawElementsType.UnsignedInt, 0);
|
||||
GL.BindVertexArray(0);
|
||||
GL.Flush();
|
||||
glControl1.SwapBuffers();
|
||||
}
|
||||
|
||||
private void resetForm()
|
||||
{
|
||||
/*Properties.Settings.Default["uniqueNames"] = uniqueNamesMenuItem.Checked;
|
||||
@@ -1486,13 +1823,13 @@ namespace Unity_Studio
|
||||
Properties.Settings.Default["displayInfo"] = displayAssetInfoMenuItem.Checked;
|
||||
Properties.Settings.Default.Save();*/
|
||||
|
||||
base.Text = "Unity Studio";
|
||||
Text = "Unity Studio";
|
||||
|
||||
unityFiles.Clear();
|
||||
assetsfileList.Clear();
|
||||
exportableAssets.Clear();
|
||||
visibleAssets.Clear();
|
||||
UnityStudio.assetsfileandstream.Clear();
|
||||
assetsfileandstream.Clear();
|
||||
|
||||
sceneTreeView.Nodes.Clear();
|
||||
|
||||
@@ -1504,11 +1841,12 @@ namespace Unity_Studio
|
||||
classesListView.Groups.Clear();
|
||||
|
||||
previewPanel.BackgroundImage = Properties.Resources.preview;
|
||||
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
previewPanel.BackgroundImageLayout = ImageLayout.Center;
|
||||
assetInfoLabel.Visible = false;
|
||||
assetInfoLabel.Text = null;
|
||||
textPreviewBox.Visible = false;
|
||||
fontPreviewBox.Visible = false;
|
||||
glControl1.Visible = false;
|
||||
lastSelectedItem = null;
|
||||
lastLoadedAsset = null;
|
||||
firstSortColumn = -1;
|
||||
|
||||
@@ -149,7 +149,7 @@ The quick brown fox jumps over the lazy dog. 1234567890</value>
|
||||
<value>636, 17</value>
|
||||
</data>
|
||||
<data name="openFileDialog1.Filter" xml:space="preserve">
|
||||
<value>Unity asset files|level*; globalgamemanagers; mainData; CustomAssetBundle-*; CAB-*; BuildPlayer-*; *.assets; *.sharedAssets|Unity bundle files|*.unity3d; *.unity3d.lz4; *.assetbundle; *.bundle; *.bytes</value>
|
||||
<value>Unity asset files|level*; globalgamemanagers; mainData; CustomAssetBundle-*; CAB-*; BuildPlayer-*; *.assets; *.sharedAssets|Unity bundle files|*.unity3d; *.unity3d.lz4; *.assetbundle; *.bundle; *.bytes|Unity asset files|*.*|Unity bundle files|*.*</value>
|
||||
</data>
|
||||
<data name="openFolderDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing">
|
||||
<value>169, 17</value>
|
||||
|
||||
@@ -58,6 +58,18 @@
|
||||
<setting name="convertType" serializeAs="String">
|
||||
<value>PNG</value>
|
||||
</setting>
|
||||
<setting name="displayOriginalName" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</Unity_Studio.Properties.Settings>
|
||||
</userSettings>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
||||
27
Unity Studio/fs.glsl
Normal file
27
Unity Studio/fs.glsl
Normal file
@@ -0,0 +1,27 @@
|
||||
#version 140
|
||||
|
||||
in vec3 surfaceNormal;
|
||||
in vec3 toLightVector;
|
||||
in vec4 color;
|
||||
|
||||
out vec4 outputColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 lightColor = vec3(0.5, 0.5, 0.5);
|
||||
|
||||
// Ambient
|
||||
float ambientStrength = 0.9;
|
||||
vec3 ambient = ambientStrength * lightColor;
|
||||
|
||||
// Diffuse
|
||||
vec3 unitNormal = normalize(surfaceNormal);
|
||||
vec3 unitLightVector = normalize(toLightVector);
|
||||
float nDotProduct = dot(unitNormal, unitLightVector);
|
||||
float brightness = clamp(nDotProduct, 0, 1); // max(nDotProduct, 0.0);
|
||||
vec3 diffuse = brightness * lightColor;
|
||||
|
||||
// Output Color
|
||||
vec4 result = color * vec4((ambient + diffuse/2), 0.0);
|
||||
outputColor = result;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
7-Zip
|
||||
~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip Copyright (C) 1999-2015 Igor Pavlov.
|
||||
|
||||
Licenses for files are:
|
||||
|
||||
1) 7z.dll: GNU LGPL + unRAR restriction
|
||||
2) All other files: GNU LGPL
|
||||
|
||||
The GNU LGPL + unRAR restriction means that you must follow both
|
||||
GNU LGPL rules and unRAR restriction rules.
|
||||
|
||||
|
||||
Note:
|
||||
You can use 7-Zip on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
||||
|
||||
|
||||
unRAR restriction
|
||||
-----------------
|
||||
|
||||
The decompression engine for RAR archives was developed using source
|
||||
code of unRAR program.
|
||||
All copyrights to original unRAR code are owned by Alexander Roshal.
|
||||
|
||||
The license for original unRAR code has the following restriction:
|
||||
|
||||
The unRAR sources cannot be used to re-create the RAR compression algorithm,
|
||||
which is proprietary. Distribution of modified unRAR sources in separate form
|
||||
or as a part of other software is permitted, provided that it is clearly
|
||||
stated in the documentation and source comments that the code may
|
||||
not be used to develop a RAR (WinRAR) compatible archiver.
|
||||
|
||||
|
||||
--
|
||||
Igor Pavlov
|
||||
52
Unity Studio/library/OpenTK License.txt
Normal file
52
Unity Studio/library/OpenTK License.txt
Normal file
@@ -0,0 +1,52 @@
|
||||
The Open Toolkit library license
|
||||
|
||||
Copyright (c) 2006 - 2014 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
||||
Third parties
|
||||
|
||||
|
||||
OpenTK.Platform.Windows and OpenTK.Platform.X11 include portions of the Mono class library. These portions are covered by the following license:
|
||||
|
||||
Copyright (c) 2004 Novell, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
OpenTK.Compatibility includes portions of the Tao Framework library (Tao.OpenGl, Tao.OpenAl and Tao.Platform.Windows.SimpleOpenGlControl). These portions are covered by the following license:
|
||||
|
||||
Copyright <20>2003-2007 Tao Framework Team
|
||||
http://www.taoframework.com
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
OpenTK.Half offers Half-to-Single and Single-to-Half conversions based on OpenEXR source code, which is covered by the following license:
|
||||
|
||||
Copyright (c) 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Industrial Light & Magic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
BIN
Unity Studio/library/OpenTK.GLControl.dll
Normal file
BIN
Unity Studio/library/OpenTK.GLControl.dll
Normal file
Binary file not shown.
BIN
Unity Studio/library/OpenTK.dll
Normal file
BIN
Unity Studio/library/OpenTK.dll
Normal file
Binary file not shown.
BIN
Unity Studio/library/x64/ManagedFbx.dll
Normal file
BIN
Unity Studio/library/x64/ManagedFbx.dll
Normal file
Binary file not shown.
BIN
Unity Studio/library/x86/ManagedFbx.dll
Normal file
BIN
Unity Studio/library/x86/ManagedFbx.dll
Normal file
Binary file not shown.
19
Unity Studio/vs.glsl
Normal file
19
Unity Studio/vs.glsl
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 140
|
||||
|
||||
in vec3 vertexPosition;
|
||||
in vec3 normalDirection;
|
||||
in vec4 vertexColor;
|
||||
uniform mat4 viewMatrix;
|
||||
|
||||
out vec3 surfaceNormal;
|
||||
out vec3 toLightVector;
|
||||
out vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 lightPosition = vec3(200.0, 200.0, 200.0);
|
||||
gl_Position = viewMatrix * vec4(vertexPosition, 1.0);
|
||||
surfaceNormal = normalDirection;
|
||||
toLightVector = lightPosition - vertexPosition;
|
||||
color = vertexColor;
|
||||
}
|
||||
Reference in New Issue
Block a user