diff --git a/OGF tool/Forms/OgfEditor.Designer.cs b/OGF tool/Forms/OgfEditor.Designer.cs index c59ff23..4b0056c 100644 --- a/OGF tool/Forms/OgfEditor.Designer.cs +++ b/OGF tool/Forms/OgfEditor.Designer.cs @@ -108,6 +108,7 @@ private void InitializeComponent() this.ToolsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OpenInObjectEditor = new System.Windows.Forms.ToolStripMenuItem(); this.importDataFromModelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.recalcNormalsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.converterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nPCCoPToSoCToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nPCSoCToCoPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -118,6 +119,7 @@ private void InitializeComponent() this.reloadToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.disableAlphaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openImageFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.DisableTexturesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FileLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusFile = new System.Windows.Forms.ToolStripStatusLabel(); this.StatusPanel = new System.Windows.Forms.StatusStrip(); @@ -132,7 +134,6 @@ private void InitializeComponent() this.SaveObjectDialog = new System.Windows.Forms.SaveFileDialog(); this.LabelBroken = new System.Windows.Forms.Label(); this.SaveObjDialog = new System.Windows.Forms.SaveFileDialog(); - this.recalcNormalsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.TabControl.SuspendLayout(); this.TexturesPage.SuspendLayout(); this.TextureContextStrip.SuspendLayout(); @@ -677,6 +678,12 @@ private void InitializeComponent() resources.ApplyResources(this.importDataFromModelToolStripMenuItem, "importDataFromModelToolStripMenuItem"); this.importDataFromModelToolStripMenuItem.Click += new System.EventHandler(this.importDataFromModelToolStripMenuItem_Click); // + // recalcNormalsToolStripMenuItem + // + this.recalcNormalsToolStripMenuItem.Name = "recalcNormalsToolStripMenuItem"; + resources.ApplyResources(this.recalcNormalsToolStripMenuItem, "recalcNormalsToolStripMenuItem"); + this.recalcNormalsToolStripMenuItem.Click += new System.EventHandler(this.recalcNormalsToolStripMenuItem_Click); + // // converterToolStripMenuItem // this.converterToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -719,6 +726,7 @@ private void InitializeComponent() // this.viewPortToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.reloadToolStripMenuItem1, + this.DisableTexturesMenuItem, this.disableAlphaToolStripMenuItem, this.openImageFolderToolStripMenuItem}); this.viewPortToolStripMenuItem.Name = "viewPortToolStripMenuItem"; @@ -742,6 +750,12 @@ private void InitializeComponent() resources.ApplyResources(this.openImageFolderToolStripMenuItem, "openImageFolderToolStripMenuItem"); this.openImageFolderToolStripMenuItem.Click += new System.EventHandler(this.openImageFolderToolStripMenuItem_Click); // + // DisableTexturesMenuItem + // + this.DisableTexturesMenuItem.Name = "DisableTexturesMenuItem"; + resources.ApplyResources(this.DisableTexturesMenuItem, "DisableTexturesMenuItem"); + this.DisableTexturesMenuItem.Click += new System.EventHandler(this.DisableTexturesMenuItem_Click); + // // FileLabel // this.FileLabel.Name = "FileLabel"; @@ -808,12 +822,6 @@ private void InitializeComponent() // resources.ApplyResources(this.SaveObjDialog, "SaveObjDialog"); // - // recalcNormalsToolStripMenuItem - // - this.recalcNormalsToolStripMenuItem.Name = "recalcNormalsToolStripMenuItem"; - resources.ApplyResources(this.recalcNormalsToolStripMenuItem, "recalcNormalsToolStripMenuItem"); - this.recalcNormalsToolStripMenuItem.Click += new System.EventHandler(this.recalcNormalsToolStripMenuItem_Click); - // // OGF_Editor // this.AllowDrop = true; @@ -959,6 +967,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem LodMenuItem; private System.Windows.Forms.ToolStripMenuItem AddMeshesMenuItem; private System.Windows.Forms.ToolStripMenuItem recalcNormalsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem DisableTexturesMenuItem; } } diff --git a/OGF tool/Forms/OgfEditor.cs b/OGF tool/Forms/OgfEditor.cs index e49b0ca..a28642e 100644 --- a/OGF tool/Forms/OgfEditor.cs +++ b/OGF tool/Forms/OgfEditor.cs @@ -38,6 +38,7 @@ public partial class OGF_Editor : Form public bool ViewerWorking = false; public Thread ViewerThread = null; bool ViewPortAlpha = true; + bool ViewPortTextures = true; List OldChildVisible = new List(); List OldChildTextures = new List(); @@ -891,7 +892,7 @@ private void SaveAsObj(string filename, float lod) } } - private void SaveMtl(string filename) + private void SaveMtl(string filename, bool with_texture = true) { using (StreamWriter writer = File.CreateText(filename)) { @@ -903,7 +904,8 @@ private void SaveMtl(string filename) writer.WriteLine("Ka 0 0 0"); writer.WriteLine("Kd 1 1 1"); writer.WriteLine("Ks 0 0 0"); - writer.WriteLine("map_Kd " + Path.GetFileName(ch.m_texture) + ".png\n"); + if (with_texture) + writer.WriteLine("map_Kd " + Path.GetFileName(ch.m_texture) + ".png\n"); } writer.Close(); } @@ -2389,7 +2391,22 @@ private void disableAlphaToolStripMenuItem_Click(object sender, EventArgs e) InitViewPort(false, true, true); } - private void SetAlphaToolStrip(bool enable) + private void DisableTexturesMenuItem_Click(object sender, EventArgs e) + { + ViewPortTextures = !ViewPortTextures; + + string mtl_name = TempFolder() + "\\" + Path.GetFileName(Path.ChangeExtension(FILE_NAME, ".mtl")); + SaveMtl(mtl_name, ViewPortTextures); + + if (!ViewPortTextures) + DisableTexturesMenuItem.Text = "Enable Textures"; + else + DisableTexturesMenuItem.Text = "Disable Textures"; + + InitViewPort(false, false, true); + } + + private void SetAlphaToolStrip(bool enable) { ViewPortAlpha = enable; if (ViewPortAlpha) diff --git a/OGF tool/Forms/OgfEditor.resx b/OGF tool/Forms/OgfEditor.resx index 4852341..bd4743b 100644 --- a/OGF tool/Forms/OgfEditor.resx +++ b/OGF tool/Forms/OgfEditor.resx @@ -427,13 +427,13 @@ 0 - 180, 22 + 169, 22 Add meshes - 180, 22 + 169, 22 Change lod factor @@ -2151,30 +2151,6 @@ File - - 188, 22 - - - Open in Object Editor - - - 188, 22 - - - Import OGF Params - - - 188, 22 - - - Recalc Normals - - - 188, 22 - - - Converter - 46, 20 @@ -2199,6 +2175,30 @@ Model Format: None + + 180, 22 + + + Reload + + + 180, 22 + + + Disable Textures + + + 180, 22 + + + Disable Alpha + + + 180, 22 + + + Open image folder + 66, 20 @@ -2313,6 +2313,30 @@ Exit + + 188, 22 + + + Open in Object Editor + + + 188, 22 + + + Import OGF Params + + + 188, 22 + + + Recalc Normals + + + 188, 22 + + + Converter + 161, 22 @@ -2325,24 +2349,6 @@ NPC SoC to CoP - - 173, 22 - - - Reload - - - 173, 22 - - - Disable Alpha - - - 173, 22 - - - Open image folder - 28, 17 @@ -2942,6 +2948,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + recalcNormalsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + converterToolStripMenuItem @@ -3002,6 +3014,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + DisableTexturesMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + FileLabel @@ -3068,12 +3086,6 @@ System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - recalcNormalsToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - OGF_Editor