1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Add option to edit textures in default program and save back.

This commit is contained in:
KillzXGaming 2019-04-29 14:42:52 -04:00
parent 725e2f5681
commit c03e90d331
24 changed files with 327 additions and 63 deletions

Binary file not shown.

View File

@ -514,7 +514,7 @@ namespace Bfres.Structs
if (setting.DataBlockOutput != null)
{
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
var tex = ftex.FromGx2Surface(surface, setting);
var tex = ftex.FromGx2Surface(surface, setting.TexName);
ftex.UpdateTex(tex);
ftex.IsEdited = true;
@ -570,7 +570,7 @@ namespace Bfres.Structs
FTEX ftex = new FTEX();
ftex.texture = new ResU.Texture();
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
var tex = ftex.FromGx2Surface(surface, setting);
var tex = ftex.FromGx2Surface(surface, setting.TexName);
ftex.UpdateTex(tex);
ftex.IsEdited = true;
@ -646,7 +646,7 @@ namespace Bfres.Structs
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
FTEX ftex = new FTEX();
ftex.texture = new ResU.Texture();
ftex.texture = ftex.FromGx2Surface(surface, setting);
ftex.texture = ftex.FromGx2Surface(surface, setting.TexName);
ftex.IsEdited = true;
ftex.Read(ftex.texture);

View File

@ -541,8 +541,8 @@ namespace Bfres.Structs
Text = text;
textureMap = texture;
ImageKey = "texture";
SelectedImageKey = "texture";
ImageKey = "TextureMaterialMap";
SelectedImageKey = "TextureMaterialMap";
}
public override void OnClick(TreeView treeView)

View File

