├── SB3UtilityGUI ├── HF-Logo.ico ├── ApplicationException.cs ├── Program.cs ├── FormLog.cs ├── Properties │ └── AssemblyInfo.cs ├── ApplicationException.Designer.cs ├── Settings.cs └── AboutBox.cs ├── SB3UtilityHelp ├── Resource Item File.items ├── Content Layout.content └── Plugins.aml ├── Plugins ├── SyntaxHighlightingTextBox │ ├── SyntaxHighlightingTextBox.cs │ ├── Win32.cs │ ├── SyntaxHighlightingTextBox.resx │ ├── HighlightDescriptor.cs │ ├── AssemblyInfo.cs │ ├── SeperaratorCollection.cs │ └── HighlightDescriptorCollection.cs ├── UnityBase │ ├── unity3d │ │ ├── Component.cs │ │ ├── Flare.cs │ │ ├── RuntimeAnimatorController.cs │ │ ├── SpriteRenderer.cs │ │ ├── LinkToGameObject.cs │ │ ├── LinkToGameObject223.cs │ │ ├── LinkToGameObject225.cs │ │ ├── FlareLayer.cs │ │ ├── AudioListener.cs │ │ ├── MeshFilter.cs │ │ ├── MultiLink.cs │ │ ├── BoxCollider.cs │ │ ├── SphereCollider.cs │ │ ├── MeshCollider.cs │ │ ├── CapsuleCollider.cs │ │ ├── ParticleRenderer.cs │ │ ├── RigidBody.cs │ │ ├── ParticleSystemRenderer.cs │ │ ├── Cubemap.cs │ │ ├── Projector.cs │ │ ├── ParticleAnimator.cs │ │ ├── MonoScript.cs │ │ └── AudioClip.cs │ ├── ExternalAsset.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── NotLoaded.cs ├── SB3UtilityPlugins │ ├── Example.cs │ ├── pp │ │ ├── swapfile.cs │ │ ├── lst.cs │ │ ├── Texture.cs │ │ ├── xa.cs │ │ ├── xx.cs │ │ ├── FormPPSave.cs │ │ ├── FormXXSnapBorders.cs │ │ ├── FormXXNormals.cs │ │ ├── ToolOutput.cs │ │ ├── FormXXConvert.cs │ │ ├── ToolOutputEditor.cs │ │ ├── FormXADragDrop.cs │ │ ├── FormPPSubfileChange.cs │ │ ├── FormPPRename.cs │ │ ├── FormPPSave.Designer.cs │ │ ├── FormPPMultiRename.cs │ │ └── FormPPRename.Designer.cs │ ├── ImportBinary.cs │ ├── ScriptHelper.cs │ ├── SetProperty.cs │ └── Properties │ │ ├── AssemblyInfo.cs │ │ └── Resources.Designer.cs ├── SB3UtilityPP │ ├── xxFormatDiff.txt │ ├── lstParser.cs │ ├── WakeariStream.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ppSwapfile.cs │ └── Ema.cs ├── NIFPlugin │ ├── Nif.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── SB3UtilityNIF │ ├── SB3UtilityNIF.vcxproj.filters │ └── SB3UtilityNIF.h ├── UnityPlugin │ ├── Settings.cs │ ├── FormNormalsAndTangents.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Settings.settings │ │ └── Resources.Designer.cs │ └── app.config └── SB3UtilityFBX │ ├── SB3UtilityFBX.vcxproj.filters │ └── AssemblyInfo.cpp ├── SB3Utility ├── IWriteFile.cs ├── IRenderObject.cs ├── IReadFile.cs ├── Report.cs ├── ScriptMain.cs ├── RawFile.cs ├── Plugin.cs ├── XmlComments.cs ├── ObjChildren.cs └── Properties │ └── AssemblyInfo.cs ├── SB3UtilityScript ├── App.config ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── ODFPlugin ├── odfFile.cs ├── odfFolder.cs ├── FormAnimViewDragDrop.cs ├── Settings.cs ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Resources.Designer.cs ├── app.config ├── FormAnimView.cs └── FormMeshViewDragDrop.cs ├── AiDroidPlugin ├── FPK │ ├── REA.cs │ ├── REM.cs │ ├── FormREADragDrop.cs │ ├── fpk.cs │ └── FormREMDragDrop.cs ├── Properties │ ├── Settings.settings │ ├── AssemblyInfo.cs │ └── Resources.Designer.cs ├── app.config └── AiDroidPlugin.ChangeLog.txt ├── SB3UtilityFBX.sln ├── AiDroidBase ├── FPK │ ├── reaOps.cs │ ├── REAParser.cs │ └── REAStructures.cs ├── Properties │ └── AssemblyInfo.cs └── AiDroidBase.csproj ├── ODFBase ├── Properties │ └── AssemblyInfo.cs └── odf │ ├── odfFileSection.cs │ └── odaOps.cs └── PPD_Preview_Clothes ├── Properties └── AssemblyInfo.cs ├── sviex.cs └── PPDPreviewClothes.Designer.cs /SB3UtilityGUI/HF-Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enimaroah/SB3Utility/HEAD/SB3UtilityGUI/HF-Logo.ico -------------------------------------------------------------------------------- /SB3UtilityHelp/Resource Item File.items: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/SyntaxHighlightingTextBox.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enimaroah/SB3Utility/HEAD/Plugins/SyntaxHighlightingTextBox/SyntaxHighlightingTextBox.cs -------------------------------------------------------------------------------- /SB3Utility/IWriteFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public interface IWriteFile 9 | { 10 | string Name { get; set; } 11 | void WriteTo(Stream stream); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SB3UtilityScript/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SB3UtilityHelp/Content Layout.content: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SB3UtilityGUI/ApplicationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace SB3Utility 5 | { 6 | public partial class ApplicationException : Form 7 | { 8 | public ApplicationException(Exception ex) 9 | { 10 | InitializeComponent(); 11 | textBoxErrorText.Text = ex.ToString(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SB3Utility/IRenderObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using SlimDX; 5 | using SlimDX.Direct3D9; 6 | 7 | namespace SB3Utility 8 | { 9 | public interface IRenderObject 10 | { 11 | BoundingBox Bounds { get; } 12 | AnimationController AnimationController { get; } 13 | 14 | void Render(); 15 | void ResetPose(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SB3Utility/IReadFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace SB3Utility 7 | { 8 | public interface IReadFile 9 | { 10 | string Name { get; set; } 11 | Stream CreateReadStream(); 12 | } 13 | 14 | public interface NeedsSourceStreamForWriting 15 | { 16 | Stream SourceStream { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/Component.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace UnityPlugin 4 | { 5 | public interface Component 6 | { 7 | AssetCabinet file { get; set; } 8 | int pathID { get; set; } 9 | UnityClassID classID1 { get; set; } 10 | UnityClassID classID2 { get; set; } 11 | 12 | void LoadFrom(Stream stream); 13 | void WriteTo(Stream stream); 14 | } 15 | 16 | public interface StoresReferences { } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/Example.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SB3Utility 6 | { 7 | [Plugin] 8 | public class Example 9 | { 10 | [Plugin] 11 | public static float DoStuff([DefaultVar]float a) 12 | { 13 | return a; 14 | } 15 | 16 | [Plugin] 17 | public float DoStuffInstance([DefaultVar]float a) 18 | { 19 | return a; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/swapfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SB3Utility 6 | { 7 | public static partial class Plugins 8 | { 9 | [Plugin] 10 | public static ppSwapfile OpenSwapfile([DefaultVar]ppParser ppParser, IWriteFile parserToSwap) 11 | { 12 | ppSwapfile swap = new ppSwapfile(ppParser.FilePath, parserToSwap); 13 | return swap; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SB3Utility/Report.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SB3Utility 4 | { 5 | public static class Report 6 | { 7 | public static event Action Log; 8 | public static event Action Status; 9 | 10 | public static void ReportLog(string msg) 11 | { 12 | if (Log != null) 13 | { 14 | Log(msg); 15 | } 16 | } 17 | 18 | public static void ReportStatus(string msg) 19 | { 20 | if (Status != null) 21 | { 22 | Status(msg); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/Flare.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public abstract class Flare : Component 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public abstract void LoadFrom(Stream stream); 15 | public abstract void WriteTo(Stream stream); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ODFPlugin/odfFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | using SB3Utility; 7 | 8 | namespace ODFPlugin 9 | { 10 | public static partial class Plugins 11 | { 12 | [Plugin] 13 | public static odfParser OpenODF([DefaultVar]string path) 14 | { 15 | return new odfParser(path); 16 | } 17 | 18 | [Plugin] 19 | public static void WriteODF([DefaultVar]odfParser parser) 20 | { 21 | parser.WriteArchive(parser.ODFPath, true); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/RuntimeAnimatorController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public abstract class RuntimeAnimatorController : Component, StoresReferences 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public abstract void LoadFrom(Stream stream); 15 | public abstract void WriteTo(Stream stream); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/lst.cs: -------------------------------------------------------------------------------- 1 | namespace SB3Utility 2 | { 3 | public static partial class Plugins 4 | { 5 | [Plugin] 6 | public static lstParser OpenLST([DefaultVar]ppParser parser, string name) 7 | { 8 | for (int i = 0; i < parser.Subfiles.Count; i++) 9 | { 10 | if (parser.Subfiles[i].Name == name) 11 | { 12 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 13 | if (subfile != null) 14 | { 15 | return new lstParser(subfile.CreateReadStream(), subfile.Name); 16 | } 17 | 18 | break; 19 | } 20 | } 21 | return null; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Plugins/UnityBase/ExternalAsset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public class ExternalAsset : Component 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public int FileID { get; set; } 15 | public int PathID { get; set; } 16 | 17 | public void LoadFrom(Stream stream) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | public void WriteTo(Stream stream) 23 | { 24 | throw new NotImplementedException(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/Texture.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | public static ImportedTexture ImportEmaTexture(Stream stream, string name) 12 | { 13 | return new Ema(stream, name).ImportedTexture(); 14 | } 15 | 16 | [Plugin] 17 | public static ImportedTexture ImportTexture(Stream stream, string name) 18 | { 19 | return new ImportedTexture(stream, name); 20 | } 21 | 22 | [Plugin] 23 | public static ImportedTexture ImportTexture([DefaultVar]string path) 24 | { 25 | return new ImportedTexture(path); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ODFPlugin/odfFolder.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | using System; 3 | 4 | using SB3Utility; 5 | 6 | namespace ODFPlugin 7 | { 8 | public static partial class Plugins 9 | { 10 | /// 11 | /// "Parses" a folder of an .odf file from the specified path. 12 | /// 13 | /// [DefaultVar] Path of the file. 14 | /// A odfParser that represents the folder of the .odf file. 15 | [Plugin] 16 | public static string OpenODFFolderOf([DefaultVar]string path) 17 | { 18 | /* ppFormat format = ppFormat.GetFormat(path); 19 | if (format == null) 20 | { 21 | throw new Exception("Couldn't auto-detect the ppFormat"); 22 | }*/ 23 | throw new Exception("not implemented"); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/ImportBinary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | public static byte[] ImportBinary([DefaultVar]string path) 12 | { 13 | using (BinaryReader reader = new BinaryReader(File.OpenRead(path))) 14 | { 15 | return reader.ReadBytes((int)reader.BaseStream.Length); 16 | } 17 | } 18 | 19 | [Plugin] 20 | public static byte[] ImportBinary([DefaultVar]string path, int offset, int count) 21 | { 22 | using (BinaryReader reader = new BinaryReader(File.OpenRead(path))) 23 | { 24 | reader.BaseStream.Seek(offset, SeekOrigin.Begin); 25 | return reader.ReadBytes(count); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/xxFormatDiff.txt: -------------------------------------------------------------------------------- 1 | xx 2 | == 3 | Header: (>= 1) 26, (< 1) 21 4 | Footer: (>= 2) 10 5 | 6 | Frame 7 | ===== 8 | Unknown1: (>= 7) 32, (< 7) 16 9 | Unknown2: (>= 7) 64, (< 7) 16 10 | Name2: (>= 6) name 11 | 12 | Submesh 13 | ======= 14 | Unknown1: (>= 7) 64, (< 7) 16 15 | Unknown2: (>= 7) 20 16 | Unknown3: (>= 2) 100 17 | Unknown4: (>= 7) 284, (>= 3) 64 18 | Unknown5: (>= 8) 21, (>= 5) 20 19 | Unknown6: (>= 6 && < 7) 28 20 | 21 | Vertex 22 | ====== 23 | Index: (>= 4) ushort, (< 4) int 24 | Unknown1: (>= 4) 20 25 | 26 | Material 27 | ======== 28 | Unknown1: (>= 0) 88, (< 0) 4 29 | 30 | 31 | Files affected: 32 | xxParser.cs 33 | xxReplace.cs: Create() 34 | Structures.cs: WriteTo(), Clone() 35 | xxOps.cs: CopyUnknowns(), ConvertFormat() 36 | Plugins\pp\FormXX.cs 37 | Plugins\pp\FormXXEditHex.cs 38 | Plugins\pp\xxEditor.cs -------------------------------------------------------------------------------- /SB3Utility/ScriptMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public class ScriptMain 9 | { 10 | public ScriptExecutor ScriptEnvironment { get; protected set; } 11 | 12 | public ScriptMain() 13 | { 14 | ScriptEnvironment = new ScriptExecutor(); 15 | } 16 | 17 | public void LoadPlugin(string path) 18 | { 19 | PluginManager.LoadPlugin(path); 20 | } 21 | 22 | public object RunScript(string path) 23 | { 24 | ScriptParser parser = new ScriptParser(path); 25 | return ScriptEnvironment.RunScript(parser); 26 | } 27 | 28 | public object RunScript(Stream stream, string scriptName) 29 | { 30 | ScriptParser parser = new ScriptParser(stream, scriptName); 31 | return ScriptEnvironment.RunScript(parser); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ODFPlugin/FormAnimViewDragDrop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | using SB3Utility; 10 | 11 | namespace ODFPlugin 12 | { 13 | public partial class FormAnimViewDragDrop : Form 14 | { 15 | public ReplaceAnimationMethod ReplaceMethod { get; protected set; } 16 | 17 | private odfEditor editor; 18 | 19 | public FormAnimViewDragDrop(odfEditor destEditor, bool morphOrAnimation) 20 | { 21 | InitializeComponent(); 22 | editor = destEditor; 23 | 24 | if (morphOrAnimation) 25 | panelMorphList.BringToFront(); 26 | else 27 | { 28 | panelAnimation.BringToFront(); 29 | comboBoxMethod.Items.AddRange(Enum.GetNames(typeof(ReplaceAnimationMethod))); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/xa.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | public static xaParser OpenXA([DefaultVar]ppParser parser, string name) 12 | { 13 | for (int i = 0; i < parser.Subfiles.Count; i++) 14 | { 15 | if (parser.Subfiles[i].Name == name) 16 | { 17 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 18 | if (subfile != null) 19 | { 20 | return new xaParser(subfile.CreateReadStream(), subfile.Name); 21 | } 22 | 23 | break; 24 | } 25 | } 26 | return null; 27 | } 28 | 29 | [Plugin] 30 | public static xaParser OpenXA([DefaultVar]string path) 31 | { 32 | return new xaParser(File.OpenRead(path), Path.GetFileName(path)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Plugins/NIFPlugin/Nif.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | using SB3Utility; 5 | 6 | namespace NIFPlugin 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | [PluginOpensFile(".nif")] 12 | public static void WorkspaceNif(string path, string variable) 13 | { 14 | string importVar = Gui.Scripting.GetNextVariable("importNif"); 15 | var importer = (Nif.Importer)Gui.Scripting.RunScript(importVar + " = ImportNif(path=\"" + path + "\")"); 16 | 17 | string editorVar = Gui.Scripting.GetNextVariable("importedEditor"); 18 | var editor = (ImportedEditor)Gui.Scripting.RunScript(editorVar + " = ImportedEditor(" + importVar + ")"); 19 | 20 | new FormWorkspace(path, importer, editorVar, editor); 21 | } 22 | 23 | [Plugin] 24 | public static Nif.Importer ImportNif([DefaultVar]string path) 25 | { 26 | return new Nif.Importer(path); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SB3UtilityGUI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace SB3Utility 5 | { 6 | static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | static void Main(string[] args) 13 | { 14 | try 15 | { 16 | if (args.Length > 0 && !CommandLineArgumentHandler.StartServer(args)) 17 | { 18 | CommandLineArgumentHandler.OpenFiles(args); 19 | return; 20 | } 21 | 22 | Application.EnableVisualStyles(); 23 | Application.SetCompatibleTextRenderingDefault(false); 24 | Application.Run(new MDIParent()); 25 | 26 | if (CommandLineArgumentHandler.SB3UtilityIsServer()) 27 | { 28 | CommandLineArgumentHandler.StopServer(); 29 | } 30 | } 31 | catch (Exception ex) 32 | { 33 | Application.Run(new ApplicationException(ex)); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /AiDroidPlugin/FPK/REA.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace AiDroidPlugin 9 | { 10 | public static partial class Plugins 11 | { 12 | [Plugin] 13 | public static reaParser OpenREA([DefaultVar]fpkParser parser, string name) 14 | { 15 | for (int i = 0; i < parser.Subfiles.Count; i++) 16 | { 17 | if (parser.Subfiles[i].Name == name) 18 | { 19 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 20 | if (subfile != null) 21 | { 22 | return new reaParser(subfile.CreateReadStream(), subfile.Name, parser.FilePath); 23 | } 24 | 25 | break; 26 | } 27 | } 28 | return null; 29 | } 30 | 31 | [Plugin] 32 | public static reaParser OpenREA([DefaultVar]string path) 33 | { 34 | return new reaParser(File.OpenRead(path), Path.GetFileName(path), path); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /AiDroidPlugin/FPK/REM.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace AiDroidPlugin 9 | { 10 | public static partial class Plugins 11 | { 12 | [Plugin] 13 | public static remParser OpenREM([DefaultVar]fpkParser parser, string name) 14 | { 15 | for (int i = 0; i < parser.Subfiles.Count; i++) 16 | { 17 | if (parser.Subfiles[i].Name == name) 18 | { 19 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 20 | if (subfile != null) 21 | { 22 | return new remParser(subfile.CreateReadStream(), subfile.Name, parser.FilePath); 23 | } 24 | 25 | break; 26 | } 27 | } 28 | return null; 29 | } 30 | 31 | [Plugin] 32 | public static remParser OpenREM([DefaultVar]string path) 33 | { 34 | return new remParser(File.OpenRead(path), Path.GetFileName(path), path); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SB3Utility/RawFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace SB3Utility 7 | { 8 | public class RawFile : IReadFile, IWriteFile 9 | { 10 | public string Name { get; set; } 11 | public string FilePath { get; protected set; } 12 | 13 | public RawFile(string path) 14 | { 15 | FilePath = path; 16 | Name = Path.GetFileName(FilePath); 17 | } 18 | 19 | public Stream CreateReadStream() 20 | { 21 | return File.OpenRead(FilePath); 22 | } 23 | 24 | public void WriteTo(Stream stream) 25 | { 26 | using (BinaryReader reader = new BinaryReader(CreateReadStream())) 27 | { 28 | BinaryWriter writer = new BinaryWriter(stream); 29 | byte[] buf; 30 | while ((buf = reader.ReadBytes(Utility.BufSize)).Length == Utility.BufSize) 31 | { 32 | writer.Write(buf); 33 | } 34 | writer.Write(buf); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityNIF/SB3UtilityNIF.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | 19 | 20 | Source Files 21 | 22 | 23 | -------------------------------------------------------------------------------- /SB3UtilityFBX.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SB3UtilityFBX", "SB3UtilityFBX\SB3UtilityFBX.vcxproj", "{120B541E-0A9D-4871-9315-679CB97109E2}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {120B541E-0A9D-4871-9315-679CB97109E2}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {120B541E-0A9D-4871-9315-679CB97109E2}.Debug|Win32.Build.0 = Debug|Win32 14 | {120B541E-0A9D-4871-9315-679CB97109E2}.Release|Win32.ActiveCfg = Release|Win32 15 | {120B541E-0A9D-4871-9315-679CB97109E2}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /AiDroidPlugin/FPK/FormREADragDrop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | using SB3Utility; 5 | 6 | namespace AiDroidPlugin 7 | { 8 | public partial class FormREADragDrop : Form 9 | { 10 | public ReplaceAnimationMethod ReplaceMethod { get; protected set; } 11 | 12 | private reaEditor editor; 13 | 14 | public FormREADragDrop(reaEditor destEditor) 15 | { 16 | InitializeComponent(); 17 | editor = destEditor; 18 | 19 | comboBoxMethod.Items.AddRange(Enum.GetNames(typeof(ReplaceAnimationMethod))); 20 | } 21 | 22 | private void comboBoxMethod_SelectedIndexChanged(object sender, EventArgs e) 23 | { 24 | if (comboBoxMethod.SelectedIndex == (int)ReplaceAnimationMethod.Append) 25 | { 26 | if (numericPosition.Value == 0) 27 | { 28 | numericPosition.Value = 10; 29 | } 30 | } 31 | else 32 | { 33 | if (numericPosition.Value == 10) 34 | { 35 | numericPosition.Value = 0; 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/lstParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace SB3Utility 7 | { 8 | public class lstParser : IWriteFile 9 | { 10 | public string Name { get; set; } 11 | public string Text { get; set; } 12 | 13 | public lstParser(Stream stream, string name) 14 | { 15 | this.Name = name; 16 | 17 | using (BinaryReader reader = new BinaryReader(stream)) 18 | { 19 | List byteList = new List(); 20 | try 21 | { 22 | for (; true; ) 23 | { 24 | byteList.Add(reader.ReadByte()); 25 | } 26 | } 27 | catch (EndOfStreamException) { } 28 | this.Text += Utility.EncodingShiftJIS.GetString(byteList.ToArray()); 29 | } 30 | } 31 | 32 | public void WriteTo(Stream stream) 33 | { 34 | BinaryWriter writer = new BinaryWriter(stream); 35 | writer.Write(Utility.EncodingShiftJIS.GetBytes(this.Text.ToCharArray())); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/ScriptHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SB3Utility 6 | { 7 | public static class ScriptHelper 8 | { 9 | public static void SetProperty(string obj, string name, object value) 10 | { 11 | Gui.Scripting.RunScript("SetProperty(obj=" + obj + ", name=\"" + name + "\", value=[" + value + "])"); 12 | } 13 | 14 | public static string String(string variable, object value) 15 | { 16 | return variable + "=\"" + value + "\""; 17 | } 18 | 19 | public static string Bytes(string variable, object value) 20 | { 21 | return variable + "=[" + value + "]"; 22 | } 23 | 24 | public static string Parameters(string[] parameters) 25 | { 26 | StringBuilder sb = new StringBuilder(); 27 | for (int i = 0; i < parameters.Length; i++) 28 | { 29 | sb.Append(parameters[i]); 30 | sb.Append(", "); 31 | } 32 | return sb.ToString(0, sb.Length - 2); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/xx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | public static xxParser OpenXX([DefaultVar]ppParser parser, string name) 12 | { 13 | for (int i = 0; i < parser.Subfiles.Count; i++) 14 | { 15 | if (parser.Subfiles[i].Name == name) 16 | { 17 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 18 | if (subfile != null) 19 | { 20 | return new xxParser(subfile.CreateReadStream(), subfile.Name); 21 | } 22 | 23 | break; 24 | } 25 | } 26 | return null; 27 | } 28 | 29 | [Plugin] 30 | public static xxParser OpenXX([DefaultVar]string path) 31 | { 32 | return new xxParser(File.OpenRead(path), Path.GetFileName(path)); 33 | } 34 | 35 | [Plugin] 36 | public static void ConvertXX([DefaultVar]xxParser parser, int format) 37 | { 38 | xx.ConvertFormat(parser, format); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SB3Utility/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SB3Utility 6 | { 7 | [AttributeUsage(AttributeTargets.Parameter)] 8 | public class DefaultVar : Attribute 9 | { 10 | } 11 | 12 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] 13 | public class Plugin : Attribute 14 | { 15 | } 16 | 17 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple=true)] 18 | public class PluginOpensFile : Attribute 19 | { 20 | public string FileExtension { get; protected set; } 21 | 22 | public PluginOpensFile(string ext) 23 | { 24 | this.FileExtension = ext; 25 | } 26 | } 27 | 28 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] 29 | public class PluginTool : Attribute 30 | { 31 | public string Name { get; protected set; } 32 | public string Shortcut { get; protected set; } 33 | 34 | public PluginTool(string name, string shortcut) 35 | { 36 | this.Name = name; 37 | this.Shortcut = shortcut; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/SetProperty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Reflection; 5 | 6 | namespace SB3Utility 7 | { 8 | public static partial class Plugins 9 | { 10 | [Plugin] 11 | public static void SetProperty(object obj, string name, object value) 12 | { 13 | var type = obj.GetType(); 14 | type.GetProperty(name).SetValue(obj, value, null); 15 | } 16 | 17 | [Plugin] 18 | public static void SetIndexed(object obj, int index, object value) 19 | { 20 | var type = obj.GetType(); 21 | if (type.IsArray) 22 | { 23 | ((Array)obj).SetValue(value, index); 24 | } 25 | else 26 | { 27 | var attributes = type.GetCustomAttributes(typeof(DefaultMemberAttribute), true); 28 | if (attributes.Length > 0) 29 | { 30 | var indexerName = ((DefaultMemberAttribute)attributes[0]).MemberName; 31 | type.GetProperty(indexerName).SetValue(obj, value, new object[] { index }); 32 | } 33 | else 34 | { 35 | throw new Exception(obj.ToString() + " can't be indexed."); 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SB3Utility/XmlComments.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.IO; 5 | using System.Xml.Linq; 6 | 7 | namespace SB3Utility 8 | { 9 | public class XmlComments 10 | { 11 | public string Name; 12 | public string Description; 13 | public Dictionary Parameters; 14 | public string Returns = null; 15 | 16 | public XmlComments(XElement element) 17 | { 18 | string ns = element.Name.NamespaceName; 19 | XName xname = XName.Get("name", ns); 20 | 21 | Name = element.Attribute(xname).Value; 22 | Parameters = new Dictionary(); 23 | 24 | foreach (var child in element.Elements()) 25 | { 26 | switch (child.Name.LocalName.ToLowerInvariant()) 27 | { 28 | case "summary": 29 | Description = child.Value.Trim(); 30 | break; 31 | case "param": 32 | Parameters.Add(child.Attribute(xname).Value, child.Value.Trim()); 33 | break; 34 | case "returns": 35 | Returns = child.Value; 36 | break; 37 | default: 38 | break; 39 | } 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SB3UtilityScript/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | 4 | namespace SB3Utility 5 | { 6 | public class Program 7 | { 8 | public static int Main(string[] args) 9 | { 10 | try 11 | { 12 | Thread.CurrentThread.CurrentCulture = Utility.CultureUS; 13 | 14 | if (args.Length <= 0) 15 | { 16 | Console.WriteLine("Usage: SB3UtilityScript \"scriptPath.txt\""); 17 | } 18 | else 19 | { 20 | for (int i = 0; i < args.Length; i++) 21 | { 22 | ScriptMain script = new ScriptMain(); 23 | Report.Log += new Action(Logger); 24 | script.LoadPlugin((string)script.ScriptEnvironment.Variables[ScriptExecutor.PluginDirectoryName] + "SB3UtilityPlugins.dll"); 25 | script.RunScript(args[i]); 26 | } 27 | } 28 | 29 | return 0; 30 | } 31 | catch (Exception ex) 32 | { 33 | Exception inner = ex; 34 | while (inner != null) 35 | { 36 | Console.WriteLine(inner.Message); 37 | inner = inner.InnerException; 38 | } 39 | 40 | return -1; 41 | } 42 | } 43 | 44 | static void Logger(string s) 45 | { 46 | Console.WriteLine(s); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/SpriteRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using SlimDX; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class SpriteRenderer : MeshRenderer, Component 11 | { 12 | public PPtr m_Sprite { get; set; } 13 | public Color4 m_Color { get; set; } 14 | 15 | public SpriteRenderer(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 16 | : base(file, pathID, classID1, classID2) { } 17 | 18 | public SpriteRenderer(AssetCabinet file) : 19 | this(file, 0, UnityClassID.SpriteRenderer, UnityClassID.SpriteRenderer) 20 | { 21 | file.ReplaceSubfile(-1, this, null); 22 | 23 | base.SetDefaults(); 24 | } 25 | 26 | public new void LoadFrom(Stream stream) 27 | { 28 | base.LoadFrom(stream); 29 | 30 | BinaryReader reader = new BinaryReader(stream); 31 | m_Sprite = new PPtr(stream, file); 32 | m_Color = reader.ReadColor4(); 33 | } 34 | 35 | public new void WriteTo(Stream stream) 36 | { 37 | base.WriteTo(stream); 38 | 39 | BinaryWriter writer = new BinaryWriter(stream); 40 | m_Sprite.WriteTo(stream); 41 | writer.Write(m_Color); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /AiDroidPlugin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | False 10 | 11 | 12 | True 13 | 14 | 15 | True 16 | 17 | 18 | .RE-M 19 | 20 | 21 | -------------------------------------------------------------------------------- /AiDroidBase/FPK/reaOps.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | using SB3Utility; 4 | 5 | namespace AiDroidPlugin 6 | { 7 | public static partial class rea 8 | { 9 | public static reaAnimationTrack FindTrack(remId trackName, reaParser parser) 10 | { 11 | foreach (reaAnimationTrack track in parser.ANIC) 12 | { 13 | if (track.boneFrame == trackName) 14 | { 15 | return track; 16 | } 17 | } 18 | 19 | return null; 20 | } 21 | 22 | public static void SaveREA(reaParser parser, string destPath, bool keepBackup) 23 | { 24 | DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(destPath)); 25 | 26 | string backup = null; 27 | if (keepBackup && File.Exists(destPath)) 28 | { 29 | backup = Utility.GetDestFile(dir, Path.GetFileNameWithoutExtension(destPath) + ".bak", Path.GetExtension(destPath)); 30 | File.Move(destPath, backup); 31 | } 32 | 33 | try 34 | { 35 | using (BufferedStream bufStr = new BufferedStream(File.OpenWrite(destPath))) 36 | { 37 | parser.WriteTo(bufStr); 38 | } 39 | } 40 | catch 41 | { 42 | if (File.Exists(backup)) 43 | { 44 | if (File.Exists(destPath)) 45 | File.Delete(destPath); 46 | File.Move(backup, destPath); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/LinkToGameObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public class LinkToGameObject : Component, LinkedByGameObject, StoresReferences 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public PPtr m_GameObject { get; set; } 15 | 16 | public LinkToGameObject(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 17 | { 18 | this.file = file; 19 | this.pathID = pathID; 20 | this.classID1 = classID1; 21 | this.classID2 = classID2; 22 | } 23 | 24 | public LinkToGameObject(AssetCabinet file) : 25 | this(file, 0, UnityClassID.LinkToGameObject, UnityClassID.LinkToGameObject) 26 | { 27 | file.ReplaceSubfile(-1, this, null); 28 | } 29 | 30 | public void LoadFrom(Stream stream) 31 | { 32 | BinaryReader reader = new BinaryReader(stream); 33 | m_GameObject = new PPtr(stream, file); 34 | } 35 | 36 | public void WriteTo(Stream stream) 37 | { 38 | BinaryWriter writer = new BinaryWriter(stream); 39 | m_GameObject.WriteTo(stream); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SB3UtilityGUI/FormLog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using WeifenLuo.WinFormsUI.Docking; 10 | 11 | namespace SB3Utility 12 | { 13 | public partial class FormLog : DockContent 14 | { 15 | public FormLog() 16 | { 17 | InitializeComponent(); 18 | 19 | richTextBox1.AllowDrop = true; 20 | richTextBox1.DragEnter += new DragEventHandler(richTextBox1_DragEnter); 21 | richTextBox1.DragDrop += new DragEventHandler(richTextBox1_DragDrop); 22 | } 23 | 24 | public void Logger(string s) 25 | { 26 | richTextBox1.SuspendLayout(); 27 | richTextBox1.AppendText(s + Environment.NewLine); 28 | richTextBox1.SelectionStart = richTextBox1.Text.Length; 29 | richTextBox1.ScrollToCaret(); 30 | richTextBox1.ResumeLayout(); 31 | } 32 | 33 | void richTextBox1_DragEnter(object sender, DragEventArgs e) 34 | { 35 | Gui.Docking.DockDragEnter(sender, e); 36 | } 37 | 38 | void richTextBox1_DragDrop(object sender, DragEventArgs e) 39 | { 40 | Gui.Docking.DockDragDrop(sender, e); 41 | } 42 | 43 | private void clearToolStripMenuItem_Click(object sender, EventArgs e) 44 | { 45 | richTextBox1.Text = String.Empty; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ODFPlugin/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace ODFPlugin.Properties { 2 | 3 | 4 | // This class allows you to handle specific events on the settings class: 5 | // The SettingChanging event is raised before a setting's value is changed. 6 | // The PropertyChanged event is raised after a setting's value is changed. 7 | // The SettingsLoaded event is raised after the setting values are loaded. 8 | // The SettingsSaving event is raised before the setting values are saved. 9 | internal sealed partial class Settings { 10 | 11 | public Settings() { 12 | // // To add event handlers for saving and changing settings, uncomment the lines below: 13 | // 14 | // this.SettingChanging += this.SettingChangingEventHandler; 15 | // 16 | // this.SettingsSaving += this.SettingsSavingEventHandler; 17 | // 18 | } 19 | 20 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 21 | // Add code to handle the SettingChangingEvent event here. 22 | } 23 | 24 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 25 | // Add code to handle the SettingsSaving event here. 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace UnityPlugin.Properties { 2 | 3 | 4 | // This class allows you to handle specific events on the settings class: 5 | // The SettingChanging event is raised before a setting's value is changed. 6 | // The PropertyChanged event is raised after a setting's value is changed. 7 | // The SettingsLoaded event is raised after the setting values are loaded. 8 | // The SettingsSaving event is raised before the setting values are saved. 9 | internal sealed partial class Settings { 10 | 11 | public Settings() { 12 | // // To add event handlers for saving and changing settings, uncomment the lines below: 13 | // 14 | // this.SettingChanging += this.SettingChangingEventHandler; 15 | // 16 | // this.SettingsSaving += this.SettingsSavingEventHandler; 17 | // 18 | } 19 | 20 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 21 | // Add code to handle the SettingChangingEvent event here. 22 | } 23 | 24 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 25 | // Add code to handle the SettingsSaving event here. 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | 10 | namespace SB3Utility 11 | { 12 | public partial class FormPPSave : Form 13 | { 14 | BackgroundWorker worker; 15 | 16 | public FormPPSave(BackgroundWorker worker) 17 | { 18 | InitializeComponent(); 19 | 20 | this.worker = worker; 21 | worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); 22 | worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged); 23 | 24 | this.Shown += new EventHandler(FormPPSave_Shown); 25 | } 26 | 27 | void FormPPSave_Shown(object sender, EventArgs e) 28 | { 29 | worker.RunWorkerAsync(); 30 | } 31 | 32 | void worker_ProgressChanged(object sender, ProgressChangedEventArgs e) 33 | { 34 | progressBar1.Value = e.ProgressPercentage; 35 | } 36 | 37 | void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) 38 | { 39 | if (e.Cancelled) 40 | { 41 | this.DialogResult = DialogResult.Cancel; 42 | } 43 | if (e.Error != null) 44 | { 45 | Utility.ReportException(e.Error); 46 | this.DialogResult = DialogResult.Cancel; 47 | } 48 | 49 | Close(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityFBX/SB3UtilityFBX.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | 31 | 32 | Header Files 33 | 34 | 35 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/LinkToGameObject223.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public class LinkToGameObject223 : Component, LinkedByGameObject, StoresReferences 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public PPtr m_GameObject { get; set; } 15 | public byte[] Data { get; set; } 16 | 17 | public LinkToGameObject223(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 18 | { 19 | this.file = file; 20 | this.pathID = pathID; 21 | this.classID1 = classID1; 22 | this.classID2 = classID2; 23 | } 24 | 25 | public LinkToGameObject223(AssetCabinet file) : 26 | this(file, 0, UnityClassID.LinkToGameObject223, UnityClassID.LinkToGameObject223) 27 | { 28 | file.ReplaceSubfile(-1, this, null); 29 | } 30 | 31 | public void LoadFrom(Stream stream) 32 | { 33 | BinaryReader reader = new BinaryReader(stream); 34 | m_GameObject = new PPtr(stream, file); 35 | Data = reader.ReadBytes(30); 36 | } 37 | 38 | public void WriteTo(Stream stream) 39 | { 40 | BinaryWriter writer = new BinaryWriter(stream); 41 | m_GameObject.WriteTo(stream); 42 | writer.Write(Data); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/LinkToGameObject225.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace UnityPlugin 6 | { 7 | public class LinkToGameObject225 : Component, LinkedByGameObject, StoresReferences 8 | { 9 | public AssetCabinet file { get; set; } 10 | public int pathID { get; set; } 11 | public UnityClassID classID1 { get; set; } 12 | public UnityClassID classID2 { get; set; } 13 | 14 | public PPtr m_GameObject { get; set; } 15 | public byte[] Data { get; set; } 16 | 17 | public LinkToGameObject225(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 18 | { 19 | this.file = file; 20 | this.pathID = pathID; 21 | this.classID1 = classID1; 22 | this.classID2 = classID2; 23 | } 24 | 25 | public LinkToGameObject225(AssetCabinet file) : 26 | this(file, 0, UnityClassID.LinkToGameObject225, UnityClassID.LinkToGameObject225) 27 | { 28 | file.ReplaceSubfile(-1, this, null); 29 | } 30 | 31 | public void LoadFrom(Stream stream) 32 | { 33 | BinaryReader reader = new BinaryReader(stream); 34 | m_GameObject = new PPtr(stream, file); 35 | Data = reader.ReadBytes(12); 36 | } 37 | 38 | public void WriteTo(Stream stream) 39 | { 40 | BinaryWriter writer = new BinaryWriter(stream); 41 | m_GameObject.WriteTo(stream); 42 | writer.Write(Data); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /AiDroidPlugin/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | True 12 | 13 | 14 | False 15 | 16 | 17 | True 18 | 19 | 20 | True 21 | 22 | 23 | .RE-M 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SB3Utility/ObjChildren.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace SB3Utility 7 | { 8 | public interface IObjChild 9 | { 10 | dynamic Parent { get; set; } 11 | } 12 | 13 | public abstract class ObjChildren : IEnumerable where T : IObjChild 14 | { 15 | protected List children; 16 | 17 | public T this[int i] 18 | { 19 | get { return (T)children[i]; } 20 | } 21 | 22 | public int Count 23 | { 24 | get { return children.Count; } 25 | } 26 | 27 | public void InitChildren(int count) 28 | { 29 | children = new List(count); 30 | } 31 | 32 | public void AddChild(T obj) 33 | { 34 | children.Add(obj); 35 | obj.Parent = this; 36 | } 37 | 38 | public void InsertChild(int i, T obj) 39 | { 40 | children.Insert(i, obj); 41 | obj.Parent = this; 42 | } 43 | 44 | public void RemoveChild(T obj) 45 | { 46 | obj.Parent = null; 47 | children.Remove(obj); 48 | } 49 | 50 | public void RemoveChild(int i) 51 | { 52 | children[i].Parent = null; 53 | children.RemoveAt(i); 54 | } 55 | 56 | public int IndexOf(T obj) 57 | { 58 | return children.IndexOf(obj); 59 | } 60 | 61 | public IEnumerator GetEnumerator() 62 | { 63 | return children.GetEnumerator(); 64 | } 65 | 66 | IEnumerator IEnumerable.GetEnumerator() 67 | { 68 | return GetEnumerator(); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ODFPlugin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | False 7 | 8 | 9 | False 10 | 11 | 12 | True 13 | 14 | 15 | False 16 | 17 | 18 | False 19 | 20 | 21 | FBX 2014.1 22 | 23 | 24 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityFBX/AssemblyInfo.cpp: -------------------------------------------------------------------------------- 1 | using namespace System; 2 | using namespace System::Reflection; 3 | using namespace System::Runtime::CompilerServices; 4 | using namespace System::Runtime::InteropServices; 5 | using namespace System::Security::Permissions; 6 | 7 | // 8 | // General Information about an assembly is controlled through the following 9 | // set of attributes. Change these attribute values to modify the information 10 | // associated with an assembly. 11 | // 12 | [assembly:AssemblyTitleAttribute("SB3UtilityFBX")]; 13 | [assembly:AssemblyDescriptionAttribute("")]; 14 | [assembly:AssemblyConfigurationAttribute("")]; 15 | [assembly:AssemblyCompanyAttribute("")]; 16 | [assembly:AssemblyProductAttribute("SB3UtilityFBX")]; 17 | [assembly:AssemblyCopyrightAttribute("Copyright (c) 2009")]; 18 | [assembly:AssemblyTrademarkAttribute("")]; 19 | [assembly:AssemblyCultureAttribute("")]; 20 | 21 | // 22 | // Version information for an assembly consists of the following four values: 23 | // 24 | // Major Version 25 | // Minor Version 26 | // Build Number 27 | // Revision 28 | // 29 | // You can specify all the value or you can default the Revision and Build Numbers 30 | // by using the '*' as shown below: 31 | 32 | [assembly:AssemblyVersionAttribute("1.0.*")]; 33 | 34 | [assembly:ComVisible(false)]; 35 | 36 | [assembly:CLSCompliantAttribute(true)]; 37 | 38 | [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; 39 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/FlareLayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | class FlareLayer : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public byte m_Enabled { get; set; } 19 | 20 | public FlareLayer(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 21 | { 22 | this.file = file; 23 | this.pathID = pathID; 24 | this.classID1 = classID1; 25 | this.classID2 = classID2; 26 | } 27 | 28 | public FlareLayer(AssetCabinet file) : 29 | this(file, 0, UnityClassID.FlareLayer, UnityClassID.FlareLayer) 30 | { 31 | file.ReplaceSubfile(-1, this, null); 32 | } 33 | 34 | public void LoadFrom(Stream stream) 35 | { 36 | BinaryReader reader = new BinaryReader(stream); 37 | m_GameObject = new PPtr(stream, file); 38 | m_Enabled = reader.ReadByte(); 39 | stream.Position += 3; 40 | } 41 | 42 | public void WriteTo(Stream stream) 43 | { 44 | BinaryWriter writer = new BinaryWriter(stream); 45 | m_GameObject.WriteTo(stream); 46 | writer.Write(m_Enabled); 47 | stream.Position += 3; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/AudioListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | class AudioListener : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public byte m_Enabled { get; set; } 19 | 20 | public AudioListener(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 21 | { 22 | this.file = file; 23 | this.pathID = pathID; 24 | this.classID1 = classID1; 25 | this.classID2 = classID2; 26 | } 27 | 28 | public AudioListener(AssetCabinet file) : 29 | this(file, 0, UnityClassID.AudioListener, UnityClassID.AudioListener) 30 | { 31 | file.ReplaceSubfile(-1, this, null); 32 | } 33 | 34 | public void LoadFrom(Stream stream) 35 | { 36 | BinaryReader reader = new BinaryReader(stream); 37 | m_GameObject = new PPtr(stream, file); 38 | m_Enabled = reader.ReadByte(); 39 | stream.Position += 3; 40 | } 41 | 42 | public void WriteTo(Stream stream) 43 | { 44 | BinaryWriter writer = new BinaryWriter(stream); 45 | m_GameObject.WriteTo(stream); 46 | writer.Write(m_Enabled); 47 | stream.Position += 3; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormXXSnapBorders.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Windows.Forms; 4 | 5 | namespace SB3Utility 6 | { 7 | public partial class FormXXSnapBorders : Form 8 | { 9 | private SizeF startSize; 10 | 11 | public FormXXSnapBorders(string targetSubmeshes) 12 | { 13 | InitializeComponent(); 14 | Text += targetSubmeshes; 15 | startSize = new SizeF(Width, Height); 16 | this.SaveDesignSizes(); 17 | } 18 | 19 | private void FormXXDragDrop_Shown(object sender, EventArgs e) 20 | { 21 | Size dialogSize = (Size)Gui.Config["DialogXXSnapBordersSize"]; 22 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 23 | { 24 | Width = dialogSize.Width; 25 | Height = dialogSize.Height; 26 | this.ResizeControls(startSize); 27 | } 28 | else 29 | { 30 | Width = (int)startSize.Width; 31 | Height = (int)startSize.Height; 32 | this.ResetControls(); 33 | } 34 | } 35 | 36 | private void FormXXDragDrop_Resize(object sender, EventArgs e) 37 | { 38 | this.ResizeControls(startSize); 39 | } 40 | 41 | private void FormXXDragDrop_VisibleChanged(object sender, EventArgs e) 42 | { 43 | if (!Visible) 44 | { 45 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 46 | { 47 | Gui.Config["DialogXXSnapBordersSize"] = new Size(0, 0); 48 | } 49 | else 50 | { 51 | Gui.Config["DialogXXSnapBordersSize"] = this.Size; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormXXNormals.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace SB3Utility 10 | { 11 | public partial class FormXXNormals : Form 12 | { 13 | private SizeF startSize; 14 | 15 | public FormXXNormals() 16 | { 17 | InitializeComponent(); 18 | startSize = new SizeF(Width, Height); 19 | this.SaveDesignSizes(); 20 | } 21 | 22 | private void FormXXDragDrop_Shown(object sender, EventArgs e) 23 | { 24 | Size dialogSize = (Size)Gui.Config["DialogXXNormalsSize"]; 25 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 26 | { 27 | Width = dialogSize.Width; 28 | Height = dialogSize.Height; 29 | this.ResizeControls(startSize); 30 | } 31 | else 32 | { 33 | Width = (int)startSize.Width; 34 | Height = (int)startSize.Height; 35 | this.ResetControls(); 36 | } 37 | } 38 | 39 | private void FormXXDragDrop_Resize(object sender, EventArgs e) 40 | { 41 | this.ResizeControls(startSize); 42 | } 43 | 44 | private void FormXXDragDrop_VisibleChanged(object sender, EventArgs e) 45 | { 46 | if (!Visible) 47 | { 48 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 49 | { 50 | Gui.Config["DialogXXNormalsSize"] = new Size(0, 0); 51 | } 52 | else 53 | { 54 | Gui.Config["DialogXXNormalsSize"] = this.Size; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /ODFPlugin/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | False 12 | 13 | 14 | False 15 | 16 | 17 | True 18 | 19 | 20 | False 21 | 22 | 23 | False 24 | 25 | 26 | FBX 2014.1 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /SB3Utility/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SB3Utility")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SB3Utility")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("79b75d94-dcd9-429e-96a4-879ba903ac8f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ODFPlugin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ODFPlugin")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ODFPlugin")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("78145566-8dc6-4cbe-aa43-6ac4df17e553")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/WakeariStream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | using System.Security.Cryptography; 6 | 7 | namespace SB3Utility 8 | { 9 | public class WakeariStream : CryptoStream 10 | { 11 | private int lastOffset = 0; 12 | 13 | public byte[] LastBytes { get; protected set; } 14 | 15 | public WakeariStream(Stream stream, ICryptoTransform transform, CryptoStreamMode mode) 16 | : base(stream, transform, mode) 17 | { 18 | LastBytes = new byte[20]; 19 | } 20 | 21 | public override void Write(byte[] buffer, int offset, int count) 22 | { 23 | if (count >= 20) 24 | { 25 | Array.Copy(buffer, offset + count - 20, LastBytes, 0, 20); 26 | lastOffset = 20; 27 | } 28 | else 29 | { 30 | int total = lastOffset + count; 31 | if (total > 20) 32 | { 33 | int shift = total - 20; 34 | int copy = 20 - count; 35 | for (int i = 0; i < copy; i++) 36 | { 37 | LastBytes[i] = LastBytes[shift + i]; 38 | } 39 | 40 | for (int i = count; i < count; i++) 41 | { 42 | LastBytes[i + copy] = buffer[offset + i]; 43 | } 44 | lastOffset = 20; 45 | } 46 | else 47 | { 48 | for (int i = 0; i < count; i++) 49 | { 50 | LastBytes[i + lastOffset] = buffer[offset + i]; 51 | } 52 | lastOffset += count; 53 | } 54 | } 55 | 56 | base.Write(buffer, offset, count); 57 | } 58 | 59 | public override void Close() 60 | { 61 | LastBytes = null; 62 | base.Close(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/FormNormalsAndTangents.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace SB3Utility 10 | { 11 | public partial class FormNormalsAndTangents : Form 12 | { 13 | private SizeF startSize; 14 | 15 | public FormNormalsAndTangents() 16 | { 17 | InitializeComponent(); 18 | startSize = new SizeF(Width, Height); 19 | this.SaveDesignSizes(); 20 | } 21 | 22 | private void FormNormalsAndTagents_Shown(object sender, EventArgs e) 23 | { 24 | Size dialogSize = (Size)Gui.Config["DialogXXNormalsSize"]; 25 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 26 | { 27 | Width = dialogSize.Width; 28 | Height = dialogSize.Height; 29 | this.ResizeControls(startSize); 30 | } 31 | else 32 | { 33 | Width = (int)startSize.Width; 34 | Height = (int)startSize.Height; 35 | this.ResetControls(); 36 | } 37 | } 38 | 39 | private void FormNormalsAndTagents_Resize(object sender, EventArgs e) 40 | { 41 | this.ResizeControls(startSize); 42 | } 43 | 44 | private void FormNormalsAndTagents_VisibleChanged(object sender, EventArgs e) 45 | { 46 | if (!Visible) 47 | { 48 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 49 | { 50 | Gui.Config["DialogXXNormalsSize"] = new Size(0, 0); 51 | } 52 | else 53 | { 54 | Gui.Config["DialogXXNormalsSize"] = this.Size; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SB3UtilityGUI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SB3UtilityGUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SB3UtilityGUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("db3d30f5-7de6-44df-98a9-5f687f258d76")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ODFBase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ODFStructure")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("ODFStructure")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("704a0d4f-c672-423c-becf-391bb86131ea")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SB3UtilityPP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SB3UtilityPP")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("51277abf-8d1b-4a71-8f03-fec314a4c16d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SB3UtilityScript/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SB3UtilityScript")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SB3UtilityScript")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("cd0140d9-c497-4069-8f91-708d940a1f69")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AiDroidBase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AiDroidBase")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("AiDroidBase")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("45dddcc4-9832-4b61-8c9a-304dab72be88")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/NIFPlugin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("NIFPlugin")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("NIFPlugin")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("adfbfbb5-8ae1-4160-bbcf-c032a345c8db")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/UnityBase/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnityBase")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("UnityBase")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f0db7c7d-f5e1-4ff3-b23e-7c09c374bbfd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /AiDroidPlugin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AiDroidPlugin")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("AiDroidPlugin")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f0a1e2da-aa04-47de-9acf-3166d466a9b8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SB3UtilityPlugins")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SB3UtilityPlugins")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e6b0366f-883c-4b2d-8141-172400e7970c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnityPlugin")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("UnityPlugin")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("85f101b3-5f54-48a2-969d-0053a7f7379b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /PPD_Preview_Clothes/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PPD_Preview_Clothes")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("PPD_Preview_Clothes")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("68108e21-5b00-41dd-a766-d3f1ab93fc3b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Plugins/UnityBase/NotLoaded.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace UnityPlugin 8 | { 9 | public class NotLoaded : NeedsSourceStreamForWriting, Component 10 | { 11 | public uint offset; 12 | public uint size; 13 | 14 | public AssetCabinet file { get; set; } 15 | public int pathID 16 | { 17 | get { return replacement != null ? replacement.pathID : _pathID; } 18 | set { _pathID = value; } 19 | } 20 | private int _pathID { get; set; } 21 | public UnityClassID classID1 { get; set; } 22 | public UnityClassID classID2 { get; set; } 23 | public Component replacement { get; set; } 24 | 25 | public string Name { get; set; } 26 | 27 | public NotLoaded(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 28 | { 29 | this.file = file; 30 | this.pathID = pathID; 31 | this.classID1 = classID1; 32 | this.classID2 = classID2; 33 | } 34 | 35 | public Stream SourceStream { get; set; } 36 | 37 | public void LoadFrom(Stream stream) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | 42 | public void WriteTo(Stream stream) 43 | { 44 | BinaryWriter writer = new BinaryWriter(stream); 45 | BinaryReader reader = new BinaryReader(SourceStream); 46 | SourceStream.Position = offset; 47 | for (uint count = 0; count < size; ) 48 | { 49 | uint len = count + Utility.BufSize > size ? size - count : Utility.BufSize; 50 | byte[] buf = reader.ReadBytes(len); 51 | writer.Write(buf); 52 | count += len; 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/MeshFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace UnityPlugin 7 | { 8 | public class MeshFilter : Component, LinkedByGameObject, StoresReferences 9 | { 10 | public AssetCabinet file { get; set; } 11 | public int pathID { get; set; } 12 | public UnityClassID classID1 { get; set; } 13 | public UnityClassID classID2 { get; set; } 14 | 15 | public PPtr m_GameObject { get; set; } 16 | public PPtr m_Mesh { get; set; } 17 | 18 | public MeshFilter(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 19 | { 20 | this.file = file; 21 | this.pathID = pathID; 22 | this.classID1 = classID1; 23 | this.classID2 = classID2; 24 | } 25 | 26 | public MeshFilter(AssetCabinet file) : 27 | this(file, 0, UnityClassID.MeshFilter, UnityClassID.MeshFilter) 28 | { 29 | file.ReplaceSubfile(-1, this, null); 30 | } 31 | 32 | public void LoadFrom(Stream stream) 33 | { 34 | m_GameObject = new PPtr(stream, file); 35 | m_Mesh = new PPtr(stream, file); 36 | } 37 | 38 | public void WriteTo(Stream stream) 39 | { 40 | m_GameObject.WriteTo(stream); 41 | m_Mesh.WriteTo(stream); 42 | } 43 | 44 | public MeshFilter Clone(AssetCabinet file) 45 | { 46 | file.MergeTypeDefinition(this.file, UnityClassID.MeshFilter); 47 | 48 | MeshFilter filter = new MeshFilter(file); 49 | filter.m_Mesh = new PPtr(m_Mesh.instance != null ? m_Mesh.instance.Clone(file) : null); 50 | return filter; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/ToolOutput.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace SB3Utility 4 | { 5 | public class ToolOutputParser : IWriteFile 6 | { 7 | public byte[] contents; 8 | public bool readFromOtherParser; 9 | 10 | public ToolOutputParser(Stream stream, string name) 11 | : this(stream) 12 | { 13 | this.Name = name; 14 | } 15 | 16 | public ToolOutputParser(Stream stream) 17 | { 18 | using (BinaryReader reader = new BinaryReader(stream)) 19 | { 20 | contents = reader.ReadToEnd(); 21 | } 22 | } 23 | 24 | public string Name { get; set; } 25 | 26 | public void WriteTo(Stream stream) 27 | { 28 | BinaryWriter writer = new BinaryWriter(stream); 29 | writer.Write(contents); 30 | } 31 | } 32 | 33 | public static partial class Plugins 34 | { 35 | [Plugin] 36 | public static ToolOutputParser OpenToolOutput([DefaultVar]ppParser parser, string name) 37 | { 38 | for (int i = 0; i < parser.Subfiles.Count; i++) 39 | { 40 | if (parser.Subfiles[i].Name == name) 41 | { 42 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 43 | if (subfile != null) 44 | { 45 | return new ToolOutputParser(subfile.CreateReadStream(), subfile.Name); 46 | } 47 | IWriteFile writeFile = parser.Subfiles[i] as IWriteFile; 48 | if (writeFile != null) 49 | { 50 | using (MemoryStream memStream = new MemoryStream()) 51 | { 52 | writeFile.WriteTo(memStream); 53 | memStream.Position = 0; 54 | ToolOutputParser outParser = new ToolOutputParser(memStream, writeFile.Name); 55 | outParser.readFromOtherParser = true; 56 | return outParser; 57 | } 58 | } 59 | break; 60 | } 61 | } 62 | return null; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | True 7 | 8 | 9 | .unit-y3d 10 | 11 | 12 | .asse-ts 13 | 14 | 15 | .none 16 | 17 | 18 | 0, 0 19 | 20 | 21 | .\StringToHash\ArgToHash.exe 22 | 23 | 24 | -nolog -batchmode -nographics -server 25 | 26 | 27 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | True 12 | 13 | 14 | .unit-y3d 15 | 16 | 17 | .asse-ts 18 | 19 | 20 | .none 21 | 22 | 23 | 0, 0 24 | 25 | 26 | .\StringToHash\ArgToHash.exe 27 | 28 | 29 | -nolog -batchmode -nographics -server 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/Win32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime; 3 | using System.Runtime.InteropServices; 4 | 5 | using HWND = System.IntPtr; 6 | 7 | namespace UrielGuy.SyntaxHighlightingTextBox 8 | { 9 | /// 10 | /// Summary description for Win32. 11 | /// 12 | public class Win32 13 | { 14 | private Win32() 15 | { 16 | } 17 | 18 | public const int WM_USER = 0x400; 19 | public const int WM_PAINT = 0xF; 20 | public const int WM_KEYDOWN = 0x100; 21 | public const int WM_KEYUP = 0x101; 22 | public const int WM_CHAR = 0x102; 23 | 24 | public const int EM_GETSCROLLPOS = (WM_USER + 221); 25 | public const int EM_SETSCROLLPOS = (WM_USER + 222); 26 | 27 | public const int VK_BACK = 0x08; 28 | public const int VK_TAB = 0x09; 29 | 30 | public const int VK_SHIFT = 0x10; 31 | public const int VK_CONTROL = 0x11; 32 | public const int VK_MENU = 0x12; 33 | public const int VK_LEFT = 0x25; 34 | public const int VK_UP = 0x26; 35 | public const int VK_RIGHT = 0x27; 36 | public const int VK_DOWN = 0x28; 37 | public const int VK_DELETE = 0x2E; 38 | public const int VK_NUMLOCK = 0x90; 39 | 40 | public const short KS_ON = 0x01; 41 | public const short KS_KEYDOWN = 0x80; 42 | 43 | [StructLayout(LayoutKind.Sequential)] 44 | public struct POINT 45 | { 46 | public int x; 47 | public int y; 48 | } 49 | 50 | [DllImport("user32")] public static extern int SendMessage(HWND hwnd, int wMsg, int wParam, IntPtr lParam); 51 | [DllImport("user32")] public static extern int PostMessage(HWND hwnd, int wMsg, int wParam, int lParam); 52 | [DllImport("user32")] public static extern short GetKeyState(int nVirtKey); 53 | [DllImport("user32")] public static extern int LockWindowUpdate(HWND hwnd); 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormXXConvert.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace SB3Utility 10 | { 11 | public partial class FormXXConvert : Form 12 | { 13 | public int Format { get; protected set; } 14 | 15 | private SizeF startSize; 16 | 17 | public FormXXConvert(int format) 18 | { 19 | InitializeComponent(); 20 | startSize = new SizeF(Width, Height); 21 | this.SaveDesignSizes(); 22 | 23 | Format = format; 24 | numericUpDown1.Value = format; 25 | numericUpDown1.ValueChanged += new EventHandler(numericUpDown1_ValueChanged); 26 | } 27 | 28 | private void numericUpDown1_ValueChanged(object sender, EventArgs e) 29 | { 30 | Format = Decimal.ToInt32(numericUpDown1.Value); 31 | } 32 | 33 | private void FormXXConvert_Shown(object sender, EventArgs e) 34 | { 35 | Size dialogSize = (Size)Gui.Config["DialogXXConvertSize"]; 36 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 37 | { 38 | Width = dialogSize.Width; 39 | Height = dialogSize.Height; 40 | this.ResizeControls(startSize); 41 | } 42 | else 43 | { 44 | Width = (int)startSize.Width; 45 | Height = (int)startSize.Height; 46 | this.ResetControls(); 47 | } 48 | } 49 | 50 | private void FormXXConvert_Resize(object sender, EventArgs e) 51 | { 52 | this.ResizeControls(startSize); 53 | } 54 | 55 | private void FormXXConvert_VisibleChanged(object sender, EventArgs e) 56 | { 57 | if (!Visible) 58 | { 59 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 60 | { 61 | Gui.Config["DialogXXConvertSize"] = new Size(0, 0); 62 | } 63 | else 64 | { 65 | Gui.Config["DialogXXConvertSize"] = this.Size; 66 | } 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/SyntaxHighlightingTextBox.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | text/microsoft-resx 32 | 33 | 34 | 1.0.0.0 35 | 36 | 37 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 38 | 39 | 40 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 41 | 42 | 43 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/MultiLink.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace UnityPlugin 8 | { 9 | public class MultiLink : Component, StoresReferences 10 | { 11 | public AssetCabinet file { get; set; } 12 | public int pathID { get; set; } 13 | public UnityClassID classID1 { get; set; } 14 | public UnityClassID classID2 { get; set; } 15 | 16 | public PPtr m_GameObject { get; set; } 17 | public float[] Unknown1 { get; set; } 18 | public List> Links { get; set; } 19 | public float[] Unknown2 { get; set; } 20 | 21 | public MultiLink(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 22 | { 23 | this.file = file; 24 | this.pathID = pathID; 25 | this.classID1 = classID1; 26 | this.classID2 = classID2; 27 | } 28 | 29 | public MultiLink(AssetCabinet file) : 30 | this(file, 0, UnityClassID.MultiLink, UnityClassID.MultiLink) 31 | { 32 | file.ReplaceSubfile(-1, this, null); 33 | } 34 | 35 | public void LoadFrom(Stream stream) 36 | { 37 | BinaryReader reader = new BinaryReader(stream); 38 | long pos = stream.Position; 39 | m_GameObject = new PPtr(stream, file); 40 | Unknown1 = reader.ReadSingleArray(10); 41 | 42 | int numLinks = 1 + reader.ReadInt32(); 43 | Links = new List>(numLinks); 44 | for (int i = 0; i < numLinks; i++) 45 | { 46 | Links.Add(new PPtr(stream, file)); 47 | } 48 | 49 | Unknown2 = reader.ReadSingleArray(10); 50 | } 51 | 52 | public void WriteTo(Stream stream) 53 | { 54 | BinaryWriter writer = new BinaryWriter(stream); 55 | m_GameObject.WriteTo(stream); 56 | writer.Write(Unknown1); 57 | 58 | writer.Write(Links.Count - 1); 59 | for (int i = 0; i < Links.Count; i++) 60 | { 61 | Links[i].WriteTo(stream); 62 | } 63 | 64 | writer.Write(Unknown2); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /PPD_Preview_Clothes/sviex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Text; 4 | 5 | using SB3Utility; 6 | 7 | namespace PPD_Preview_Clothes 8 | { 9 | public static partial class PluginsPPD 10 | { 11 | [Plugin] 12 | public static sviexParser OpenSVIEX([DefaultVar]ppParser parser, string name) 13 | { 14 | for (int i = 0; i < parser.Subfiles.Count; i++) 15 | { 16 | if (parser.Subfiles[i].Name == name) 17 | { 18 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 19 | if (subfile != null) 20 | { 21 | return new sviexParser(subfile.CreateReadStream(), subfile.Name); 22 | } 23 | if (parser.Subfiles[i] is sviexParser) 24 | { 25 | return (sviexParser)parser.Subfiles[i]; 26 | } 27 | else if (parser.Subfiles[i] is ToolOutputParser) 28 | { 29 | ToolOutputParser toolOutputParser = (ToolOutputParser)parser.Subfiles[i]; 30 | return new sviexParser(new MemoryStream(toolOutputParser.contents), toolOutputParser.Name); 31 | } 32 | 33 | break; 34 | } 35 | } 36 | return null; 37 | } 38 | 39 | [Plugin] 40 | public static sviParser OpenSVI([DefaultVar]ppParser parser, string name) 41 | { 42 | for (int i = 0; i < parser.Subfiles.Count; i++) 43 | { 44 | if (parser.Subfiles[i].Name == name) 45 | { 46 | IReadFile subfile = parser.Subfiles[i] as IReadFile; 47 | if (subfile != null) 48 | { 49 | return new sviParser(subfile.CreateReadStream(), subfile.Name); 50 | } 51 | if (parser.Subfiles[i] is sviParser) 52 | { 53 | return (sviParser)parser.Subfiles[i]; 54 | } 55 | else if (parser.Subfiles[i] is ToolOutputParser) 56 | { 57 | ToolOutputParser toolOutputParser = (ToolOutputParser)parser.Subfiles[i]; 58 | return new sviParser(new MemoryStream(toolOutputParser.contents), toolOutputParser.Name); 59 | } 60 | 61 | break; 62 | } 63 | } 64 | return null; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/BoxCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using SlimDX; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class BoxCollider : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public PPtr m_Material { get; set; } 19 | public bool m_IsTrigger { get; set; } 20 | public bool m_Enabled { get; set; } 21 | public Vector3 m_Size { get; set; } 22 | public Vector3 m_Center { get; set; } 23 | 24 | public BoxCollider(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 25 | { 26 | this.file = file; 27 | this.pathID = pathID; 28 | this.classID1 = classID1; 29 | this.classID2 = classID2; 30 | } 31 | 32 | public BoxCollider(AssetCabinet file) : 33 | this(file, 0, UnityClassID.BoxCollider, UnityClassID.BoxCollider) 34 | { 35 | file.ReplaceSubfile(-1, this, null); 36 | } 37 | 38 | public void LoadFrom(Stream stream) 39 | { 40 | BinaryReader reader = new BinaryReader(stream); 41 | m_GameObject = new PPtr(stream, file); 42 | m_Material = new PPtr(stream, file); 43 | m_IsTrigger = reader.ReadBoolean(); 44 | m_Enabled = reader.ReadBoolean(); 45 | stream.Position += 2; 46 | m_Size = reader.ReadVector3(); 47 | m_Center = reader.ReadVector3(); 48 | } 49 | 50 | public void WriteTo(Stream stream) 51 | { 52 | BinaryWriter writer = new BinaryWriter(stream); 53 | m_GameObject.WriteTo(stream); 54 | m_Material.WriteTo(stream); 55 | writer.Write(m_IsTrigger); 56 | writer.Write(m_Enabled); 57 | stream.Position += 2; 58 | writer.Write(m_Size); 59 | writer.Write(m_Center); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/SphereCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using SlimDX; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class SphereCollider : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public PPtr m_Material { get; set; } 19 | public bool m_IsTrigger { get; set; } 20 | public bool m_Enabled { get; set; } 21 | public float m_Radius { get; set; } 22 | public Vector3 m_Center { get; set; } 23 | 24 | public SphereCollider(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 25 | { 26 | this.file = file; 27 | this.pathID = pathID; 28 | this.classID1 = classID1; 29 | this.classID2 = classID2; 30 | } 31 | 32 | public SphereCollider(AssetCabinet file) : 33 | this(file, 0, UnityClassID.SphereCollider, UnityClassID.SphereCollider) 34 | { 35 | file.ReplaceSubfile(-1, this, null); 36 | } 37 | 38 | public void LoadFrom(Stream stream) 39 | { 40 | BinaryReader reader = new BinaryReader(stream); 41 | m_GameObject = new PPtr(stream, file); 42 | m_Material = new PPtr(stream, file); 43 | m_IsTrigger = reader.ReadBoolean(); 44 | m_Enabled = reader.ReadBoolean(); 45 | stream.Position += 2; 46 | m_Radius = reader.ReadSingle(); 47 | m_Center = reader.ReadVector3(); 48 | } 49 | 50 | public void WriteTo(Stream stream) 51 | { 52 | BinaryWriter writer = new BinaryWriter(stream); 53 | m_GameObject.WriteTo(stream); 54 | m_Material.WriteTo(stream); 55 | writer.Write(m_IsTrigger); 56 | writer.Write(m_Enabled); 57 | stream.Position += 2; 58 | writer.Write(m_Radius); 59 | writer.Write(m_Center); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /SB3UtilityGUI/ApplicationException.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SB3Utility 2 | { 3 | partial class ApplicationException 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.textBoxErrorText = new System.Windows.Forms.TextBox(); 32 | this.SuspendLayout(); 33 | // 34 | // textBoxErrorText 35 | // 36 | this.textBoxErrorText.Dock = System.Windows.Forms.DockStyle.Fill; 37 | this.textBoxErrorText.Location = new System.Drawing.Point(0, 0); 38 | this.textBoxErrorText.Multiline = true; 39 | this.textBoxErrorText.Name = "textBoxErrorText"; 40 | this.textBoxErrorText.Size = new System.Drawing.Size(449, 196); 41 | this.textBoxErrorText.TabIndex = 0; 42 | // 43 | // SB3UtilityGUIPlusScript_cant_Start 44 | // 45 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 46 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 47 | this.ClientSize = new System.Drawing.Size(449, 196); 48 | this.Controls.Add(this.textBoxErrorText); 49 | this.Name = "SB3UtilityGUIPlusScript_cant_Start"; 50 | this.Text = "SB3UtilityGUIPlusScript_cant_Start"; 51 | this.ResumeLayout(false); 52 | this.PerformLayout(); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private System.Windows.Forms.TextBox textBoxErrorText; 59 | } 60 | } -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/MeshCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class MeshCollider : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public PPtr m_Material { get; set; } 19 | public bool m_IsTrigger { get; set; } 20 | public bool m_Enabled { get; set; } 21 | public bool m_SmoothSphereCollisions { get; set; } 22 | public bool m_Convex { get; set; } 23 | public PPtr m_Mesh { get; set; } 24 | 25 | public MeshCollider(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 26 | { 27 | this.file = file; 28 | this.pathID = pathID; 29 | this.classID1 = classID1; 30 | this.classID2 = classID2; 31 | } 32 | 33 | public MeshCollider(AssetCabinet file) : 34 | this(file, 0, UnityClassID.MeshCollider, UnityClassID.MeshCollider) 35 | { 36 | file.ReplaceSubfile(-1, this, null); 37 | } 38 | 39 | public void LoadFrom(Stream stream) 40 | { 41 | BinaryReader reader = new BinaryReader(stream); 42 | m_GameObject = new PPtr(stream, file); 43 | m_Material = new PPtr(stream, file); 44 | m_IsTrigger = reader.ReadBoolean(); 45 | m_Enabled = reader.ReadBoolean(); 46 | m_SmoothSphereCollisions = reader.ReadBoolean(); 47 | m_Convex = reader.ReadBoolean(); 48 | m_Mesh = new PPtr(stream, file); 49 | } 50 | 51 | public void WriteTo(Stream stream) 52 | { 53 | BinaryWriter writer = new BinaryWriter(stream); 54 | m_GameObject.WriteTo(stream); 55 | m_Material.WriteTo(stream); 56 | writer.Write(m_IsTrigger); 57 | writer.Write(m_Enabled); 58 | writer.Write(m_SmoothSphereCollisions); 59 | writer.Write(m_Convex); 60 | m_Mesh.WriteTo(stream); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityNIF/SB3UtilityNIF.h: -------------------------------------------------------------------------------- 1 | // SB3UtilityNIF.h 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | using namespace msclr::interop; 8 | 9 | #include "niflib.h" 10 | #include "obj/NiNode.h" 11 | #include "obj/NiTriShape.h" 12 | #include "obj/NiTriShapeData.h" 13 | #include "obj/NiSkinInstance.h" 14 | #include "obj/NiSkinData.h" 15 | #include "obj/NiProperty.h" 16 | #include "obj/BSLightingShaderProperty.h" 17 | #include "obj/BSShaderTextureSet.h" 18 | #include "obj/BSEffectShaderProperty.h" 19 | #include "obj/NiExtraData.h" 20 | #include "nif_math.h" 21 | 22 | using namespace Niflib; 23 | 24 | namespace Niflib { 25 | 26 | class BSEffectShaderPropertyExtended; 27 | typedef Ref BSEffectShaderPropertyExtendedRef; 28 | 29 | public class BSEffectShaderPropertyExtended : public BSEffectShaderProperty { 30 | public: 31 | inline const Color4 & GetEmissiveColor() const { return emissiveColor; } 32 | inline const string GetSourceTexture() const { return sourceTexture; } 33 | inline const string GetGreyscaleTexture() const { return greyscaleTexture; } 34 | }; 35 | } 36 | 37 | using namespace System; 38 | using namespace System::Collections::Generic; 39 | using namespace System::IO; 40 | using namespace System::Runtime::InteropServices; 41 | 42 | using namespace SlimDX; 43 | 44 | namespace SB3Utility { 45 | 46 | public ref class Nif 47 | { 48 | public: 49 | ref class Importer : IImported 50 | { 51 | public: 52 | virtual property List^ FrameList; 53 | virtual property List^ MeshList; 54 | virtual property List^ MaterialList; 55 | virtual property List^ TextureList; 56 | virtual property List^ AnimationList; 57 | virtual property List^ MorphList; 58 | 59 | Importer(String^ path); 60 | 61 | private: 62 | String^ importPath; 63 | 64 | void CreateHierarchy(NiNodeRef node, ImportedFrame^ parent); 65 | ImportedTexture^ AddTexture(string texPath); 66 | 67 | static Matrix correction; 68 | static bool greater_second(const pair& a, const pair& b); 69 | }; 70 | }; 71 | } -------------------------------------------------------------------------------- /AiDroidPlugin/FPK/fpk.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace AiDroidPlugin 8 | { 9 | public static partial class Plugins 10 | { 11 | /// 12 | /// Parses a .fpk archive file from the specified path. 13 | /// 14 | /// [DefaultVar] Path of the file. 15 | /// A fpkParser that represents the .fpk archive. 16 | [Plugin] 17 | public static fpkParser OpenFPK([DefaultVar]string path) 18 | { 19 | fpkDirFormat format = fpkDirFormat.GetFormat(path); 20 | if (format == null) 21 | { 22 | throw new Exception("Couldn't auto-detect the format of " + path); 23 | } 24 | return new fpkParser(path, format); 25 | } 26 | 27 | /// 28 | /// Extracts a subfile with the specified name and writes it to the specified path. 29 | /// 30 | /// [DefaultVar] The fpkParser with the subfile. 31 | /// The name of the subfile. 32 | /// The destination path to write the subfile. 33 | [Plugin] 34 | public static void ExportSubfile([DefaultVar]fpkParser parser, string name, string path) 35 | { 36 | for (int i = 0; i < parser.Subfiles.Count; i++) 37 | { 38 | if (parser.Subfiles[i].Name == name) 39 | { 40 | FileInfo file = new FileInfo(path); 41 | DirectoryInfo dir = file.Directory; 42 | if (!dir.Exists) 43 | { 44 | dir.Create(); 45 | } 46 | 47 | using (FileStream fs = file.Create()) 48 | { 49 | parser.Subfiles[i].WriteTo(fs); 50 | } 51 | break; 52 | } 53 | } 54 | } 55 | 56 | [Plugin] 57 | public static void ExportFPK([DefaultVar]fpkParser parser, string path) 58 | { 59 | DirectoryInfo dir = new DirectoryInfo(path); 60 | if (!dir.Exists) 61 | { 62 | dir.Create(); 63 | } 64 | 65 | for (int i = 0; i < parser.Subfiles.Count; i++) 66 | { 67 | var subfile = parser.Subfiles[i]; 68 | using (FileStream fs = File.Create(dir.FullName + @"\" + subfile.Name)) 69 | { 70 | subfile.WriteTo(fs); 71 | } 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/CapsuleCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using SlimDX; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class CapsuleCollider : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public PPtr m_Material { get; set; } 19 | public bool m_IsTrigger { get; set; } 20 | public bool m_Enabled { get; set; } 21 | public float m_Radius { get; set; } 22 | public float m_Height { get; set; } 23 | public int m_Direction { get; set; } 24 | public Vector3 m_Center { get; set; } 25 | 26 | public CapsuleCollider(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 27 | { 28 | this.file = file; 29 | this.pathID = pathID; 30 | this.classID1 = classID1; 31 | this.classID2 = classID2; 32 | } 33 | 34 | public CapsuleCollider(AssetCabinet file) : 35 | this(file, 0, UnityClassID.CapsuleCollider, UnityClassID.CapsuleCollider) 36 | { 37 | file.ReplaceSubfile(-1, this, null); 38 | } 39 | 40 | public void LoadFrom(Stream stream) 41 | { 42 | BinaryReader reader = new BinaryReader(stream); 43 | m_GameObject = new PPtr(stream, file); 44 | m_Material = new PPtr(stream, file); 45 | m_IsTrigger = reader.ReadBoolean(); 46 | m_Enabled = reader.ReadBoolean(); 47 | stream.Position += 2; 48 | m_Radius = reader.ReadSingle(); 49 | m_Height = reader.ReadSingle(); 50 | m_Direction = reader.ReadInt32(); 51 | m_Center = reader.ReadVector3(); 52 | } 53 | 54 | public void WriteTo(Stream stream) 55 | { 56 | BinaryWriter writer = new BinaryWriter(stream); 57 | m_GameObject.WriteTo(stream); 58 | m_Material.WriteTo(stream); 59 | writer.Write(m_IsTrigger); 60 | writer.Write(m_Enabled); 61 | stream.Position += 2; 62 | writer.Write(m_Radius); 63 | writer.Write(m_Height); 64 | writer.Write(m_Direction); 65 | writer.Write(m_Center); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/ppSwapfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace SB3Utility 6 | { 7 | public class ppSwapfile : IReadFile, IWriteFile, IDisposable 8 | { 9 | static string tmpFolder = (Environment.GetEnvironmentVariable("TMP") != null ? Environment.GetEnvironmentVariable("TMP") + @"\" : "") + @"SB3Utility(G+S)_swap"; 10 | 11 | string swapFilePath; 12 | 13 | public ppSwapfile(string ppPath, IWriteFile source) 14 | { 15 | this.Name = source.Name; 16 | this.swapFilePath = tmpFolder + @"\" + ppPath.Replace('\\', '#').Replace(':', '~') + "#" + source.Name; 17 | 18 | if (!Directory.Exists(tmpFolder)) 19 | { 20 | Directory.CreateDirectory(tmpFolder); 21 | } 22 | else 23 | { 24 | string rnd = string.Empty; 25 | Random rand = new Random(); 26 | while (File.Exists(swapFilePath + rnd)) 27 | { 28 | rnd = "-" + rand.Next(); 29 | } 30 | swapFilePath += rnd; 31 | } 32 | using (FileStream stream = File.OpenWrite(swapFilePath)) 33 | { 34 | source.WriteTo(stream); 35 | } 36 | } 37 | 38 | public void Dispose() 39 | { 40 | this.Dispose(true); 41 | GC.SuppressFinalize(this); 42 | } 43 | 44 | protected void Dispose(bool disposing) 45 | { 46 | if (disposing) 47 | { 48 | File.Delete(swapFilePath); 49 | } 50 | } 51 | 52 | ~ppSwapfile() 53 | { 54 | try 55 | { 56 | File.Delete(swapFilePath); 57 | } 58 | catch (Exception ex) 59 | { 60 | using (BinaryWriter writer = new BinaryWriter(File.OpenWrite(swapFilePath + "-exc.txt"))) 61 | { 62 | writer.Seek(0, SeekOrigin.End); 63 | writer.Write(System.DateTime.Now + " " + ex); 64 | } 65 | } 66 | } 67 | 68 | public string Name { get; set; } 69 | 70 | public Stream CreateReadStream() 71 | { 72 | return File.OpenRead(swapFilePath); 73 | } 74 | 75 | public void WriteTo(Stream stream) 76 | { 77 | using (BinaryReader reader = new BinaryReader(CreateReadStream())) 78 | { 79 | BinaryWriter writer = new BinaryWriter(stream); 80 | for (byte[] buffer; (buffer = reader.ReadBytes(Utility.BufSize)).Length > 0; ) 81 | { 82 | writer.Write(buffer); 83 | } 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/ParticleRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class UVAnimation : IObjInfo 11 | { 12 | int x_Tile { get; set; } 13 | int y_Tile { get; set; } 14 | float cycles { get; set; } 15 | 16 | public UVAnimation(Stream stream) 17 | { 18 | LoadFrom(stream); 19 | } 20 | 21 | public void LoadFrom(Stream stream) 22 | { 23 | BinaryReader reader = new BinaryReader(stream); 24 | x_Tile = reader.ReadInt32(); 25 | y_Tile = reader.ReadInt32(); 26 | cycles = reader.ReadSingle(); 27 | } 28 | 29 | public void WriteTo(Stream stream) 30 | { 31 | BinaryWriter writer = new BinaryWriter(stream); 32 | writer.Write(x_Tile); 33 | writer.Write(y_Tile); 34 | writer.Write(cycles); 35 | } 36 | } 37 | 38 | public class ParticleRenderer : MeshRenderer, Component 39 | { 40 | public float m_CameraVelocityScale { get; set; } 41 | public int m_StretchParticles { get; set; } 42 | public float m_LengthScale { get; set; } 43 | public float m_VelocityScale { get; set; } 44 | public float m_MaxParticleSize { get; set; } 45 | public UVAnimation UV_Animation { get; set; } 46 | 47 | public ParticleRenderer(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 48 | : base(file, pathID, classID1, classID2) { } 49 | 50 | public new void LoadFrom(Stream stream) 51 | { 52 | base.LoadFrom(stream); 53 | 54 | BinaryReader reader = new BinaryReader(stream); 55 | m_CameraVelocityScale = reader.ReadSingle(); 56 | m_StretchParticles = reader.ReadInt32(); 57 | m_LengthScale = reader.ReadSingle(); 58 | m_VelocityScale = reader.ReadSingle(); 59 | m_MaxParticleSize = reader.ReadSingle(); 60 | UV_Animation = new UVAnimation(stream); 61 | } 62 | 63 | public new void WriteTo(Stream stream) 64 | { 65 | base.WriteTo(stream); 66 | 67 | BinaryWriter writer = new BinaryWriter(stream); 68 | writer.Write(m_CameraVelocityScale); 69 | writer.Write(m_StretchParticles); 70 | writer.Write(m_LengthScale); 71 | writer.Write(m_VelocityScale); 72 | writer.Write(m_MaxParticleSize); 73 | UV_Animation.WriteTo(stream); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/RigidBody.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class RigidBody : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public float m_Mass { get; set; } 19 | public float m_Drag { get; set; } 20 | public float m_AngularDrag { get; set; } 21 | public bool m_UseGravity { get; set; } 22 | public bool m_IsKinematic { get; set; } 23 | public byte m_Interpolate { get; set; } 24 | public int m_Constraints { get; set; } 25 | public int m_CollisionDetection { get; set; } 26 | 27 | public RigidBody(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 28 | { 29 | this.file = file; 30 | this.pathID = pathID; 31 | this.classID1 = classID1; 32 | this.classID2 = classID2; 33 | } 34 | 35 | public RigidBody(AssetCabinet file) : 36 | this(file, 0, UnityClassID.Rigidbody, UnityClassID.Rigidbody) 37 | { 38 | file.ReplaceSubfile(-1, this, null); 39 | } 40 | 41 | public void LoadFrom(Stream stream) 42 | { 43 | BinaryReader reader = new BinaryReader(stream); 44 | m_GameObject = new PPtr(stream, file); 45 | m_Mass = reader.ReadSingle(); 46 | m_Drag = reader.ReadSingle(); 47 | m_AngularDrag = reader.ReadSingle(); 48 | m_UseGravity = reader.ReadBoolean(); 49 | m_IsKinematic = reader.ReadBoolean(); 50 | m_Interpolate = reader.ReadByte(); 51 | stream.Position += 1; 52 | m_Constraints = reader.ReadInt32(); 53 | m_CollisionDetection = reader.ReadInt32(); 54 | } 55 | 56 | public void WriteTo(Stream stream) 57 | { 58 | BinaryWriter writer = new BinaryWriter(stream); 59 | m_GameObject.WriteTo(stream); 60 | writer.Write(m_Mass); 61 | writer.Write(m_Drag); 62 | writer.Write(m_AngularDrag); 63 | writer.Write(m_UseGravity); 64 | writer.Write(m_IsKinematic); 65 | writer.Write(m_Interpolate); 66 | stream.Position += 1; 67 | writer.Write(m_Constraints); 68 | writer.Write(m_CollisionDetection); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/ParticleSystemRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace UnityPlugin 8 | { 9 | public class ParticleSystemRenderer : MeshRenderer, Component, LinkedByGameObject, StoresReferences 10 | { 11 | public int m_RenderMode { get; set; } 12 | public float m_MaxParticleSize { get; set; } 13 | public float m_CameraVelocityScale { get; set; } 14 | public float m_VelocityScale { get; set; } 15 | public float m_LengthScale { get; set; } 16 | public float m_SortingFudge { get; set; } 17 | public float m_NormalDirection { get; set; } 18 | public int m_SortMode { get; set; } 19 | public PPtr m_Mesh { get; set; } 20 | public PPtr m_Mesh1 { get; set; } 21 | public PPtr m_Mesh2 { get; set; } 22 | public PPtr m_Mesh3 { get; set; } 23 | 24 | public ParticleSystemRenderer(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 25 | : base(file, pathID, classID1, classID2) { } 26 | 27 | public new void LoadFrom(Stream stream) 28 | { 29 | base.LoadFrom(stream); 30 | 31 | BinaryReader reader = new BinaryReader(stream); 32 | m_RenderMode = reader.ReadInt32(); 33 | m_MaxParticleSize = reader.ReadSingle(); 34 | m_CameraVelocityScale = reader.ReadSingle(); 35 | m_VelocityScale = reader.ReadSingle(); 36 | m_LengthScale = reader.ReadSingle(); 37 | m_SortingFudge = reader.ReadSingle(); 38 | m_NormalDirection = reader.ReadSingle(); 39 | m_SortMode = reader.ReadInt32(); 40 | m_Mesh = new PPtr(stream, file); 41 | m_Mesh1 = new PPtr(stream, file); 42 | m_Mesh2 = new PPtr(stream, file); 43 | m_Mesh3 = new PPtr(stream, file); 44 | } 45 | 46 | public new void WriteTo(Stream stream) 47 | { 48 | base.WriteTo(stream); 49 | 50 | BinaryWriter writer = new BinaryWriter(stream); 51 | writer.Write(m_RenderMode); 52 | writer.Write(m_MaxParticleSize); 53 | writer.Write(m_CameraVelocityScale); 54 | writer.Write(m_VelocityScale); 55 | writer.Write(m_LengthScale); 56 | writer.Write(m_SortingFudge); 57 | writer.Write(m_NormalDirection); 58 | writer.Write(m_SortMode); 59 | m_Mesh.WriteTo(stream); 60 | m_Mesh1.WriteTo(stream); 61 | m_Mesh2.WriteTo(stream); 62 | m_Mesh3.WriteTo(stream); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /AiDroidPlugin/AiDroidPlugin.ChangeLog.txt: -------------------------------------------------------------------------------- 1 | [0.5.6] 2 | - Changed computing common normals for all selected REM meshes 3 | 4 | [0.5.4] 5 | - Fix in the gui and improved Object Tree handling 6 | 7 | [0.5.2] 8 | - Added editable backup extension of REM files 9 | - Fixed material selection crash for missing materials 10 | - Used materials are copied along with mesh frames from other REMs (via Workspace) 11 | 12 | [0.5.1] 13 | - fixed invalid material when merging imported materials 14 | - fixed crash when a texture wasn't found in TEXH folder 15 | - textures are also taken from the current folder 16 | 17 | [0.4.42.39] 18 | - imported meshes can be easier placed into destination frames 19 | - Fixed that invalid bones crashed the renderer 20 | - Fixed importing materials didn't update textures 21 | 22 | [0.4.42.36] 23 | - Fixed REA event handlers were dropped - GUI was responsive 24 | - Fixed REA double initialization 25 | 26 | [0.4.42.34] 27 | - Fixed writing REA units. It was incomplete. 28 | - Added editing unknowns of REA units. 29 | - Added REA menustrip for saving, reopening, etc of REA files not included in FPK files. 30 | - Added clicking animation tracks highlights the corresponding bone. 31 | 32 | [0.4.42.32] 33 | - Changed display of used bones to use the bone frame parents as root 34 | - Added display of animations 35 | - Change: textures are cached and are never released 36 | - Added Fbx animation export/import 37 | 38 | [0.4.42.31] 39 | - Added Fbx import/export (also DAE, DXF, 3DS, OBJ) 40 | - Added bone matrix calculation for Rest Pose 41 | - Fixed taking wrong materials when replacing meshes 42 | - Fixed crash when displaying meshes with missing bones or textures 43 | - Fixed workspace functions for Frames : Move, Remove, Add, Replace, Merge 44 | - Fixed common Fbx exports putting meshes into wrong frames (common means ODF and REM) 45 | - Fixed Mqo exports with local coordinates 46 | 47 | [0.4.42.30] 48 | - Added hint when textures are not found to export TEXH.fpk 49 | - Fixed crash when textures were not found 50 | 51 | [0.4.42.24] 52 | - added "Unique Bone" option : a change of the bone's matrix is applied to all meshes 53 | 54 | [0.4.42.23] 55 | - Fix: renaming mesh frames orphaned meshes. (mesh.frame and mesh.name exchanged additionally) 56 | - Fix: bone matrix math to render meshes corrected 57 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/ToolOutputEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace SB3Utility 6 | { 7 | [Plugin] 8 | public class ToolOutputEditor : EditedContent 9 | { 10 | public ToolOutputParser Parser { get; protected set; } 11 | public string Text { get; protected set; } 12 | 13 | string extension; 14 | int ppFormatIndex; 15 | 16 | protected bool contentChanged; 17 | 18 | public ToolOutputEditor(ToolOutputParser parser, int ppFormatIndex) 19 | { 20 | Parser = parser; 21 | this.ppFormatIndex = ppFormatIndex; 22 | extension = Path.GetExtension(parser.Name); 23 | Text = GetData(); 24 | } 25 | 26 | public bool Changed 27 | { 28 | get { return contentChanged; } 29 | set { contentChanged = value; } 30 | } 31 | 32 | public static ExternalTool SelectTool(string extension, int ppFormatIndex, bool forDecoding) 33 | { 34 | ExternalTool result = null; 35 | List toolList; 36 | if (!ppEditor.ExternalTools.TryGetValue(extension.ToUpper(), out toolList)) 37 | { 38 | throw new Exception("No tools registered for " + extension.ToUpper()); 39 | } 40 | foreach (ExternalTool tool in toolList) 41 | { 42 | if ((tool.ppFormatIndex == -1 || tool.ppFormatIndex == ppFormatIndex) && 43 | (forDecoding && tool.ToTextOptions != null && tool.ToTextOptions.Length > 0 || 44 | !forDecoding && tool.ToBinaryOptions != null && tool.ToBinaryOptions.Length > 0)) 45 | { 46 | result = tool; 47 | break; 48 | } 49 | } 50 | return result; 51 | } 52 | 53 | [Plugin] 54 | public string GetData() 55 | { 56 | ExternalTool decoder = SelectTool(extension, ppFormatIndex, true); 57 | if (decoder == null) 58 | { 59 | throw new Exception("No tool registered for " + extension + " supports decoding of ppFormat " + ppFormat.Array[ppFormatIndex]); 60 | } 61 | return decoder.ConvertToText(Parser.contents); 62 | } 63 | 64 | [Plugin] 65 | public void SetData(string text) 66 | { 67 | ExternalTool encoder = SelectTool(extension, ppFormatIndex, false); 68 | if (encoder == null) 69 | { 70 | throw new Exception("No tool registered for " + extension + " supports encoding of ppFormat " + ppFormat.Array[ppFormatIndex]); 71 | } 72 | Parser.contents = encoder.ConvertToBinary(text); 73 | Text = text; 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormXADragDrop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace SB3Utility 10 | { 11 | public partial class FormXADragDrop : Form 12 | { 13 | public ReplaceAnimationMethod ReplaceMethod { get; protected set; } 14 | 15 | private xaEditor editor; 16 | 17 | private SizeF startSize; 18 | 19 | public FormXADragDrop(xaEditor destEditor, bool morphOrAnimation) 20 | { 21 | InitializeComponent(); 22 | startSize = new SizeF(Width, Height); 23 | this.SaveDesignSizes(); 24 | editor = destEditor; 25 | 26 | if (morphOrAnimation) 27 | panelMorphList.BringToFront(); 28 | else 29 | { 30 | panelAnimation.BringToFront(); 31 | comboBoxMethod.Items.AddRange(Enum.GetNames(typeof(ReplaceAnimationMethod))); 32 | } 33 | } 34 | 35 | private void comboBoxMethod_SelectedIndexChanged(object sender, EventArgs e) 36 | { 37 | if (comboBoxMethod.SelectedIndex == (int)ReplaceAnimationMethod.Append) 38 | { 39 | if (numericPosition.Value == 0) 40 | { 41 | numericPosition.Value = 10; 42 | } 43 | } 44 | else 45 | { 46 | if (numericPosition.Value == 10) 47 | { 48 | numericPosition.Value = 0; 49 | } 50 | } 51 | } 52 | 53 | private void FormXADragDrop_Shown(object sender, EventArgs e) 54 | { 55 | Size dialogSize = (Size)Gui.Config["DialogXADragDropSize"]; 56 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 57 | { 58 | Width = dialogSize.Width; 59 | Height = dialogSize.Height; 60 | this.ResizeControls(startSize); 61 | } 62 | else 63 | { 64 | Width = (int)startSize.Width; 65 | Height = (int)startSize.Height; 66 | this.ResetControls(); 67 | } 68 | } 69 | 70 | private void FormXADragDrop_Resize(object sender, EventArgs e) 71 | { 72 | this.ResizeControls(startSize); 73 | } 74 | 75 | private void FormXADragDrop_VisibleChanged(object sender, EventArgs e) 76 | { 77 | if (!Visible) 78 | { 79 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 80 | { 81 | Gui.Config["DialogXADragDropSize"] = new Size(0, 0); 82 | } 83 | else 84 | { 85 | Gui.Config["DialogXADragDropSize"] = this.Size; 86 | } 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/Cubemap.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class Cubemap : Texture2D, Component, StoresReferences 11 | { 12 | public List> m_SourceTextures { get; set; } 13 | 14 | public Cubemap(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 15 | : base(file, pathID, classID1, classID2) { } 16 | 17 | public Cubemap(AssetCabinet file) : base(file) 18 | { 19 | classID1 = classID2 = UnityClassID.Cubemap; 20 | m_SourceTextures = new List>(); 21 | } 22 | 23 | public new void LoadFrom(Stream stream) 24 | { 25 | base.LoadFrom(stream); 26 | 27 | BinaryReader reader = new BinaryReader(stream); 28 | int numTextures = reader.ReadInt32(); 29 | m_SourceTextures = new List>(numTextures); 30 | for (int i = 0; i < numTextures; i++) 31 | { 32 | m_SourceTextures.Add(new PPtr(stream)); 33 | } 34 | } 35 | 36 | public new void WriteTo(Stream stream) 37 | { 38 | base.WriteTo(stream); 39 | 40 | BinaryWriter writer = new BinaryWriter(stream); 41 | writer.Write(m_SourceTextures.Count); 42 | for (int i = 0; i < m_SourceTextures.Count; i++) 43 | { 44 | m_SourceTextures[i].WriteTo(stream); 45 | } 46 | } 47 | 48 | public new Cubemap Clone(AssetCabinet file) 49 | { 50 | Component cubemap = file.Bundle.FindComponent(m_Name, UnityClassID.Cubemap); 51 | if (cubemap == null) 52 | { 53 | file.MergeTypeDefinition(this.file, UnityClassID.Cubemap); 54 | 55 | Cubemap clone = new Cubemap(file); 56 | file.Bundle.AddComponent(m_Name, clone); 57 | CopyAttributesTo(clone); 58 | CopyImageTo(clone); 59 | foreach (PPtr texPtr in m_SourceTextures) 60 | { 61 | if (texPtr.asset != null) 62 | { 63 | clone.m_SourceTextures.Add(new PPtr(texPtr.instance.Clone(file))); 64 | } 65 | } 66 | return clone; 67 | } 68 | else if (cubemap is NotLoaded) 69 | { 70 | NotLoaded notLoaded = (NotLoaded)cubemap; 71 | if (notLoaded.replacement != null) 72 | { 73 | cubemap = notLoaded.replacement; 74 | } 75 | else 76 | { 77 | cubemap = file.LoadComponent(file.SourceStream, notLoaded); 78 | } 79 | } 80 | return (Cubemap)cubemap; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /SB3UtilityGUI/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.IO; 4 | 5 | namespace SB3Utility.Properties { 6 | 7 | 8 | // This class allows you to handle specific events on the settings class: 9 | // The SettingChanging event is raised before a setting's value is changed. 10 | // The PropertyChanged event is raised after a setting's value is changed. 11 | // The SettingsLoaded event is raised after the setting values are loaded. 12 | // The SettingsSaving event is raised before the setting values are saved. 13 | internal sealed partial class Settings { 14 | 15 | public const int MaxExternalTools = 30; 16 | 17 | public Settings() { 18 | // // To add event handlers for saving and changing settings, uncomment the lines below: 19 | // 20 | // this.SettingChanging += this.SettingChangingEventHandler; 21 | // 22 | // this.SettingsSaving += this.SettingsSavingEventHandler; 23 | // 24 | 25 | for (int i = 0; i < MaxExternalTools; i++) 26 | { 27 | SettingsProperty newProp = new SettingsProperty( 28 | "ExternalTool" + i, typeof(ExternalTool), 29 | this.Providers[Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location)], 30 | false, 31 | null, 32 | SettingsSerializeAs.String, 33 | null, 34 | true, true 35 | ); 36 | this.Properties.Add(newProp); 37 | } 38 | 39 | this.SettingsLoaded += new System.Configuration.SettingsLoadedEventHandler(Settings_SettingsLoaded); 40 | } 41 | 42 | void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e) 43 | { 44 | for (int i = 0; i < MaxExternalTools; i++) 45 | { 46 | string toolName = "ExternalTool" + i; 47 | if (this.PropertyValues[toolName].PropertyValue == null) 48 | { 49 | this.PropertyValues.Remove(toolName); 50 | this.Properties.Remove(toolName); 51 | } 52 | } 53 | } 54 | 55 | private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { 56 | // Add code to handle the SettingChangingEvent event here. 57 | } 58 | 59 | private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { 60 | // Add code to handle the SettingsSaving event here. 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/HighlightDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | 4 | namespace UrielGuy.SyntaxHighlightingTextBox 5 | { 6 | public class HighlightDescriptor 7 | { 8 | public HighlightDescriptor(string token, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete) 9 | { 10 | if (descriptorType == UrielGuy.SyntaxHighlightingTextBox.DescriptorType.ToCloseToken) 11 | { 12 | throw new ArgumentException("You may not choose ToCloseToken DescriptorType without specifing an end token."); 13 | } 14 | Color = color; 15 | Font = font; 16 | Token = token; 17 | DescriptorType = descriptorType; 18 | DescriptorRecognition = dr; 19 | CloseToken = null; 20 | UseForAutoComplete = useForAutoComplete; 21 | } 22 | public HighlightDescriptor(string token, string closeToken, Color color, Font font, DescriptorType descriptorType, DescriptorRecognition dr, bool useForAutoComplete) 23 | { 24 | Color = color; 25 | Font = font; 26 | Token = token; 27 | DescriptorType = descriptorType; 28 | CloseToken = closeToken; 29 | DescriptorRecognition = dr; 30 | UseForAutoComplete = useForAutoComplete; 31 | } 32 | public readonly Color Color; 33 | public readonly Font Font; 34 | public readonly string Token; 35 | public readonly string CloseToken; 36 | public readonly DescriptorType DescriptorType; 37 | public readonly DescriptorRecognition DescriptorRecognition; 38 | public readonly bool UseForAutoComplete; 39 | } 40 | 41 | 42 | public enum DescriptorType 43 | { 44 | /// 45 | /// Causes the highlighting of a single word 46 | /// 47 | Word, 48 | /// 49 | /// Causes the entire line from this point on the be highlighted, regardless of other tokens 50 | /// 51 | ToEOL, 52 | /// 53 | /// Highlights all text until the end token; 54 | /// 55 | ToCloseToken, 56 | /// 57 | /// invisible single chars 58 | /// 59 | Control 60 | } 61 | 62 | public enum DescriptorRecognition 63 | { 64 | /// 65 | /// Only if the whole token is equal to the word 66 | /// 67 | WholeWord, 68 | /// 69 | /// If the word starts with the token 70 | /// 71 | StartsWith, 72 | /// 73 | /// If the word contains the Token 74 | /// 75 | Contains 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPSubfileChange.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using WeifenLuo.WinFormsUI.Docking; 10 | 11 | namespace SB3Utility 12 | { 13 | public partial class FormPPSubfileChange : Form 14 | { 15 | private SizeF startSize; 16 | 17 | public FormPPSubfileChange(string title, string[] editors, Dictionary ppChildForms) 18 | { 19 | InitializeComponent(); 20 | Text = title.Replace("&", String.Empty); 21 | 22 | startSize = new SizeF(Width, Height); 23 | this.SaveDesignSizes(); 24 | 25 | float listViewFontSize = (float)Gui.Config["ListViewFontSize"]; 26 | if (listViewFontSize > 0) 27 | { 28 | listViewEditors.Font = new System.Drawing.Font(listViewEditors.Font.FontFamily, listViewFontSize); 29 | } 30 | listViewEditors.AutoResizeColumns(); 31 | foreach (string editorName in editors) 32 | { 33 | string name = editorName; 34 | DockContent content; 35 | if (ppChildForms.TryGetValue(editorName, out content)) 36 | { 37 | EditedContent editor = content as EditedContent; 38 | if (editor != null && editor.Changed) 39 | { 40 | name += "*"; 41 | } 42 | } 43 | listViewEditors.Items.Add(name); 44 | } 45 | } 46 | 47 | private void FormPPSubfileChange_Shown(object sender, EventArgs e) 48 | { 49 | Size dialogSize = (Size)Gui.Config["DialogPPSubfileChangeSize"]; 50 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 51 | { 52 | Width = dialogSize.Width; 53 | Height = dialogSize.Height; 54 | this.ResizeControls(startSize); 55 | } 56 | else 57 | { 58 | Width = (int)startSize.Width; 59 | Height = (int)startSize.Height; 60 | this.ResetControls(); 61 | } 62 | } 63 | 64 | private void FormPPSubfileChange_Resize(object sender, EventArgs e) 65 | { 66 | this.ResizeControls(startSize); 67 | } 68 | 69 | private void FormPPSubfileChange_VisibleChanged(object sender, EventArgs e) 70 | { 71 | if (!Visible) 72 | { 73 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 74 | { 75 | Gui.Config["DialogPPSubfileChangeSize"] = new Size(0, 0); 76 | } 77 | else 78 | { 79 | Gui.Config["DialogPPSubfileChangeSize"] = this.Size; 80 | } 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/Projector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class Projector : Component, LinkedByGameObject, StoresReferences 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public PPtr m_GameObject { get; set; } 18 | public byte m_Enabled { get; set; } 19 | public float m_NearClipPlane { get; set; } 20 | public float m_FarClipPlane { get; set; } 21 | public float m_FieldOfView { get; set; } 22 | public float m_AspectRatio { get; set; } 23 | public bool m_Orthographic { get; set; } 24 | public float m_OrthographicSize { get; set; } 25 | public PPtr m_Material { get; set; } 26 | public BitField m_IgnoreLayers { get; set; } 27 | 28 | public Projector(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 29 | { 30 | this.file = file; 31 | this.pathID = pathID; 32 | this.classID1 = classID1; 33 | this.classID2 = classID2; 34 | } 35 | 36 | public Projector(AssetCabinet file) : 37 | this(file, 0, UnityClassID.Projector, UnityClassID.Projector) 38 | { 39 | file.ReplaceSubfile(-1, this, null); 40 | } 41 | 42 | public void LoadFrom(Stream stream) 43 | { 44 | BinaryReader reader = new BinaryReader(stream); 45 | m_GameObject = new PPtr(stream, file); 46 | m_Enabled = reader.ReadByte(); 47 | stream.Position += 3; 48 | m_NearClipPlane = reader.ReadSingle(); 49 | m_FarClipPlane = reader.ReadSingle(); 50 | m_FieldOfView = reader.ReadSingle(); 51 | m_AspectRatio = reader.ReadSingle(); 52 | m_Orthographic = reader.ReadBoolean(); 53 | stream.Position += 3; 54 | m_OrthographicSize = reader.ReadSingle(); 55 | m_Material = new PPtr(stream, file); 56 | m_IgnoreLayers = new BitField(stream); 57 | } 58 | 59 | public void WriteTo(Stream stream) 60 | { 61 | BinaryWriter writer = new BinaryWriter(stream); 62 | m_GameObject.WriteTo(stream); 63 | writer.Write(m_Enabled); 64 | stream.Position += 3; 65 | writer.Write(m_NearClipPlane); 66 | writer.Write(m_FarClipPlane); 67 | writer.Write(m_FieldOfView); 68 | writer.Write(m_AspectRatio); 69 | writer.Write(m_Orthographic); 70 | stream.Position += 3; 71 | writer.Write(m_OrthographicSize); 72 | m_Material.WriteTo(stream); 73 | m_IgnoreLayers.WriteTo(stream); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | // 9 | [assembly: AssemblyTitle("")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("")] 14 | [assembly: AssemblyCopyright("")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Revision and Build Numbers 27 | // by using the '*' as shown below: 28 | 29 | [assembly: AssemblyVersion("1.0.*")] 30 | 31 | // 32 | // In order to sign your assembly you must specify a key to use. Refer to the 33 | // Microsoft .NET Framework documentation for more information on assembly signing. 34 | // 35 | // Use the attributes below to control which key is used for signing. 36 | // 37 | // Notes: 38 | // (*) If no key is specified, the assembly is not signed. 39 | // (*) KeyName refers to a key that has been installed in the Crypto Service 40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains 41 | // a key. 42 | // (*) If the KeyFile and the KeyName values are both specified, the 43 | // following processing occurs: 44 | // (1) If the KeyName can be found in the CSP, that key is used. 45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key 46 | // in the KeyFile is installed into the CSP and used. 47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. 48 | // When specifying the KeyFile, the location of the KeyFile should be 49 | // relative to the project output directory which is 50 | // %Project Directory%\obj\. For example, if your KeyFile is 51 | // located in the project directory, you would specify the AssemblyKeyFile 52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] 53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework 54 | // documentation for more information on this. 55 | // 56 | [assembly: AssemblyDelaySign(false)] 57 | [assembly: AssemblyKeyFile("")] 58 | [assembly: AssemblyKeyName("")] 59 | -------------------------------------------------------------------------------- /ODFPlugin/FormAnimView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows.Forms; 6 | using WeifenLuo.WinFormsUI.Docking; 7 | 8 | using SB3Utility; 9 | 10 | namespace ODFPlugin 11 | { 12 | [Plugin] 13 | [PluginOpensFile(".oda")] 14 | class FormAnimView : FormMeshView 15 | { 16 | public FormAnimView(string path, string variable) 17 | : base(path, variable) 18 | { 19 | tabControlLists.TabPages.Remove(tabPageMesh); 20 | tabControlLists.TabPages.Remove(tabPageMaterial); 21 | tabControlLists.TabPages.Remove(tabPageTexture); 22 | tabControlLists.TabPages.Remove(tabPageMorph); 23 | tabControlLists.SelectedTab = tabPageAnimation; 24 | 25 | tabControlViews.TabPages.Remove(tabPageBoneView); 26 | tabControlViews.TabPages.Remove(tabPageMeshView); 27 | tabControlViews.TabPages.Remove(tabPageMaterialView); 28 | tabControlViews.TabPages.Remove(tabPageTextureView); 29 | 30 | listViewAnimationTrack.ItemSelectionChanged -= base.listViewAnimationTrack_ItemSelectionChanged; 31 | listViewAnimationTrack.ItemSelectionChanged += this.listViewAnimationTrack_ItemSelectionChanged; 32 | } 33 | 34 | private new void listViewAnimationTrack_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) 35 | { 36 | List formODFList; 37 | if (!Gui.Docking.DockContents.TryGetValue(typeof(FormMeshView), out formODFList)) 38 | { 39 | return; 40 | } 41 | 42 | foreach (FormMeshView formMesh in formODFList) 43 | { 44 | odfFrame boneFrame = odf.FindFrame(e.Item.Text, formMesh.Editor.Parser.FrameSection.RootFrame); 45 | if (boneFrame == null) 46 | { 47 | continue; 48 | } 49 | for (int i = 0; i < formMesh.renderObjectMeshes.Count; i++) 50 | { 51 | RenderObjectODF mesh = formMesh.renderObjectMeshes[i]; 52 | if (mesh != null && formMesh.renderObjectIds[i] > -1) 53 | { 54 | odfMesh odfMesh = formMesh.Editor.Parser.MeshSection[i]; 55 | for (int j = 0; j < odfMesh.Count; j++) 56 | { 57 | odfSubmesh submesh = odfMesh[j]; 58 | odfBoneList bones = odf.FindBoneList(submesh.Id, formMesh.Editor.Parser.EnvelopeSection); 59 | if (bones == null) 60 | { 61 | continue; 62 | } 63 | for (int k = 0; k < bones.Count; k++) 64 | { 65 | if (bones[k].FrameId == boneFrame.Id) 66 | { 67 | mesh.HighlightBone(formMesh.Editor.Parser, i, j, e.IsSelected ? k : -1); 68 | Gui.Renderer.Render(); 69 | break; 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/SeperaratorCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace UrielGuy.SyntaxHighlightingTextBox 5 | { 6 | /// 7 | /// Summary description for SeperaratorCollection. 8 | /// 9 | public class SeperaratorCollection 10 | { 11 | private ArrayList mInnerList = new ArrayList(); 12 | internal SeperaratorCollection() 13 | { 14 | } 15 | 16 | public void AddRange(ICollection c) 17 | { 18 | mInnerList.AddRange(c); 19 | } 20 | 21 | internal char[] GetAsCharArray() 22 | { 23 | return (char[])mInnerList.ToArray(typeof(char)); 24 | } 25 | #region IList Members 26 | 27 | public bool IsReadOnly 28 | { 29 | get 30 | { 31 | return mInnerList.IsReadOnly; 32 | } 33 | } 34 | 35 | public char this[int index] 36 | { 37 | get 38 | { 39 | return (char)mInnerList[index]; 40 | } 41 | set 42 | { 43 | mInnerList[index] = value; 44 | } 45 | } 46 | 47 | public void RemoveAt(int index) 48 | { 49 | mInnerList.RemoveAt(index); 50 | } 51 | 52 | public void Insert(int index, char value) 53 | { 54 | mInnerList.Insert(index, value); 55 | } 56 | 57 | public void Remove(char value) 58 | { 59 | mInnerList.Remove(value); 60 | } 61 | 62 | public bool Contains(char value) 63 | { 64 | return mInnerList.Contains(value); 65 | } 66 | 67 | public void Clear() 68 | { 69 | mInnerList.Clear(); 70 | } 71 | 72 | public int IndexOf(char value) 73 | { 74 | return mInnerList.IndexOf(value); 75 | } 76 | 77 | public int Add(char value) 78 | { 79 | return mInnerList.Add(value); 80 | } 81 | 82 | public bool IsFixedSize 83 | { 84 | get 85 | { 86 | return mInnerList.IsFixedSize; 87 | } 88 | } 89 | 90 | #endregion 91 | 92 | #region ICollection Members 93 | 94 | public bool IsSynchronized 95 | { 96 | get 97 | { 98 | return mInnerList.IsSynchronized; 99 | } 100 | } 101 | 102 | public int Count 103 | { 104 | get 105 | { 106 | return mInnerList.Count; 107 | } 108 | } 109 | 110 | public void CopyTo(Array array, int index) 111 | { 112 | mInnerList.CopyTo(array, index); 113 | } 114 | 115 | public object SyncRoot 116 | { 117 | get 118 | { 119 | return mInnerList.SyncRoot; 120 | } 121 | } 122 | 123 | #endregion 124 | 125 | #region IEnumerable Members 126 | 127 | public IEnumerator GetEnumerator() 128 | { 129 | return mInnerList.GetEnumerator(); 130 | } 131 | 132 | #endregion 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /Plugins/SyntaxHighlightingTextBox/HighlightDescriptorCollection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace UrielGuy.SyntaxHighlightingTextBox 5 | { 6 | /// 7 | /// Summary description for SeperaratorCollection. 8 | /// 9 | public class HighLightDescriptorCollection 10 | { 11 | private ArrayList mInnerList = new ArrayList(); 12 | internal HighLightDescriptorCollection() 13 | { 14 | } 15 | 16 | public void AddRange(ICollection c) 17 | { 18 | mInnerList.AddRange(c); 19 | } 20 | 21 | 22 | #region IList Members 23 | 24 | public bool IsReadOnly 25 | { 26 | get 27 | { 28 | return mInnerList.IsReadOnly; 29 | } 30 | } 31 | 32 | public HighlightDescriptor this[int index] 33 | { 34 | get 35 | { 36 | return (HighlightDescriptor)mInnerList[index]; 37 | } 38 | set 39 | { 40 | mInnerList[index] = value; 41 | } 42 | } 43 | 44 | public void RemoveAt(int index) 45 | { 46 | mInnerList.RemoveAt(index); 47 | } 48 | 49 | public void Insert(int index, HighlightDescriptor value) 50 | { 51 | mInnerList.Insert(index, value); 52 | } 53 | 54 | public void Remove(HighlightDescriptor value) 55 | { 56 | mInnerList.Remove(value); 57 | } 58 | 59 | public bool Contains(HighlightDescriptor value) 60 | { 61 | return mInnerList.Contains(value); 62 | } 63 | 64 | public void Clear() 65 | { 66 | mInnerList.Clear(); 67 | } 68 | 69 | public int IndexOf(HighlightDescriptor value) 70 | { 71 | return mInnerList.IndexOf(value); 72 | } 73 | 74 | public int Add(HighlightDescriptor value) 75 | { 76 | return mInnerList.Add(value); 77 | } 78 | 79 | public bool IsFixedSize 80 | { 81 | get 82 | { 83 | return mInnerList.IsFixedSize; 84 | } 85 | } 86 | 87 | #endregion 88 | 89 | #region ICollection Members 90 | 91 | public bool IsSynchronized 92 | { 93 | get 94 | { 95 | return mInnerList.IsSynchronized; 96 | } 97 | } 98 | 99 | public int Count 100 | { 101 | get 102 | { 103 | return mInnerList.Count; 104 | } 105 | } 106 | 107 | public void CopyTo(Array array, int index) 108 | { 109 | mInnerList.CopyTo(array, index); 110 | } 111 | 112 | public object SyncRoot 113 | { 114 | get 115 | { 116 | return mInnerList.SyncRoot; 117 | } 118 | } 119 | 120 | #endregion 121 | 122 | #region IEnumerable Members 123 | 124 | public IEnumerator GetEnumerator() 125 | { 126 | return mInnerList.GetEnumerator(); 127 | } 128 | 129 | #endregion 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/ParticleAnimator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using SlimDX; 6 | 7 | using SB3Utility; 8 | 9 | namespace UnityPlugin 10 | { 11 | public class ParticleAnimator : Component, LinkedByGameObject, StoresReferences 12 | { 13 | public AssetCabinet file { get; set; } 14 | public int pathID { get; set; } 15 | public UnityClassID classID1 { get; set; } 16 | public UnityClassID classID2 { get; set; } 17 | 18 | public PPtr m_GameObject { get; set; } 19 | public bool Does_Animate_Color { get; set; } 20 | public uint[] colorAnimation { get; set; } 21 | public Vector3 worldRotationAxis { get; set; } 22 | public Vector3 localRotationAxis { get; set; } 23 | public float sizeGrow { get; set; } 24 | public Vector3 rndForce { get; set; } 25 | public Vector3 force { get; set; } 26 | public float damping { get; set; } 27 | public bool stopSimulation { get; set; } 28 | public bool autodestruct { get; set; } 29 | 30 | public ParticleAnimator(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 31 | { 32 | this.file = file; 33 | this.pathID = pathID; 34 | this.classID1 = classID1; 35 | this.classID2 = classID2; 36 | } 37 | 38 | public ParticleAnimator(AssetCabinet file) : 39 | this(file, 0, UnityClassID.ParticleAnimator, UnityClassID.ParticleAnimator) 40 | { 41 | file.ReplaceSubfile(-1, this, null); 42 | } 43 | 44 | public void LoadFrom(Stream stream) 45 | { 46 | BinaryReader reader = new BinaryReader(stream); 47 | m_GameObject = new PPtr(stream, file); 48 | Does_Animate_Color = reader.ReadBoolean(); 49 | reader.ReadBytes(3); 50 | colorAnimation = reader.ReadUInt32Array(5); 51 | worldRotationAxis = reader.ReadVector3(); 52 | localRotationAxis = reader.ReadVector3(); 53 | sizeGrow = reader.ReadSingle(); 54 | rndForce = reader.ReadVector3(); 55 | force = reader.ReadVector3(); 56 | damping = reader.ReadSingle(); 57 | stopSimulation = reader.ReadBoolean(); 58 | autodestruct = reader.ReadBoolean(); 59 | } 60 | 61 | public void WriteTo(Stream stream) 62 | { 63 | BinaryWriter writer = new BinaryWriter(stream); 64 | m_GameObject.WriteTo(stream); 65 | writer.Write(Does_Animate_Color); 66 | writer.Write(new byte[3]); 67 | writer.Write(colorAnimation); 68 | writer.Write(worldRotationAxis); 69 | writer.Write(localRotationAxis); 70 | writer.Write(sizeGrow); 71 | writer.Write(rndForce); 72 | writer.Write(force); 73 | writer.Write(damping); 74 | writer.Write(stopSimulation); 75 | writer.Write(autodestruct); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /ODFBase/odf/odfFileSection.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.IO; 7 | using System.Runtime.Serialization; 8 | using System.ComponentModel; 9 | using System.Reflection; 10 | 11 | using SB3Utility; 12 | 13 | namespace ODFPlugin 14 | { 15 | public enum odfSectionType 16 | { 17 | INVALID, 18 | [Description("LIGH")] LIGH, 19 | [Description("MAT ")] MAT, 20 | [Description("TEX ")] TEX, 21 | [Description("MESH")] MESH, 22 | [Description("FRAM")] FRAM, 23 | [Description("ANIM")] ANIM, 24 | [Description("LIGA")] LIGA, 25 | [Description("MATA")] MATA, 26 | [Description("MORP")] MORP, 27 | [Description("FOG ")] FOG, 28 | [Description("TXPT")] TXPT, 29 | [Description("ENVL")] ENVL, 30 | [Description("BANM")] BANM, 31 | [Description("SOUN")] SOUN, 32 | [Description("THOS")] THOS, 33 | [Description("TEXA")] TEXA, 34 | } 35 | 36 | public class odfFileSection : IWriteFile 37 | { 38 | public string Name { get; set; } 39 | public string ODFPath; 40 | public int Offset { get; set; } 41 | public odfSectionType Type { get; set; } 42 | public int Size { get; set; } 43 | public IObjInfo Section; 44 | 45 | public odfFileSection(odfSectionType type, string path) 46 | { 47 | Type = type; 48 | Name = type.ToString(); 49 | ODFPath = path; 50 | } 51 | 52 | #region SectionType 53 | private static string GetEnumDescription(Enum value) 54 | { 55 | FieldInfo fi = value.GetType().GetField(value.ToString()); 56 | 57 | DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); 58 | 59 | if (attributes != null && attributes.Length > 0) 60 | return attributes[0].Description; 61 | else 62 | return value.ToString(); 63 | } 64 | 65 | public static odfSectionType DecryptSectionType(byte[] buffer) 66 | { 67 | String str = Encoding.ASCII.GetString(buffer); 68 | odfSectionType[] secTypes = Enum.GetValues(typeof(odfSectionType)) as odfSectionType[]; 69 | for (int i = 0; i < secTypes.Length; i++) 70 | { 71 | if (GetEnumDescription(secTypes[i]) == str) 72 | return secTypes[i]; 73 | } 74 | return odfSectionType.INVALID; 75 | } 76 | 77 | public static byte[] EncryptSectionType(odfSectionType type) 78 | { 79 | return Encoding.ASCII.GetBytes(GetEnumDescription(type)); 80 | } 81 | #endregion 82 | 83 | public void WriteTo(Stream stream) 84 | { 85 | BinaryWriter writer = new BinaryWriter(stream); 86 | writer.Write(odfFileSection.EncryptSectionType(Type)); 87 | writer.Write(Size); 88 | Section.WriteTo(stream); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /AiDroidPlugin/FPK/FormREMDragDrop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | using SB3Utility; 5 | 6 | namespace AiDroidPlugin 7 | { 8 | public partial class FormREMDragDrop : Form 9 | { 10 | public CopyFrameMethod FrameMethod { get; protected set; } 11 | public CopyMeshMethod NormalsMethod { get; protected set; } 12 | public CopyMeshMethod BonesMethod { get; protected set; } 13 | 14 | private remEditor editor; 15 | 16 | public FormREMDragDrop(remEditor destEditor, bool frame) 17 | { 18 | InitializeComponent(); 19 | editor = destEditor; 20 | if (frame) 21 | { 22 | panelFrame.BringToFront(); 23 | } 24 | else 25 | { 26 | panelMesh.BringToFront(); 27 | } 28 | 29 | numericFrameId.Maximum = editor.Parser.BONC.Count - 1; 30 | numericMeshId.Maximum = editor.Parser.BONC.Count - 1; 31 | } 32 | 33 | private void radioButtonFrameMerge_CheckedChanged(object sender, EventArgs e) 34 | { 35 | FrameMethod = CopyFrameMethod.MergeFrame; 36 | } 37 | 38 | private void radioButtonFrameAdd_CheckedChanged(object sender, EventArgs e) 39 | { 40 | FrameMethod = CopyFrameMethod.AddFrame; 41 | } 42 | 43 | private void radioButtonFrameReplace_CheckedChanged(object sender, EventArgs e) 44 | { 45 | FrameMethod = CopyFrameMethod.ReplaceFrame; 46 | } 47 | 48 | private void numericFrameId_ValueChanged(object sender, EventArgs e) 49 | { 50 | textBoxFrameName.Text = (numericFrameId.Value < 0) ? editor.Parser.BONC.rootFrame.name : editor.Parser.BONC[Decimal.ToInt32(numericFrameId.Value)].name; 51 | } 52 | 53 | private void numericMeshId_ValueChanged(object sender, EventArgs e) 54 | { 55 | textBoxMeshName.Text = (numericMeshId.Value < 0) ? editor.Parser.BONC.rootFrame.name : editor.Parser.BONC[Decimal.ToInt32(numericMeshId.Value)].name; 56 | } 57 | 58 | private void radioButtonNormalsReplace_CheckedChanged(object sender, EventArgs e) 59 | { 60 | NormalsMethod = CopyMeshMethod.Replace; 61 | } 62 | 63 | private void radioButtonNormalsCopyNear_CheckedChanged(object sender, EventArgs e) 64 | { 65 | NormalsMethod = CopyMeshMethod.CopyNear; 66 | } 67 | 68 | private void radioButtonNormalsCopyOrder_CheckedChanged(object sender, EventArgs e) 69 | { 70 | NormalsMethod = CopyMeshMethod.CopyOrder; 71 | } 72 | 73 | private void radioButtonBonesReplace_CheckedChanged(object sender, EventArgs e) 74 | { 75 | BonesMethod = CopyMeshMethod.Replace; 76 | } 77 | 78 | private void radioButtonBonesCopyNear_CheckedChanged(object sender, EventArgs e) 79 | { 80 | BonesMethod = CopyMeshMethod.CopyNear; 81 | } 82 | 83 | private void radioButtonBonesCopyOrder_CheckedChanged(object sender, EventArgs e) 84 | { 85 | BonesMethod = CopyMeshMethod.CopyOrder; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/MonoScript.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace UnityPlugin 8 | { 9 | public class MonoScript : Component 10 | { 11 | public AssetCabinet file { get; set; } 12 | public int pathID { get; set; } 13 | public UnityClassID classID1 { get; set; } 14 | public UnityClassID classID2 { get; set; } 15 | 16 | public string m_Name { get; set; } 17 | public int m_ExecutionOrder { get; set; } 18 | public uint m_PropertiesHash { get; set; } 19 | public string m_ClassName { get; set; } 20 | public string m_Namespace { get; set; } 21 | public string m_AssemblyName { get; set; } 22 | public bool m_IsEditorScript { get; set; } 23 | 24 | public MonoScript(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 25 | { 26 | this.file = file; 27 | this.pathID = pathID; 28 | this.classID1 = classID1; 29 | this.classID2 = classID2; 30 | } 31 | 32 | public MonoScript(AssetCabinet file) : 33 | this(file, 0, UnityClassID.MonoScript, UnityClassID.MonoScript) 34 | { 35 | file.ReplaceSubfile(-1, this, null); 36 | } 37 | 38 | public void LoadFrom(Stream stream) 39 | { 40 | BinaryReader reader = new BinaryReader(stream); 41 | m_Name = reader.ReadNameA4(); 42 | m_ExecutionOrder = reader.ReadInt32(); 43 | m_PropertiesHash = reader.ReadUInt32(); 44 | m_ClassName = reader.ReadNameA4(); 45 | m_Namespace = reader.ReadNameA4(); 46 | m_AssemblyName = reader.ReadNameA4(); 47 | m_IsEditorScript = reader.ReadBoolean(); 48 | } 49 | 50 | public void WriteTo(Stream stream) 51 | { 52 | BinaryWriter writer = new BinaryWriter(stream); 53 | writer.WriteNameA4(m_Name); 54 | writer.Write(m_ExecutionOrder); 55 | writer.Write(m_PropertiesHash); 56 | writer.WriteNameA4(m_ClassName); 57 | writer.WriteNameA4(m_Namespace); 58 | writer.WriteNameA4(m_AssemblyName); 59 | writer.Write(m_IsEditorScript); 60 | } 61 | 62 | public MonoScript Clone(AssetCabinet file) 63 | { 64 | Component monoS = file.Bundle.FindComponent(m_Name, UnityClassID.MonoScript); 65 | if (monoS == null) 66 | { 67 | file.MergeTypeDefinition(this.file, UnityClassID.MonoScript); 68 | 69 | monoS = new MonoScript(file); 70 | file.Bundle.AddComponent(m_Name, monoS); 71 | using (MemoryStream mem = new MemoryStream()) 72 | { 73 | WriteTo(mem); 74 | mem.Position = 0; 75 | monoS.LoadFrom(mem); 76 | } 77 | } 78 | else if (monoS is NotLoaded) 79 | { 80 | NotLoaded notLoaded = (NotLoaded)monoS; 81 | if (notLoaded.replacement != null) 82 | { 83 | monoS = notLoaded.replacement; 84 | } 85 | else 86 | { 87 | monoS = file.LoadComponent(file.SourceStream, notLoaded); 88 | } 89 | } 90 | return (MonoScript)monoS; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /AiDroidBase/FPK/REAParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | 5 | using SB3Utility; 6 | 7 | namespace AiDroidPlugin 8 | { 9 | public class reaParser : IWriteFile 10 | { 11 | public reaANICsection ANIC = null; 12 | 13 | public string Name { get; set; } 14 | public string ReaPath { get; set; } 15 | 16 | public reaParser(Stream stream, string name, string path) 17 | : this(stream) 18 | { 19 | this.Name = name; 20 | this.ReaPath = path; 21 | } 22 | 23 | public reaParser(Stream stream) 24 | { 25 | try 26 | { 27 | using (BinaryReader reader = new BinaryReader(stream)) 28 | { 29 | byte[] type = reader.ReadBytes(4); 30 | Trace.Assert(remParser.TypeCheck(reaANICsection.ClassType, type)); 31 | int anicLength = reader.ReadInt32(); 32 | int unk1 = reader.ReadInt32(); 33 | float unk2 = reader.ReadSingle(); 34 | int count = reader.ReadInt32(); 35 | ANIC = new reaANICsection(count); 36 | ANIC.unk1 = unk1; 37 | ANIC.unk2 = unk2; 38 | for (int i = 0; i < count; i++) 39 | { 40 | reaAnimationTrack track = new reaAnimationTrack(); 41 | type = reader.ReadBytes(4); 42 | Trace.Assert(remParser.TypeCheck(reaAnimationTrack.ClassType, type)); 43 | int anioLength = reader.ReadInt32(); 44 | byte[] name = reader.ReadBytes(256); 45 | track.boneFrame = remParser.GetIdentifier(name, 0, 256); 46 | int numScalings = reader.ReadInt32(); 47 | track.scalings = new reaIndexVector[numScalings]; 48 | int numRotations = reader.ReadInt32(); 49 | track.rotations = new reaIndexQuaternion[numRotations]; 50 | int numTranslations = reader.ReadInt32(); 51 | track.translations = new reaIndexVector[numTranslations]; 52 | for (int j = 0; j < numScalings; j++) 53 | { 54 | reaIndexVector ivec = new reaIndexVector(); 55 | ivec.index = reader.ReadInt32(); 56 | ivec.value = reader.ReadVector3(); 57 | track.scalings[j] = ivec; 58 | } 59 | for (int j = 0; j < numRotations; j++) 60 | { 61 | reaIndexQuaternion iq = new reaIndexQuaternion(); 62 | iq.index = reader.ReadInt32(); 63 | iq.value = reader.ReadQuaternion(); 64 | track.rotations[j] = iq; 65 | } 66 | for (int j = 0; j < numTranslations; j++) 67 | { 68 | reaIndexVector ivec = new reaIndexVector(); 69 | ivec.index = reader.ReadInt32(); 70 | ivec.value = reader.ReadVector3(); 71 | track.translations[j] = ivec; 72 | } 73 | ANIC.AddChild(track); 74 | } 75 | } 76 | } 77 | catch (FileNotFoundException) 78 | { 79 | Report.ReportLog("file not found"); 80 | } 81 | } 82 | 83 | public void WriteTo(Stream stream) 84 | { 85 | if (ANIC != null) 86 | { 87 | ANIC.WriteTo(stream); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Plugins/UnityBase/unity3d/AudioClip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | 6 | using SB3Utility; 7 | 8 | namespace UnityPlugin 9 | { 10 | public class AudioClip : Component 11 | { 12 | public AssetCabinet file { get; set; } 13 | public int pathID { get; set; } 14 | public UnityClassID classID1 { get; set; } 15 | public UnityClassID classID2 { get; set; } 16 | 17 | public string m_Name { get; set; } 18 | public int m_Format { get; set; } 19 | public int m_Type { get; set; } 20 | public bool m_3D { get; set; } 21 | public bool m_UseHardware { get; set; } 22 | public int m_Stream { get; set; } 23 | public byte[] m_AudioData { get; set; } 24 | 25 | public AudioClip(AssetCabinet file, int pathID, UnityClassID classID1, UnityClassID classID2) 26 | { 27 | this.file = file; 28 | this.pathID = pathID; 29 | this.classID1 = classID1; 30 | this.classID2 = classID2; 31 | } 32 | 33 | public void LoadFrom(Stream stream) 34 | { 35 | BinaryReader reader = new BinaryReader(stream); 36 | m_Name = reader.ReadNameA4(); 37 | m_Format = reader.ReadInt32(); 38 | m_Type = reader.ReadInt32(); 39 | m_3D = reader.ReadBoolean(); 40 | m_UseHardware = reader.ReadBoolean(); 41 | reader.ReadBytes(2); 42 | m_Stream = reader.ReadInt32(); 43 | m_AudioData = reader.ReadBytes(reader.ReadInt32()); 44 | } 45 | 46 | public void WriteTo(Stream stream) 47 | { 48 | BinaryWriter writer = new BinaryWriter(stream); 49 | writer.WriteNameA4(m_Name); 50 | writer.Write(m_Format); 51 | writer.Write(m_Type); 52 | writer.Write(m_3D); 53 | writer.Write(m_UseHardware); 54 | writer.Write(new byte[2]); 55 | writer.Write(m_Stream); 56 | 57 | writer.Write(m_AudioData.Length); 58 | writer.Write(m_AudioData); 59 | } 60 | 61 | public void Export(string path) 62 | { 63 | DirectoryInfo dirInfo = new DirectoryInfo(path); 64 | if (!dirInfo.Exists) 65 | { 66 | dirInfo.Create(); 67 | } 68 | 69 | bool isOgg = m_AudioData[0] == (byte)'O' && m_AudioData[1] == (byte)'g' && m_AudioData[2] == (byte)'g' && m_AudioData[3] == (byte)'S'; 70 | using (BinaryWriter writer = new BinaryWriter(File.OpenWrite(path + "\\" + m_Name + "." + (isOgg ? "ogg" : UnityClassID.AudioClip.ToString())))) 71 | { 72 | writer.Write(m_AudioData); 73 | writer.BaseStream.SetLength(writer.BaseStream.Position); 74 | } 75 | } 76 | 77 | public static AudioClip Import(string filePath) 78 | { 79 | AudioClip ac = new AudioClip(null, 0, UnityClassID.AudioClip, UnityClassID.AudioClip); 80 | ac.m_Name = Path.GetFileNameWithoutExtension(filePath); 81 | using (BinaryReader reader = new BinaryReader(File.OpenRead(filePath))) 82 | { 83 | ac.m_AudioData = reader.ReadBytes((int)reader.BaseStream.Length); 84 | } 85 | return ac; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /SB3UtilityHelp/Plugins.aml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 14 | 15 | To do 16 | 17 | 18 | 19 |
20 | To do 21 | 22 | 23 | 24 |
25 | 30 | 31 | 62 | 63 |
64 |
-------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPRename.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.IO; 9 | 10 | namespace SB3Utility 11 | { 12 | public partial class FormPPRename : Form 13 | { 14 | public string NewName { get; protected set; } 15 | 16 | ListViewItem item = null; 17 | 18 | private SizeF startSize; 19 | 20 | public FormPPRename(ListViewItem item) 21 | { 22 | InitializeComponent(); 23 | startSize = new SizeF(Width, Height); 24 | this.SaveDesignSizes(); 25 | this.item = item; 26 | this.textBox1.Text = item.Text; 27 | NewName = null; 28 | } 29 | 30 | private void buttonCancel_Click(object sender, EventArgs e) 31 | { 32 | this.DialogResult = DialogResult.Cancel; 33 | this.Close(); 34 | } 35 | 36 | private void buttonOK_Click(object sender, EventArgs e) 37 | { 38 | textBox1.Text = textBox1.Text.Trim(); 39 | if (textBox1.Text == item.Text) 40 | { 41 | this.DialogResult = DialogResult.Cancel; 42 | this.Close(); 43 | return; 44 | } 45 | if (textBox1.Text.Length == 0) 46 | { 47 | Report.ReportLog("The filename length must be greater than 0"); 48 | return; 49 | } 50 | if ((textBox1.Text.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) || (textBox1.Text.IndexOfAny(Path.GetInvalidPathChars()) >= 0)) 51 | { 52 | Report.ReportLog("That filename has invalid characters"); 53 | return; 54 | } 55 | ListViewItem foundItem = item.ListView.FindItemWithText(textBox1.Text, false, 0, false); 56 | if (foundItem != null) 57 | { 58 | Report.ReportLog("That filename already exists at position " + foundItem.Index); 59 | return; 60 | } 61 | 62 | NewName = textBox1.Text; 63 | this.DialogResult = DialogResult.OK; 64 | this.Close(); 65 | } 66 | 67 | private void FormPPRename_Shown(object sender, EventArgs e) 68 | { 69 | Size dialogSize = (Size)Gui.Config["DialogPPRenameSize"]; 70 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 71 | { 72 | Width = dialogSize.Width; 73 | Height = dialogSize.Height; 74 | this.ResizeControls(startSize); 75 | } 76 | else 77 | { 78 | Width = (int)startSize.Width; 79 | Height = (int)startSize.Height; 80 | this.ResetControls(); 81 | } 82 | } 83 | 84 | private void FormPPRename_Resize(object sender, EventArgs e) 85 | { 86 | this.ResizeControls(startSize); 87 | } 88 | 89 | private void FormPPRename_VisibleChanged(object sender, EventArgs e) 90 | { 91 | if (!Visible) 92 | { 93 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 94 | { 95 | Gui.Config["DialogPPRenameSize"] = new Size(0, 0); 96 | } 97 | else 98 | { 99 | Gui.Config["DialogPPRenameSize"] = this.Size; 100 | } 101 | } 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ODFPlugin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ODFPlugin.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ODFPlugin.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPSave.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SB3Utility 2 | { 3 | partial class FormPPSave 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.buttonCancel = new System.Windows.Forms.Button(); 32 | this.progressBar1 = new System.Windows.Forms.ProgressBar(); 33 | this.SuspendLayout(); 34 | // 35 | // buttonCancel 36 | // 37 | this.buttonCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom; 38 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 39 | this.buttonCancel.Location = new System.Drawing.Point(154, 57); 40 | this.buttonCancel.Name = "buttonCancel"; 41 | this.buttonCancel.Size = new System.Drawing.Size(75, 23); 42 | this.buttonCancel.TabIndex = 0; 43 | this.buttonCancel.Text = "Cancel"; 44 | this.buttonCancel.UseVisualStyleBackColor = true; 45 | // 46 | // progressBar1 47 | // 48 | this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 49 | | System.Windows.Forms.AnchorStyles.Right))); 50 | this.progressBar1.Location = new System.Drawing.Point(12, 12); 51 | this.progressBar1.Name = "progressBar1"; 52 | this.progressBar1.Size = new System.Drawing.Size(365, 23); 53 | this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous; 54 | this.progressBar1.TabIndex = 1; 55 | // 56 | // FormPPSave 57 | // 58 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 59 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 60 | this.ClientSize = new System.Drawing.Size(389, 92); 61 | this.Controls.Add(this.progressBar1); 62 | this.Controls.Add(this.buttonCancel); 63 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 64 | this.Name = "FormPPSave"; 65 | this.ShowIcon = false; 66 | this.ShowInTaskbar = false; 67 | this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; 68 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 69 | this.Text = "Saving..."; 70 | this.ResumeLayout(false); 71 | 72 | } 73 | 74 | #endregion 75 | 76 | private System.Windows.Forms.Button buttonCancel; 77 | private System.Windows.Forms.ProgressBar progressBar1; 78 | } 79 | } -------------------------------------------------------------------------------- /AiDroidPlugin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AiDroidPlugin.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AiDroidPlugin.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/UnityPlugin/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.17929 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UnityPlugin.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnityPlugin.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.239 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SB3Utility.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SB3Utility.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SB3UtilityGUI/AboutBox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Windows.Forms; 8 | 9 | namespace SB3Utility 10 | { 11 | partial class AboutBox : Form 12 | { 13 | public AboutBox() 14 | { 15 | InitializeComponent(); 16 | this.Text = String.Format("About {0}", AssemblyTitle); 17 | this.labelProductName.Text = AssemblyProduct; 18 | this.labelVersion.Text = Gui.Version; 19 | this.labelCopyright.Text = AssemblyCopyright; 20 | this.labelCompanyName.Text = "HongFire Modding Club"; 21 | this.textBoxDescription.Text = "Discussion Thread:" + Environment.NewLine + @"http://www.hongfire.com/forum/showthread.php/112039/"; 22 | } 23 | 24 | #region Assembly Attribute Accessors 25 | 26 | public string AssemblyTitle 27 | { 28 | get 29 | { 30 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); 31 | if (attributes.Length > 0) 32 | { 33 | AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; 34 | if (titleAttribute.Title != "") 35 | { 36 | return titleAttribute.Title; 37 | } 38 | } 39 | return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); 40 | } 41 | } 42 | 43 | public string AssemblyVersion 44 | { 45 | get 46 | { 47 | return Assembly.GetExecutingAssembly().GetName().Version.ToString(); 48 | } 49 | } 50 | 51 | public string AssemblyDescription 52 | { 53 | get 54 | { 55 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); 56 | if (attributes.Length == 0) 57 | { 58 | return ""; 59 | } 60 | return ((AssemblyDescriptionAttribute)attributes[0]).Description; 61 | } 62 | } 63 | 64 | public string AssemblyProduct 65 | { 66 | get 67 | { 68 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); 69 | if (attributes.Length == 0) 70 | { 71 | return ""; 72 | } 73 | return ((AssemblyProductAttribute)attributes[0]).Product; 74 | } 75 | } 76 | 77 | public string AssemblyCopyright 78 | { 79 | get 80 | { 81 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); 82 | if (attributes.Length == 0) 83 | { 84 | return ""; 85 | } 86 | return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; 87 | } 88 | } 89 | 90 | public string AssemblyCompany 91 | { 92 | get 93 | { 94 | object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); 95 | if (attributes.Length == 0) 96 | { 97 | return ""; 98 | } 99 | return ((AssemblyCompanyAttribute)attributes[0]).Company; 100 | } 101 | } 102 | #endregion 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /AiDroidBase/FPK/REAStructures.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.IO; 5 | using SlimDX; 6 | 7 | using SB3Utility; 8 | 9 | namespace AiDroidPlugin 10 | { 11 | public class reaANICsection : remContainer, IObjInfo 12 | { 13 | public static byte[] ClassType = Encoding.ASCII.GetBytes("ANIC"); 14 | 15 | public override byte[] Type { get { return ClassType; } } 16 | 17 | public int unk1; 18 | public float unk2; 19 | 20 | public reaANICsection(int numTracks) : base(numTracks) 21 | { 22 | } 23 | 24 | public override int Length() 25 | { 26 | int len = 0; 27 | foreach (reaAnimationTrack track in children) 28 | { 29 | len += track.Length(); 30 | } 31 | return len; 32 | } 33 | 34 | public override void WriteTo(Stream stream) 35 | { 36 | BinaryWriter writer = new BinaryWriter(stream); 37 | writer.Write(Type); 38 | writer.Write(Length()); 39 | writer.Write(unk1); 40 | writer.Write(unk2); 41 | writer.Write(Count); 42 | foreach (reaAnimationTrack track in this) 43 | { 44 | track.WriteTo(stream); 45 | } 46 | } 47 | } 48 | 49 | public class reaAnimationTrack : remSection, IObjChild, IObjInfo 50 | { 51 | public static byte[] ClassType = Encoding.ASCII.GetBytes("ANIO"); 52 | 53 | public byte[] Type { get { return ClassType; } } 54 | 55 | public remId boneFrame; 56 | public reaIndexVector[] scalings; 57 | public reaIndexQuaternion[] rotations; 58 | public reaIndexVector[] translations; 59 | 60 | public reaAnimationTrack() 61 | { 62 | } 63 | 64 | public dynamic Parent { get; set; } 65 | 66 | public int Length() 67 | { 68 | return 4+4+256+4+4+4 + (scalings.Length * (4+12)) + (rotations.Length * (4+16)) + (translations.Length * (4+12)); 69 | } 70 | 71 | public void WriteTo(Stream stream) 72 | { 73 | BinaryWriter writer = new BinaryWriter(stream); 74 | writer.Write(Type); 75 | writer.Write(Length()); 76 | boneFrame.WriteTo(stream); 77 | writer.Write(scalings.Length); 78 | writer.Write(rotations.Length); 79 | writer.Write(translations.Length); 80 | foreach (reaIndexVector ivec in scalings) 81 | { 82 | ivec.WriteTo(stream); 83 | } 84 | foreach (reaIndexQuaternion iq in rotations) 85 | { 86 | iq.WriteTo(stream); 87 | } 88 | foreach (reaIndexVector ivec in translations) 89 | { 90 | ivec.WriteTo(stream); 91 | } 92 | } 93 | } 94 | 95 | public class reaIndexVector : IObjInfo 96 | { 97 | public int index; 98 | public Vector3 value; 99 | 100 | public void WriteTo(Stream stream) 101 | { 102 | BinaryWriter writer = new BinaryWriter(stream); 103 | writer.Write(index); 104 | writer.Write(value); 105 | } 106 | } 107 | 108 | public class reaIndexQuaternion : IObjInfo 109 | { 110 | public int index; 111 | public Quaternion value; 112 | 113 | public void WriteTo(Stream stream) 114 | { 115 | BinaryWriter writer = new BinaryWriter(stream); 116 | writer.Write(index); 117 | writer.Write(value); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPP/Ema.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using SlimDX; 6 | using SlimDX.Direct3D9; 7 | 8 | namespace SB3Utility 9 | { 10 | public class Ema : IWriteFile 11 | { 12 | public string Name { get; set; } 13 | public byte[] Data { get; set; } 14 | 15 | public Ema() 16 | { 17 | } 18 | 19 | public Ema(Stream stream, string name) 20 | : this(stream) 21 | { 22 | this.Name = name; 23 | } 24 | 25 | public Ema(Stream stream) 26 | { 27 | using (BinaryReader reader = new BinaryReader(stream)) 28 | { 29 | Data = reader.ReadToEnd(); 30 | } 31 | } 32 | 33 | public void WriteTo(Stream stream) 34 | { 35 | BinaryWriter writer = new BinaryWriter(stream); 36 | writer.Write(Data); 37 | } 38 | 39 | public ImportedTexture ImportedTexture() 40 | { 41 | string ext = Encoding.ASCII.GetString(Data, 8, 4).ToLowerInvariant(); 42 | ImportedTexture importedTex = new ImportedTexture(); 43 | importedTex.Name = Path.GetFileNameWithoutExtension(Name) + ext; 44 | importedTex.Data = CreateImageData(); 45 | return importedTex; 46 | } 47 | 48 | public void Export(string path) 49 | { 50 | using (BinaryWriter writer = new BinaryWriter(File.Create(path))) 51 | { 52 | writer.Write(CreateImageData()); 53 | } 54 | } 55 | 56 | byte[] CreateImageData() 57 | { 58 | string ext = Encoding.ASCII.GetString(Data, 8, 4).ToLowerInvariant(); 59 | byte[] buf = new byte[Data.Length - 13]; 60 | Array.Copy(Data, 13, buf, 0, buf.Length); 61 | if (ext.ToLowerInvariant() == ".bmp") 62 | { 63 | buf[0] = (byte)'B'; 64 | buf[1] = (byte)'M'; 65 | } 66 | return buf; 67 | } 68 | 69 | public static Ema Import(string path) 70 | { 71 | return Import(File.OpenRead(path), Path.GetFileNameWithoutExtension(path) + ".ema"); 72 | } 73 | 74 | public static Ema Import(Stream stream, string name) 75 | { 76 | Ema ema = Import(stream); 77 | ema.Name = name; 78 | return ema; 79 | } 80 | 81 | public static Ema Import(Stream stream) 82 | { 83 | Ema ema = new Ema(); 84 | using (BinaryReader reader = new BinaryReader(stream)) 85 | { 86 | byte[] imgData = reader.ReadToEnd(); 87 | var imgInfo = ImageInformation.FromMemory(imgData); 88 | 89 | ema.Data = new byte[imgData.Length + 13]; 90 | BinaryWriter dataWriter = new BinaryWriter(new MemoryStream(ema.Data)); 91 | dataWriter.Write(imgInfo.Width); 92 | dataWriter.Write(imgInfo.Height); 93 | 94 | string ext = Enum.GetName(typeof(ImageFileFormat), imgInfo.ImageFileFormat).ToLowerInvariant(); 95 | dataWriter.Write((byte)'.'); 96 | dataWriter.Write(Encoding.ASCII.GetBytes(ext)); 97 | dataWriter.Write((byte)0); 98 | 99 | if (imgInfo.ImageFileFormat == ImageFileFormat.Bmp) 100 | { 101 | dataWriter.Write((short)0); 102 | dataWriter.Write(imgData, 2, imgData.Length - 2); 103 | } 104 | else 105 | { 106 | dataWriter.Write(imgData); 107 | } 108 | } 109 | return ema; 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPMultiRename.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | using System.IO; 9 | 10 | namespace SB3Utility 11 | { 12 | public partial class FormPPMultiRename : Form 13 | { 14 | protected List ppSubfiles; 15 | 16 | private SizeF startSize; 17 | 18 | public FormPPMultiRename(List subfiles) 19 | { 20 | ppSubfiles = subfiles; 21 | InitializeComponent(); 22 | startSize = new SizeF(Width, Height); 23 | this.SaveDesignSizes(); 24 | } 25 | 26 | private void buttonCancel_Click(object sender, EventArgs e) 27 | { 28 | this.DialogResult = DialogResult.Cancel; 29 | this.Close(); 30 | } 31 | 32 | private void buttonOK_Click(object sender, EventArgs e) 33 | { 34 | textBoxSearchFor.Text = textBoxSearchFor.Text.Trim(); 35 | textBoxReplaceWith.Text = textBoxReplaceWith.Text.Trim(); 36 | 37 | this.DialogResult = DialogResult.OK; 38 | this.Close(); 39 | } 40 | 41 | private void FormPPMultiRename_Shown(object sender, EventArgs e) 42 | { 43 | Size dialogSize = (Size)Gui.Config["DialogPPMultiRenameSize"]; 44 | if (dialogSize.Width != 0 && dialogSize.Height != 0) 45 | { 46 | Width = dialogSize.Width; 47 | Height = dialogSize.Height; 48 | this.ResizeControls(startSize); 49 | } 50 | else 51 | { 52 | Width = (int)startSize.Width; 53 | Height = (int)startSize.Height; 54 | this.ResetControls(); 55 | } 56 | textBoxSearchFor.Focus(); 57 | } 58 | 59 | private void FormPPMultiRename_Resize(object sender, EventArgs e) 60 | { 61 | this.ResizeControls(startSize); 62 | } 63 | 64 | private void FormPPMultiRename_VisibleChanged(object sender, EventArgs e) 65 | { 66 | if (!Visible) 67 | { 68 | if (Width < (int)startSize.Width || Height < (int)startSize.Height) 69 | { 70 | Gui.Config["DialogPPMultiRenameSize"] = new Size(0, 0); 71 | } 72 | else 73 | { 74 | Gui.Config["DialogPPMultiRenameSize"] = this.Size; 75 | } 76 | } 77 | } 78 | 79 | private void textBoxSearchFor_AfterEditTextChanged(object sender, EventArgs e) 80 | { 81 | textBoxFirstMatch.Text = String.Empty; 82 | foreach (IWriteFile iwf in ppSubfiles) 83 | { 84 | string pattern = textBoxSearchFor.Text; 85 | System.Text.RegularExpressions.Match m = System.Text.RegularExpressions.Regex.Match(iwf.Name, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase); 86 | if (m.Success) 87 | { 88 | textBoxFirstMatch.Text = iwf.Name; 89 | break; 90 | } 91 | } 92 | } 93 | 94 | private void textBoxReplaceWith_AfterEditTextChanged(object sender, EventArgs e) 95 | { 96 | string firstMatch = textBoxFirstMatch.Text; 97 | string pattern = textBoxSearchFor.Text; 98 | string name = System.Text.RegularExpressions.Regex.Replace(firstMatch, pattern, textBoxReplaceWith.Text, System.Text.RegularExpressions.RegexOptions.IgnoreCase); 99 | textBoxFirstReplacement.Text = name; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /ODFBase/odf/odaOps.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using SlimDX; 5 | 6 | using SB3Utility; 7 | 8 | namespace ODFPlugin 9 | { 10 | public static partial class odf 11 | { 12 | public static void ReplaceMorph(string destMorphName, odfParser parser, WorkspaceMorph wsMorphList, string newMorphName, bool replaceNormals, float minSquaredDistance) 13 | { 14 | odfMorphSection morphSection = parser.MorphSection; 15 | if (morphSection == null) 16 | { 17 | Report.ReportLog("The .odf file doesn't have a morph section. Skipping these morphs"); 18 | return; 19 | } 20 | 21 | odfMorphObject morphObj = odf.FindMorphObject(destMorphName, morphSection); 22 | if (morphObj == null) 23 | { 24 | Report.ReportLog("Couldn't find morph object " + destMorphName + ". Skipping these morphs"); 25 | return; 26 | } 27 | 28 | Report.ReportLog("Replacing morphs ..."); 29 | try 30 | { 31 | ushort[] meshIndices = morphObj.MeshIndices; 32 | foreach (ImportedMorphKeyframe wsMorph in wsMorphList.KeyframeList) 33 | { 34 | if (!wsMorphList.isMorphKeyframeEnabled(wsMorph)) 35 | continue; 36 | odfMorphProfile profile = odf.FindMorphProfile(wsMorph.Name, morphObj); 37 | if (profile == null) 38 | { 39 | Report.ReportLog("Warning: Couldn't find morph profile " + wsMorph.Name + ". Skipping this morph"); 40 | continue; 41 | } 42 | 43 | List vertList = wsMorph.VertexList; 44 | for (int i = 0; i < meshIndices.Length; i++) 45 | { 46 | Vector3 orgPos = new Vector3(profile.VertexList[i].Position.X, profile.VertexList[i].Position.Y, profile.VertexList[i].Position.Z), 47 | newPos = new Vector3(vertList[meshIndices[i]].Position.X, vertList[meshIndices[i]].Position.Y, vertList[meshIndices[i]].Position.Z); 48 | if ((orgPos - newPos).LengthSquared() >= minSquaredDistance) 49 | profile.VertexList[i].Position = vertList[meshIndices[i]].Position; 50 | if (replaceNormals) 51 | { 52 | profile.VertexList[i].Normal = vertList[meshIndices[i]].Normal; 53 | } 54 | } 55 | 56 | string morphNewName = wsMorphList.getMorphKeyframeNewName(wsMorph); 57 | if (morphNewName != String.Empty) 58 | { 59 | profile.Name = new ObjectName(morphNewName, null); 60 | } 61 | } 62 | if (newMorphName != String.Empty) 63 | { 64 | morphObj.Name = new ObjectName(newMorphName, null); 65 | } 66 | } 67 | catch (Exception ex) 68 | { 69 | Utility.ReportException(ex); 70 | } 71 | } 72 | 73 | public static odfANIMSection FindClip(string name, odfParser parser) 74 | { 75 | if (name == "ANIM" || name == String.Empty || parser.BANMList == null) 76 | { 77 | return parser.AnimSection; 78 | } 79 | foreach (odfBANMSection anim in parser.BANMList) 80 | { 81 | if (anim.Name == name) 82 | { 83 | return anim; 84 | } 85 | } 86 | 87 | return null; 88 | } 89 | 90 | public static void CreateUnknowns(odfTrack track) 91 | { 92 | UnknownDefaults.odfTrack(track); 93 | } 94 | 95 | public static void CreateUnknowns(odfKeyframe keyframe) 96 | { 97 | UnknownDefaults.odfKeyframe(keyframe); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Plugins/SB3UtilityPlugins/pp/FormPPRename.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SB3Utility 2 | { 3 | partial class FormPPRename 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.textBox1 = new System.Windows.Forms.TextBox(); 32 | this.buttonOK = new System.Windows.Forms.Button(); 33 | this.buttonCancel = new System.Windows.Forms.Button(); 34 | this.SuspendLayout(); 35 | // 36 | // textBox1 37 | // 38 | this.textBox1.Location = new System.Drawing.Point(12, 14); 39 | this.textBox1.Name = "textBox1"; 40 | this.textBox1.Size = new System.Drawing.Size(326, 20); 41 | this.textBox1.TabIndex = 0; 42 | // 43 | // buttonOK 44 | // 45 | this.buttonOK.Location = new System.Drawing.Point(81, 40); 46 | this.buttonOK.Name = "buttonOK"; 47 | this.buttonOK.Size = new System.Drawing.Size(75, 23); 48 | this.buttonOK.TabIndex = 1; 49 | this.buttonOK.Text = "OK"; 50 | this.buttonOK.UseVisualStyleBackColor = true; 51 | this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); 52 | // 53 | // buttonCancel 54 | // 55 | this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 56 | this.buttonCancel.Location = new System.Drawing.Point(189, 40); 57 | this.buttonCancel.Name = "buttonCancel"; 58 | this.buttonCancel.Size = new System.Drawing.Size(75, 23); 59 | this.buttonCancel.TabIndex = 2; 60 | this.buttonCancel.Text = "Cancel"; 61 | this.buttonCancel.UseVisualStyleBackColor = true; 62 | this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); 63 | // 64 | // FormPPRename 65 | // 66 | this.AcceptButton = this.buttonOK; 67 | this.CancelButton = this.buttonCancel; 68 | this.ClientSize = new System.Drawing.Size(350, 67); 69 | this.ControlBox = false; 70 | this.Controls.Add(this.buttonCancel); 71 | this.Controls.Add(this.buttonOK); 72 | this.Controls.Add(this.textBox1); 73 | this.DoubleBuffered = true; 74 | this.Name = "FormPPRename"; 75 | this.ShowInTaskbar = false; 76 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 77 | this.Text = "Rename File"; 78 | this.Shown += new System.EventHandler(this.FormPPRename_Shown); 79 | this.VisibleChanged += new System.EventHandler(this.FormPPRename_VisibleChanged); 80 | this.Resize += new System.EventHandler(this.FormPPRename_Resize); 81 | this.ResumeLayout(false); 82 | this.PerformLayout(); 83 | 84 | } 85 | 86 | #endregion 87 | 88 | private System.Windows.Forms.TextBox textBox1; 89 | private System.Windows.Forms.Button buttonOK; 90 | private System.Windows.Forms.Button buttonCancel; 91 | } 92 | } -------------------------------------------------------------------------------- /PPD_Preview_Clothes/PPDPreviewClothes.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PPD_Preview_Clothes 2 | { 3 | partial class PPDPreviewClothes 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.buttonPrepare = new System.Windows.Forms.Button(); 32 | this.buttonRestoreDefault = new System.Windows.Forms.Button(); 33 | this.SuspendLayout(); 34 | // 35 | // buttonPrepare 36 | // 37 | this.buttonPrepare.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 38 | | System.Windows.Forms.AnchorStyles.Right))); 39 | this.buttonPrepare.Location = new System.Drawing.Point(13, 13); 40 | this.buttonPrepare.Name = "buttonPrepare"; 41 | this.buttonPrepare.Size = new System.Drawing.Size(231, 23); 42 | this.buttonPrepare.TabIndex = 0; 43 | this.buttonPrepare.Text = "Prepare"; 44 | this.buttonPrepare.UseVisualStyleBackColor = true; 45 | this.buttonPrepare.Click += new System.EventHandler(this.buttonPrepare_Click); 46 | // 47 | // buttonRestoreDefault 48 | // 49 | this.buttonRestoreDefault.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 50 | | System.Windows.Forms.AnchorStyles.Right))); 51 | this.buttonRestoreDefault.Enabled = false; 52 | this.buttonRestoreDefault.Location = new System.Drawing.Point(13, 43); 53 | this.buttonRestoreDefault.Name = "buttonRestoreDefault"; 54 | this.buttonRestoreDefault.Size = new System.Drawing.Size(231, 23); 55 | this.buttonRestoreDefault.TabIndex = 1; 56 | this.buttonRestoreDefault.Text = "Restore Default Clothes"; 57 | this.buttonRestoreDefault.UseVisualStyleBackColor = true; 58 | this.buttonRestoreDefault.Click += new System.EventHandler(this.buttonRestoreDefault_Click); 59 | // 60 | // PPDPreviewClothes 61 | // 62 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 63 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 64 | this.ClientSize = new System.Drawing.Size(256, 133); 65 | this.CloseButton = false; 66 | this.CloseButtonVisible = false; 67 | this.Controls.Add(this.buttonRestoreDefault); 68 | this.Controls.Add(this.buttonPrepare); 69 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 70 | this.Name = "PPDPreviewClothes"; 71 | this.Text = "Preview Clothes"; 72 | this.ResumeLayout(false); 73 | 74 | } 75 | 76 | #endregion 77 | 78 | private System.Windows.Forms.Button buttonPrepare; 79 | private System.Windows.Forms.Button buttonRestoreDefault; 80 | } 81 | } -------------------------------------------------------------------------------- /AiDroidBase/AiDroidBase.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {F90359AB-D9E6-4110-8AD4-FC12A93D0CF4} 9 | Library 10 | Properties 11 | AiDroidBase 12 | AiDroidBase 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | x86 25 | 26 | 27 | none 28 | true 29 | ..\bin\plugins\ 30 | TRACE 31 | prompt 32 | 4 33 | x86 34 | false 35 | 36 | 37 | 38 | ..\SB3UtilityExternalLibraries\SlimDX.dll 39 | False 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {5647B104-8F58-4867-B849-DAC65D5243BD} 61 | SB3UtilityPP 62 | False 63 | 64 | 65 | {A351DFAB-3235-4CEA-9916-1BAE973B65AE} 66 | SB3Utility 67 | False 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /ODFPlugin/FormMeshViewDragDrop.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | using SB3Utility; 10 | 11 | namespace ODFPlugin 12 | { 13 | public partial class FormMeshViewDragDrop : Form 14 | { 15 | public enum Panel 16 | { 17 | Frame, Mesh, MorphList 18 | } 19 | 20 | public CopyFrameMethod FrameMethod { get; protected set; } 21 | public CopyMeshMethod NormalsMethod { get; protected set; } 22 | public CopyMeshMethod BonesMethod { get; protected set; } 23 | 24 | private odfEditor editor; 25 | 26 | public FormMeshViewDragDrop(odfEditor destEditor, Panel panel) 27 | { 28 | InitializeComponent(); 29 | editor = destEditor; 30 | 31 | switch (panel) 32 | { 33 | case Panel.Frame: 34 | panelFrame.BringToFront(); 35 | break; 36 | case Panel.Mesh: 37 | panelMesh.BringToFront(); 38 | break; 39 | case Panel.MorphList: 40 | panelMorphList.BringToFront(); 41 | break; 42 | } 43 | 44 | numericFrameId.Maximum = editor.Frames.Count - 1; 45 | numericMeshId.Maximum = editor.Frames.Count - 1; 46 | } 47 | 48 | private void radioButtonFrameMerge_CheckedChanged(object sender, EventArgs e) 49 | { 50 | FrameMethod = CopyFrameMethod.MergeFrame; 51 | } 52 | 53 | private void radioButtonFrameAdd_CheckedChanged(object sender, EventArgs e) 54 | { 55 | FrameMethod = CopyFrameMethod.AddFrame; 56 | } 57 | 58 | private void radioButtonFrameReplace_CheckedChanged(object sender, EventArgs e) 59 | { 60 | FrameMethod = CopyFrameMethod.ReplaceFrame; 61 | } 62 | 63 | private void numericFrameId_ValueChanged(object sender, EventArgs e) 64 | { 65 | textBoxFrameName.Text = (numericFrameId.Value < 0) ? String.Empty : editor.Frames[Decimal.ToInt32(numericFrameId.Value)].Name; 66 | } 67 | 68 | private void numericMeshId_ValueChanged(object sender, EventArgs e) 69 | { 70 | textBoxMeshFrameName.Text = (numericMeshId.Value < 0) ? String.Empty : editor.Frames[Decimal.ToInt32(numericMeshId.Value)].Name; 71 | odfFrame frame = odf.FindFrame(textBoxMeshFrameName.Text, editor.Parser.FrameSection.RootFrame); 72 | textBoxMeshName.Text = String.Empty; 73 | if ((int)frame.MeshId != 0) 74 | { 75 | odfMesh mesh = odf.FindMeshListSome(frame.MeshId, editor.Parser.MeshSection); 76 | if (mesh != null) 77 | textBoxMeshName.Text = mesh.Name; 78 | } 79 | } 80 | 81 | private void radioButtonNormalsReplace_CheckedChanged(object sender, EventArgs e) 82 | { 83 | NormalsMethod = CopyMeshMethod.Replace; 84 | } 85 | 86 | private void radioButtonNormalsCopyNear_CheckedChanged(object sender, EventArgs e) 87 | { 88 | NormalsMethod = CopyMeshMethod.CopyNear; 89 | } 90 | 91 | private void radioButtonNormalsCopyOrder_CheckedChanged(object sender, EventArgs e) 92 | { 93 | NormalsMethod = CopyMeshMethod.CopyOrder; 94 | } 95 | 96 | private void radioButtonBonesReplace_CheckedChanged(object sender, EventArgs e) 97 | { 98 | BonesMethod = CopyMeshMethod.Replace; 99 | } 100 | 101 | private void radioButtonBonesCopyNear_CheckedChanged(object sender, EventArgs e) 102 | { 103 | BonesMethod = CopyMeshMethod.CopyNear; 104 | } 105 | 106 | private void radioButtonBonesCopyOrder_CheckedChanged(object sender, EventArgs e) 107 | { 108 | BonesMethod = CopyMeshMethod.CopyOrder; 109 | } 110 | } 111 | } 112 | --------------------------------------------------------------------------------