@ -54,7 +54,7 @@ namespace Bfres.Structs
bool IsReplaced = false;
public override bool CanEdit { get; set; } = false;
public override bool CanEdit { get; set; } = true;
public int format;
public Texture texture;
@ -159,7 +159,7 @@ namespace Bfres.Structs
if (setting.DataBlockOutput != null)
{
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
var tex = FromGx2Surface(surface, setting);
var tex = FromGx2Surface(surface, setting.TexName);
UpdateTex(tex);
texture.Name = Text;
@ -229,7 +229,7 @@ namespace Bfres.Structs
if (setting.DataBlockOutput != null)
{
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
var tex = FromGx2Surface(surface, setting);
var tex = FromGx2Surface(surface, setting.TexName);
UpdateTex(tex);
texture.Name = Text;
IsReplaced = true;
@ -252,7 +252,7 @@ namespace Bfres.Structs
if (setting.DataBlockOutput != null)
{
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
var tex = FromGx2Surface(surface, setting);
var tex = FromGx2Surface(surface, setting.TexName);
UpdateTex(tex);
texture.Name = Text;
IsReplaced = true;
@ -305,10 +305,10 @@ namespace Bfres.Structs
}
//We reuse GX2 data as it's the same thing
public Texture FromGx2Surface(GX2.GX2Surface surf, GTXImporterSettings settings)
public Texture FromGx2Surface(GX2.GX2Surface surf, string Name)
{
Texture tex = new Texture();
tex.Name = settings.TexName;
tex.Name = Name;
tex.Path = "";
tex.AAMode = (GX2AAMode)surf.aa;
tex.Alignment = (uint)surf.alignment;
@ -350,7 +350,6 @@ namespace Bfres.Structs
{
CanReplace = true;
CanDelete = true;
CanEdit = false;
CanExport = true;
ImageKey = "Texture";
@ -383,7 +382,53 @@ namespace Bfres.Structs
public override void SetImageData(Bitmap bitmap, int ArrayLevel)
{
throw new NotImplementedException("Cannot set image data! Operation not implemented!");
if (bitmap == null)
return; //Image is likely disposed and not needed to be applied
texture.Format = ConvertToGx2Format(Format);
texture.Width = (uint)bitmap.Width;
texture.Height = (uint)bitmap.Height;
if (MipCount != 1)
{
MipCount = GenerateMipCount(bitmap.Width, bitmap.Height);
if (MipCount == 0)
MipCount = 1;
}
texture.MipCount = MipCount;
texture.MipOffsets = new uint[MipCount];
try
{
//Create image block from bitmap first
var data = GenerateMipsAndCompress(bitmap, Format);
//Swizzle and create surface
var surface = GX2.CreateGx2Texture(data, Text,
(uint)texture.TileMode,
(uint)texture.AAMode,
(uint)texture.Width,
(uint)texture.Height,
(uint)texture.Depth,
(uint)texture.Format,
(uint)texture.Swizzle,
(uint)texture.Dim,
(uint)texture.MipCount
);
var tex = FromGx2Surface(surface, texture.Name);
UpdateTex(tex);
IsEdited = true;
Read(texture);
LoadOpenGLTexture();
LibraryGUI.Instance.UpdateViewport();
}
catch (Exception ex)
{
STErrorDialog.Show("Failed to swizzle and compress image " + Text, "Error", ex.ToString());
}
}
ResFile ResFileTexture2;

View File

@ -367,6 +367,7 @@ namespace FirstPlugin
Nodes.Add(setting.textureData);
Textures.Add(setting.textureData.Text, setting.textureData);
setting.textureData.LoadOpenGLTexture();
LibraryGUI.Instance.UpdateViewport();
}
else
{
@ -802,7 +803,6 @@ namespace FirstPlugin
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Rename", null, Rename, Keys.Control | Keys.N));
ContextMenuStrip.Items.Add(new ToolStripSeparator());
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Delete", null, Remove, Keys.Control | Keys.Delete));
// LoadOpenGLTexture();
}
public static SurfaceFormat GenericToBntxSurfaceFormat(TEX_FORMAT texFormat)
{
@ -1160,7 +1160,6 @@ namespace FirstPlugin
Texture.MipCount = MipCount;
Texture.MipOffsets = new long[MipCount];
try
{
Texture.TextureData[ArrayLevel].Clear(); //Clear previous mip maps
@ -1173,13 +1172,14 @@ namespace FirstPlugin
//Combine mip map data
byte[] combinedMips = Utils.CombineByteArray(mipmaps.ToArray());
Texture.TextureData[ArrayLevel][0] = combinedMips;
LoadOpenGLTexture();
LibraryGUI.Instance.UpdateViewport();
}
catch (Exception ex)
{
STErrorDialog.Show("Failed to swizzle and compress image " + Text, "Error", ex.ToString());
}
}
public override byte[] GetImageData(int ArrayLevel = 0, int MipLevel = 0)

View File

@ -107,6 +107,7 @@ namespace Switch_Toolbox.Library
imgList.Images.Add("material", Properties.Resources.materialSphere);
imgList.Images.Add("model", Properties.Resources.model);
imgList.Images.Add("folder", Properties.Resources.skeleton);
imgList.Images.Add("TextureMaterialMap", Properties.Resources.TextureMaterialMap);
//Data types
imgList.Images.Add("bool", Properties.Resources.IconBool);

View File

@ -37,6 +37,7 @@
this.pictureBoxCustom1 = new Switch_Toolbox.Library.Forms.PictureBoxCustom();
this.blueChannelBtn = new Switch_Toolbox.Library.Forms.STButton();
this.stPanel3 = new Switch_Toolbox.Library.Forms.STPanel();
this.editBtn = new Switch_Toolbox.Library.Forms.STButton();
this.toggleAlphaChk = new Switch_Toolbox.Library.Forms.STCheckBox();
this.saveBtn = new Switch_Toolbox.Library.Forms.STButton();
this.arrayLevelCounterLabel = new Switch_Toolbox.Library.Forms.STLabel();
@ -55,6 +56,7 @@
this.propertyGridToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.displayVerticalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editInExternalProgramToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.resizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.reEncodeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.flipHorizontalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -170,6 +172,7 @@
//
// stPanel3
//
this.stPanel3.Controls.Add(this.editBtn);
this.stPanel3.Controls.Add(this.toggleAlphaChk);
this.stPanel3.Controls.Add(this.saveBtn);
this.stPanel3.Controls.Add(this.arrayLevelCounterLabel);
@ -183,12 +186,27 @@
this.stPanel3.Size = new System.Drawing.Size(715, 51);
this.stPanel3.TabIndex = 3;
//
// editBtn
//
this.editBtn.BackColor = System.Drawing.Color.Transparent;
this.editBtn.BackgroundImage = global::Switch_Toolbox.Library.Properties.Resources.Edit;
this.editBtn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.editBtn.Enabled = false;
this.editBtn.FlatAppearance.BorderSize = 0;
this.editBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.editBtn.Location = new System.Drawing.Point(40, 3);
this.editBtn.Name = "editBtn";
this.editBtn.Size = new System.Drawing.Size(24, 23);
this.editBtn.TabIndex = 16;
this.editBtn.UseVisualStyleBackColor = false;
this.editBtn.Click += new System.EventHandler(this.editBtn_Click);
//
// toggleAlphaChk
//
this.toggleAlphaChk.AutoSize = true;
this.toggleAlphaChk.Checked = true;
this.toggleAlphaChk.CheckState = System.Windows.Forms.CheckState.Checked;
this.toggleAlphaChk.Location = new System.Drawing.Point(50, 7);
this.toggleAlphaChk.Location = new System.Drawing.Point(85, 7);
this.toggleAlphaChk.Name = "toggleAlphaChk";
this.toggleAlphaChk.Size = new System.Drawing.Size(83, 17);
this.toggleAlphaChk.TabIndex = 15;
@ -354,7 +372,7 @@
this.propertyGridToolStripMenuItem.CheckOnClick = true;
this.propertyGridToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.propertyGridToolStripMenuItem.Name = "propertyGridToolStripMenuItem";
this.propertyGridToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.propertyGridToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
this.propertyGridToolStripMenuItem.Text = "Property Grid";
this.propertyGridToolStripMenuItem.CheckedChanged += new System.EventHandler(this.propertyGridToolStripMenuItem_CheckedChanged);
this.propertyGridToolStripMenuItem.Click += new System.EventHandler(this.propertyGridToolStripMenuItem_Click);
@ -362,7 +380,7 @@
// displayVerticalToolStripMenuItem
//
this.displayVerticalToolStripMenuItem.Name = "displayVerticalToolStripMenuItem";
this.displayVerticalToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.displayVerticalToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
this.displayVerticalToolStripMenuItem.Text = "Display Vertical";
this.displayVerticalToolStripMenuItem.CheckedChanged += new System.EventHandler(this.displayVerticalToolStripMenuItem_CheckedChanged);
this.displayVerticalToolStripMenuItem.Click += new System.EventHandler(this.displayVerticalToolStripMenuItem_Click);
@ -370,6 +388,7 @@
// imageToolStripMenuItem
//
this.imageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.editInExternalProgramToolStripMenuItem,
this.resizeToolStripMenuItem,
this.reEncodeToolStripMenuItem,
this.flipHorizontalToolStripMenuItem,
@ -381,6 +400,13 @@
this.imageToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.imageToolStripMenuItem.Text = "Image";
//
// editInExternalProgramToolStripMenuItem
//
this.editInExternalProgramToolStripMenuItem.Name = "editInExternalProgramToolStripMenuItem";
this.editInExternalProgramToolStripMenuItem.Size = new System.Drawing.Size(230, 22);
this.editInExternalProgramToolStripMenuItem.Text = "Edit In External Program";
this.editInExternalProgramToolStripMenuItem.Click += new System.EventHandler(this.editInExternalProgramToolStripMenuItem_Click);
//
// resizeToolStripMenuItem
//
this.resizeToolStripMenuItem.Name = "resizeToolStripMenuItem";
@ -513,5 +539,7 @@
private System.Windows.Forms.ToolStripMenuItem reEncodeToolStripMenuItem;
private STCheckBox toggleAlphaChk;
private System.Windows.Forms.ToolStripMenuItem displayVerticalToolStripMenuItem;
private STButton editBtn;
private System.Windows.Forms.ToolStripMenuItem editInExternalProgramToolStripMenuItem;
}
}

View File

@ -7,11 +7,16 @@ using System.Linq;
using System.Activities.Statements;
using System.Threading;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Diagnostics;
namespace Switch_Toolbox.Library.Forms
{
public partial class ImageEditorBase : UserControl
{
public FileSystemWatcher FileWatcher;
private Thread Thread;
int CurMipDisplayLevel = 0;
@ -21,6 +26,7 @@ namespace Switch_Toolbox.Library.Forms
public STGenericTexture ActiveTexture;
public bool PropertyShowTop = false;
public bool CanModify = true;
//Instead of disabling/enabling channels, this will only show the selected channel
public bool UseChannelToggle = false;
@ -104,6 +110,7 @@ namespace Switch_Toolbox.Library.Forms
imageToolStripMenuItem.Enabled = false;
adjustmentsToolStripMenuItem.Enabled = false;
editBtn.BackgroundImage = BitmapExtension.GrayScale(Properties.Resources.Edit);
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
imageBGComboBox.Items.Add(type);
@ -128,6 +135,18 @@ namespace Switch_Toolbox.Library.Forms
LoadChannelEditor(null);
OnDataAcquiredEvent += new DataAcquired(ThreadReportsDataAquiredEvent);
SetUpFileSystemWatcher();
}
private void SetUpFileSystemWatcher()
{
FileWatcher = new FileSystemWatcher();
FileWatcher.Path = Path.GetTempPath();
FileWatcher.NotifyFilter = NotifyFilters.Size | NotifyFilters.LastAccess | NotifyFilters.LastWrite;
FileWatcher.EnableRaisingEvents = false;
FileWatcher.Changed += new FileSystemEventHandler(OnFileWatcherChanged);
FileWatcher.Filter = "";
}
public void SetEditorOrientation(bool ToVertical)
@ -155,9 +174,19 @@ namespace Switch_Toolbox.Library.Forms
}
public void LoadProperties(object prop) => propertiesEditor.LoadProperties(prop);
public void LoadImage(STGenericTexture texture)
{
editBtn.Enabled = false;
//Disable the file watcher when an image is switched
FileWatcher.EnableRaisingEvents = false;
FileWatcher.Filter = "";
UpdateImage(texture);
}
private void UpdateImage(STGenericTexture texture)
{
ResetChannelEditor();
@ -170,6 +199,17 @@ namespace Switch_Toolbox.Library.Forms
}
ActiveTexture = texture;
if (ActiveTexture.CanEdit)
{
editBtn.Enabled = true;
editBtn.BackgroundImage = Properties.Resources.Edit;
}
else
{
editBtn.BackgroundImage = BitmapExtension.GrayScale(Properties.Resources.Edit);
}
CurMipDisplayLevel = 0;
CurArrayDisplayLevel = 0;
hasBeenEdited = false;
@ -770,5 +810,90 @@ namespace Switch_Toolbox.Library.Forms
splitContainer1.SplitterDistance = this.Height / 2;
}
private void editBtn_Click(object sender, EventArgs e) {
EditInExternalProgram();
}
private void editInExternalProgramToolStripMenuItem_Click(object sender, EventArgs e) {
EditInExternalProgram();
}
private void EditInExternalProgram(bool UseDefaultEditor = true)
{
if (!ActiveTexture.CanEdit)
return;
string UseExtension = ".dds";
string TemporaryName = Path.GetTempFileName();
Utils.DeleteIfExists(Path.ChangeExtension(TemporaryName, UseExtension));
File.Move(TemporaryName, Path.ChangeExtension(TemporaryName, UseExtension));
TemporaryName = Path.ChangeExtension(TemporaryName, ".dds");
ActiveTexture.SaveDDS(TemporaryName);
if (UseDefaultEditor)
Process.Start(TemporaryName);
else
ShowOpenWithDialog(TemporaryName);
FileWatcher.Filter = Path.GetFileName(TemporaryName);
//Start watching for changes
FileWatcher.EnableRaisingEvents = true;
}
public static Process ShowOpenWithDialog(string path)
{
var args = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "shell32.dll");
args += ",OpenAs_RunDLL " + path;
return Process.Start("rundll32.exe", args);
}
private void OnFileWatcherChanged(object sender, FileSystemEventArgs e)
{
string FileName = e.FullPath;
Console.WriteLine("File: " + e.FullPath + " " + e.ChangeType);
var Result = MessageBox.Show("Texture has been modifed in external program! Would you like to apply the edits?", "Texture Editor",
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
if (Result == DialogResult.Yes)
{
if (FileName.EndsWith(".dds"))
{
DDS dds = new DDS(FileName);
SaveAndApplyImage(dds.GetBitmap());
}
else
{
SaveAndApplyImage(new Bitmap(FileName));
}
}
else
{
FileWatcher.Filter = "";
FileWatcher.EnableRaisingEvents = false;
}
}
private void SaveAndApplyImage(Bitmap image)
{
if (saveBtn.InvokeRequired)
{
saveBtn.Invoke(new MethodInvoker(
delegate ()
{
UpdateEdit(image);
ApplyEdit();
}));
}
else
{
UpdateEdit(image);
ApplyEdit();
}
}
}
}

View File

@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="stContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -328,6 +325,9 @@
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="stContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>

View File

@ -68,12 +68,36 @@ namespace Switch_Toolbox.Library.Forms
public void LoadProperties(object prop)
{
stPropertyGrid1.LoadProperty(prop, OnPropertyChanged);
stPropertyGrid1.Refresh();
if (stPropertyGrid1.InvokeRequired)
{
stPropertyGrid1.Invoke(new MethodInvoker(
delegate ()
{
stPropertyGrid1.LoadProperty(prop, OnPropertyChanged);
stPropertyGrid1.Refresh();
}));
}
else
{
stPropertyGrid1.LoadProperty(prop, OnPropertyChanged);
stPropertyGrid1.Refresh();
}
}
public void UpdateProperties()
{
if (stPropertyGrid1.InvokeRequired)
{
stPropertyGrid1.Invoke(new MethodInvoker(
delegate ()
{
stPropertyGrid1.Refresh();
}));
}
else
stPropertyGrid1.Refresh();
}
public void UpdateProperties() => stPropertyGrid1.Refresh();
public void OnPropertyChanged() { }

View File

@ -297,10 +297,12 @@ namespace Switch_Toolbox.Library
return true;
}
public static bool GrayScale(Bitmap b)
public static Bitmap GrayScale(Image b) { return GrayScale(new Bitmap(b));
}
public static Bitmap GrayScale(Bitmap b)
{
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
@ -308,9 +310,9 @@ namespace Switch_Toolbox.Library
{
byte* p = (byte*)(void*)Scan0;
int nOffset = stride - b.Width * 3;
int nOffset = stride - b.Width * 4;
byte red, green, blue;
byte red, green, blue, alpha;
for (int y = 0; y < b.Height; ++y)
{
@ -319,12 +321,13 @@ namespace Switch_Toolbox.Library
blue = p[0];
green = p[1];
red = p[2];
alpha = p[3];
p[0] = p[1] = p[2] = (byte)(.299 * red
+ .587 * green
+ .114 * blue);
p += 3;
p += 4;
}
p += nOffset;
}
@ -332,7 +335,7 @@ namespace Switch_Toolbox.Library
b.UnlockBits(bmData);
return true;
return b;
}
public static bool Invert(Bitmap b)
{

View File

@ -290,6 +290,16 @@ namespace Switch_Toolbox.Library.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Edit {
get {
object obj = ResourceManager.GetObject("Edit", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -820,6 +830,16 @@ namespace Switch_Toolbox.Library.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap TextureMaterialMap {
get {
object obj = ResourceManager.GetObject("TextureMaterialMap", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -160,20 +160,23 @@
<data name="ErrorCheck" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ErrorCheck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="minimize_sele1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize_sele.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Bfres" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Bfres.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Bone" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Bone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="diffuseSphere" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\diffuseSphere.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="boneWeightGradient2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\boneWeightGradient2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="maximize_sele1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\maximize_sele.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="diffuseSphere" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\diffuseSphere.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="IconCurve" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconCurve.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="skeleton" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\skeleton.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -187,9 +190,6 @@
<data name="mesh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\mesh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconVec3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconVec3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowL" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -211,9 +211,6 @@
<data name="DefaultTexture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DefaultTexture.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PauseBtn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Playback\PauseBtn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Byaml" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Byaml.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -226,6 +223,9 @@
<data name="model" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\model.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="skeletonAnimation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\skeletonAnimation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconFloat" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconFloat.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -235,18 +235,15 @@
<data name="specularSDR" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Cubemaps\specularSDR.dds;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="InjectTexErrored" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\InjectTexErrored.dds;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="normalsSphere" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\normalsSphere.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FileBlank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FileBank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="boneWeightGradient" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\boneWeightGradient.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowMinimize " type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowMinimize .png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconList" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconList.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -268,6 +265,9 @@
<data name="normalMapSphere" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\normalMapSphere.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Aamp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Aamp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Texture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Texture.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -283,11 +283,20 @@
<data name="NumbericUpDownArrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\NumbericUpDownArrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TextureMaterialMap" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TextureMaterialMap.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="minimize_sele1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize_sele.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="minimize_sele" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Forms\Toolbar\images\minimize_sele.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Aamp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Aamp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="IconVec3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconVec3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="QuestionCheck" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\QuestionCheck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -301,11 +310,8 @@
<data name="LoadingImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LoadingImage.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Bfres" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Bfres.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IconCurve" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\DataTyypes\IconCurve.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="InjectTexErrored" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\InjectTexErrored.dds;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Bnsh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Bnsh.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -322,8 +328,8 @@
<data name="CheckerBackground" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CheckerBackground.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="skeletonAnimation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\skeletonAnimation.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="arrowMinimize " type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowMinimize .png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UVPattern" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UVPattern.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -334,8 +340,8 @@
<data name="ResetArrowR" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Playback\ResetArrowR.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FileBlank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FileBank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="PauseBtn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Playback\PauseBtn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Hovered" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CheckBox\Hovered.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -349,7 +355,7 @@
<data name="minimize1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minimize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="QuestionCheck" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\QuestionCheck.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Edit" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -996,6 +996,12 @@
<ItemGroup>
<None Include="Resources\QuestionCheck.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\TextureMaterialMap.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Edit.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>

View File

@ -36,6 +36,12 @@ namespace Switch_Toolbox.Library
color.A.ToString("X2");
}
public static void DeleteIfExists(string FilePath)
{
if (File.Exists(FilePath))
File.Delete(FilePath);
}
public static Color HexToColor(string HexText)
{
try