1
0
mirror of synced 2024-11-28 01:10:51 +01:00

Many more texture pattern editor improvements

This commit is contained in:
KillzXGaming 2019-07-09 20:13:39 -04:00
parent 3bf760a445
commit ca5d0316c9
10 changed files with 239 additions and 105 deletions

Binary file not shown.

View File

@ -477,32 +477,6 @@ namespace Bfres.Structs
Text = Name;
}
public void AddKeyFrame(string TextureName, float Frame = -1, bool IsConstant = false)
{
Constant = IsConstant;
var MatAnim = MatAnimWrapper.MaterialAnim;
//Add the texture if it does not exist for both wrapper and bfres itself
if (!MatAnim.TextureNames.Contains(TextureName))
MatAnim.TextureNames.Add(TextureName);
if (!MatAnimWrapper.Textures.Contains(TextureName))
MatAnimWrapper.Textures.Add(TextureName);
//Set our index
int index = MatAnimWrapper.Textures.IndexOf(TextureName);
if (Frame == -1)
{
Frame = EndFrame + 1; //Add to the end of the list by default
}
//For non constants we load a curve
if (!Constant)
{
}
}
private AnimCurve CreateAnimCurve()
{
//Create empty curve

View File

@ -74,6 +74,8 @@
this.btnBackward1 = new Switch_Toolbox.Library.Forms.STButton();
this.stMenuStrip1 = new Switch_Toolbox.Library.Forms.STMenuStrip();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.adjustmentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -209,7 +211,7 @@
this.addKeyFrameToolstrip.Image = global::FirstPlugin.Properties.Resources.AddIcon;
this.addKeyFrameToolstrip.ImageTransparentColor = System.Drawing.Color.Magenta;
this.addKeyFrameToolstrip.Name = "addKeyFrameToolstrip";
this.addKeyFrameToolstrip.Size = new System.Drawing.Size(29, 20);
this.addKeyFrameToolstrip.Size = new System.Drawing.Size(21, 20);
this.addKeyFrameToolstrip.Text = "Add Frame";
this.addKeyFrameToolstrip.Click += new System.EventHandler(this.addKeyFrameToolstrip_Click);
//
@ -219,7 +221,7 @@
this.removeKeyFrameToolstrip.Image = global::FirstPlugin.Properties.Resources.RemoveIcon;
this.removeKeyFrameToolstrip.ImageTransparentColor = System.Drawing.Color.Magenta;
this.removeKeyFrameToolstrip.Name = "removeKeyFrameToolstrip";
this.removeKeyFrameToolstrip.Size = new System.Drawing.Size(29, 20);
this.removeKeyFrameToolstrip.Size = new System.Drawing.Size(21, 20);
this.removeKeyFrameToolstrip.Text = "Remove Frame";
this.removeKeyFrameToolstrip.Click += new System.EventHandler(this.removeKeyFrameToolstrip_Click);
//
@ -229,7 +231,7 @@
this.toolstripShiftUp.Image = global::FirstPlugin.Properties.Resources.ArrowIcon;
this.toolstripShiftUp.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolstripShiftUp.Name = "toolstripShiftUp";
this.toolstripShiftUp.Size = new System.Drawing.Size(29, 20);
this.toolstripShiftUp.Size = new System.Drawing.Size(21, 20);
this.toolstripShiftUp.Text = "Move Up";
this.toolstripShiftUp.Click += new System.EventHandler(this.toolstripShiftUp_Click);
//
@ -239,7 +241,7 @@
this.toolstripShiftDown.Image = global::FirstPlugin.Properties.Resources.ArrowIcon;
this.toolstripShiftDown.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolstripShiftDown.Name = "toolstripShiftDown";
this.toolstripShiftDown.Size = new System.Drawing.Size(29, 20);
this.toolstripShiftDown.Size = new System.Drawing.Size(21, 20);
this.toolstripShiftDown.Text = "Move Down";
this.toolstripShiftDown.Click += new System.EventHandler(this.toolstripShiftDown_Click);
//
@ -279,6 +281,7 @@
//
// stLabel4
//
this.stLabel4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.stLabel4.AutoSize = true;
this.stLabel4.Location = new System.Drawing.Point(6, 447);
this.stLabel4.Name = "stLabel4";
@ -288,6 +291,7 @@
//
// textureFrameUD
//
this.textureFrameUD.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.textureFrameUD.Location = new System.Drawing.Point(77, 445);
this.textureFrameUD.Maximum = new decimal(new int[] {
2147483647,
@ -301,6 +305,7 @@
//
// stLabel1
//
this.stLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.stLabel1.AutoSize = true;
this.stLabel1.Location = new System.Drawing.Point(6, 478);
this.stLabel1.Name = "stLabel1";
@ -310,7 +315,7 @@
//
// treeView1
//
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.treeView1.Location = new System.Drawing.Point(6, 494);
this.treeView1.Name = "treeView1";
@ -446,7 +451,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(16, 58);
this.pictureBoxCustom1.Location = new System.Drawing.Point(16, 63);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
this.pictureBoxCustom1.Size = new System.Drawing.Size(776, 514);
this.pictureBoxCustom1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
@ -619,10 +624,28 @@
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exportToolStripMenuItem,
this.replaceToolStripMenuItem});
this.editToolStripMenuItem.Enabled = false;
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.exportToolStripMenuItem.Text = "Export";
this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click);
//
// replaceToolStripMenuItem
//
this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem";
this.replaceToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.replaceToolStripMenuItem.Text = "Replace";
this.replaceToolStripMenuItem.Click += new System.EventHandler(this.replaceToolStripMenuItem_Click);
//
// viewToolStripMenuItem
//
this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
@ -748,5 +771,7 @@
private Switch_Toolbox.Library.Forms.STLabel stLabel5;
private Switch_Toolbox.Library.Forms.STComboBox activeAnimCB;
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem replaceToolStripMenuItem;
}
}

View File

@ -10,6 +10,7 @@ using System.Threading;
using System.Windows.Forms;
using Switch_Toolbox.Library.Animations;
using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library;
using Bfres.Structs;
namespace FirstPlugin.Forms
@ -63,11 +64,10 @@ namespace FirstPlugin.Forms
toolstripShiftUp.Image.RotateFlip(RotateFlipType.RotateNoneFlipY);
backgroundCB.Items.Add("Checkerboard");
backgroundCB.Items.Add("Black");
backgroundCB.Items.Add("White");
foreach (var type in Enum.GetValues(typeof(Runtime.PictureBoxBG)).Cast<Runtime.PictureBoxBG>())
backgroundCB.Items.Add(type);
backgroundCB.SelectedIndex = 0;
backgroundCB.SelectedItem = Runtime.pictureBoxStyle;
MaterialAnimations = new List<MaterialAnimation>();
foreach (TreeNode matAnim in materialAnimations)
@ -77,9 +77,7 @@ namespace FirstPlugin.Forms
}
}
FMAA.BfresSamplerAnim activeSampler;
FTXP.BfresSamplerAnim activeSampleU;
MaterialAnimation.SamplerKeyGroup activeSampler;
MaterialAnimation _activeMaterialAnim;
MaterialAnimation ActiveMaterialAnim
@ -153,13 +151,12 @@ namespace FirstPlugin.Forms
private void ReloadAnimationView()
{
editToolStripMenuItem.Enabled = false;
listViewCustom1.SuspendLayout();
listViewCustom1.Items.Clear();
if (activeSampleU != null)
LoadAniamtion(ActiveMaterialAnim, activeSampleU);
else
LoadAniamtion(ActiveMaterialAnim, activeSampler);
LoadAniamtion(ActiveMaterialAnim, activeSampler);
listViewCustom1.ResumeLayout();
@ -167,6 +164,8 @@ namespace FirstPlugin.Forms
{
listViewCustom1.Items[0].Selected = true;
listViewCustom1.Select();
editToolStripMenuItem.Enabled = true;
}
}
@ -372,18 +371,6 @@ namespace FirstPlugin.Forms
pictureBoxCustom1.Image = Images[Frame];
}
}
if (activeSampleU != null)
{
var keyFrame = activeSampleU.GetKeyFrame(Frame);
var tex = activeSampleU.GetActiveTexture((int)keyFrame.Value);
if (tex != null)
{
if (Images.ContainsKey(Frame))
pictureBoxCustom1.Image = Images[Frame];
}
}
}
private void currentFrameCounterUD_ValueChanged(object sender, EventArgs e)
@ -398,10 +385,14 @@ namespace FirstPlugin.Forms
{
if (listViewCustom1.SelectedItems.Count > 0 && KeyFrames.Count > 0)
{
editToolStripMenuItem.Enabled = true;
int SelectedFrame = KeyFrames[listViewCustom1.SelectedIndices[0]];
animationTrackBar.Value = SelectedFrame;
textureFrameUD.Value = SelectedFrame;
}
else
editToolStripMenuItem.Enabled = false;
}
private void animationTrackBar_Scroll(object sender, ScrollEventArgs e)
@ -437,8 +428,10 @@ namespace FirstPlugin.Forms
private void btnAdd_Click(object sender, EventArgs e)
{
bool IsWiiU = activeSampler is FTXP.BfresSamplerAnim;
Texture_Selector editor = new Texture_Selector();
editor.LoadTexture("", activeSampleU != null);
editor.LoadTexture("", IsWiiU);
if (editor.ShowDialog() == DialogResult.OK)
{
@ -450,9 +443,9 @@ namespace FirstPlugin.Forms
if (!ActiveMaterialAnim.Textures.Contains(NewTex))
ActiveMaterialAnim.Textures.Add(NewTex);
if (activeSampler != null)
if (activeSampler is FMAA.BfresSamplerAnim)
{
activeSampler.AddKeyFrame(NewTex);
((FMAA.BfresSamplerAnim)activeSampler).AddKeyFrame(NewTex);
}
else
{
@ -464,12 +457,14 @@ namespace FirstPlugin.Forms
{
if (listViewCustom1.SelectedItems.Count > 0)
{
bool IsWiiU = activeSampler is FTXP.BfresSamplerAnim;
int SelectedFrame = KeyFrames[listViewCustom1.SelectedIndices[0]];
string currentTex = listViewCustom1.SelectedItems[0].Text;
Texture_Selector editor = new Texture_Selector();
editor.LoadTexture(currentTex, activeSampleU != null);
editor.LoadTexture(currentTex, IsWiiU);
if (editor.ShowDialog() == DialogResult.OK)
{
@ -479,16 +474,86 @@ namespace FirstPlugin.Forms
ActiveMaterialAnim.Textures.Add(NewTex);
int index = ActiveMaterialAnim.Textures.IndexOf(NewTex);
if (activeSampleU != null)
activeSampleU.SetValue(SelectedFrame, index);
else
activeSampler.SetValue(SelectedFrame, index);
activeSampler.SetValue(SelectedFrame, index);
ActiveMaterialAnim.UpdateAnimationData();
}
}
}
private void exportToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listViewCustom1.SelectedItems.Count > 0 && activeSampler != null)
{
int Frame = animationTrackBar.Value;
var keyFrame = activeSampler.GetKeyFrame(Frame);
var tex = activeSampler.GetActiveTexture((int)keyFrame.Value);
if (tex != null)
{
using (var sfd = new SaveFileDialog())
{
if (tex is FTEX)
{
sfd.Filter = FileFilters.FTEX;
if (sfd.ShowDialog() == DialogResult.OK)
{
if (tex is FTEX)
((FTEX)tex).Export(sfd.FileName);
}
}
if (tex is TextureData)
{
sfd.Filter = FileFilters.BNTX_TEX;
if (sfd.ShowDialog() == DialogResult.OK)
{
if (tex is TextureData)
((TextureData)tex).Export(sfd.FileName);
}
}
}
}
}
}
private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listViewCustom1.SelectedItems.Count > 0 && activeSampler != null)
{
int Frame = animationTrackBar.Value;
var keyFrame = activeSampler.GetKeyFrame(Frame);
var tex = activeSampler.GetActiveTexture((int)keyFrame.Value);
if (tex != null)
{
using (var ofd = new OpenFileDialog())
{
if (tex is FTEX)
{
ofd.Filter = FileFilters.FTEX;
if (ofd.ShowDialog() == DialogResult.OK)
{
if (tex is FTEX)
((FTEX)tex).Replace(ofd.FileName);
}
}
if (tex is TextureData)
{
ofd.Filter = FileFilters.BNTX_TEX;
if (ofd.ShowDialog() == DialogResult.OK)
{
if (tex is TextureData)
((TextureData)tex).Replace(ofd.FileName);
}
}
}
}
ReloadAnimationView();
}
}
private void textureFrameUD_ValueChanged(object sender, EventArgs e)
{
if (listViewCustom1.SelectedItems.Count > 0 && KeyFrames.Count > 0)
@ -510,10 +575,7 @@ namespace FirstPlugin.Forms
}
if (node.Tag is MaterialAnimation.SamplerKeyGroup)
{
if (ActiveMaterialAnim is FMAA)
activeSampler = (FMAA.BfresSamplerAnim)node.Tag;
else
activeSampleU = (FTXP.BfresSamplerAnim)node.Tag;
activeSampler = (MaterialAnimation.SamplerKeyGroup)node.Tag;
ReloadAnimationView();
}
@ -521,12 +583,35 @@ namespace FirstPlugin.Forms
private void addKeyFrameToolstrip_Click(object sender, EventArgs e)
{
if (activeSampler != null)
{
bool IsWiiU = activeSampler is FTXP.BfresSamplerAnim;
Texture_Selector editor = new Texture_Selector();
editor.LoadTexture("", IsWiiU);
if (editor.ShowDialog() == DialogResult.OK)
{
string NewTex = editor.GetSelectedTexture();
if (ActiveMaterialAnim.Textures == null)
ActiveMaterialAnim.Textures = new List<string>();
if (!ActiveMaterialAnim.Textures.Contains(NewTex))
ActiveMaterialAnim.Textures.Add(NewTex);
if (activeSampler != null)
activeSampler.AddKeyFrame(NewTex);
}
}
}
private void removeKeyFrameToolstrip_Click(object sender, EventArgs e)
{
if (activeSampler != null)
{
int Frame = animationTrackBar.Value;
activeSampler.RemoveKeyFrame(Frame);
}
}
private void toolstripShiftUp_Click(object sender, EventArgs e)
@ -550,7 +635,26 @@ namespace FirstPlugin.Forms
private void backgroundCB_SelectedIndexChanged(object sender, EventArgs e)
{
Runtime.pictureBoxStyle = (Runtime.PictureBoxBG)backgroundCB.SelectedItem;
UpdateBackgroundImage();
}
private void UpdateBackgroundImage()
{
switch (Runtime.pictureBoxStyle)
{
case Runtime.PictureBoxBG.Black:
pictureBoxCustom1.BackgroundImage = null;
pictureBoxCustom1.BackColor = Color.Black;
break;
case Runtime.PictureBoxBG.White:
pictureBoxCustom1.BackgroundImage = null;
pictureBoxCustom1.BackColor = Color.White;
break;
case Runtime.PictureBoxBG.Checkerboard:
pictureBoxCustom1.BackgroundImage = Switch_Toolbox.Library.Properties.Resources.CheckerBackground;
break;
}
}
}
}

View File

@ -120,6 +120,15 @@
<metadata name="stToolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>345, 17</value>
</metadata>
<metadata name="stToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 17</value>
</metadata>
<metadata name="stMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
<metadata name="timer1.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="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -139,6 +148,36 @@
<metadata name="stToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>228, 17</value>
</metadata>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripButton4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="pictureBoxCustom1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAlgAAAJYCAMAAACJuGjuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
@ -344,42 +383,6 @@
UbGMiuVULFKxnIpFKpZTsYyKZVQso2KZH1Is/D4jM+80LrRKBLQZIoHmCIFJmoigv0FAZZjRKRDQqYuE
kvArnu7TMGOwQkBrBGaOgI59BJSFX8p1KhBQJ17HuoWEyvhbosYIaBiu4xxnNGq/GayHAJq139oVZ/QQ
mGk4zW7tt3aFGa0JAhPXKv5Grfv8ckaj93+veSuXxEAIUwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="stMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="toolStripButton4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnStop.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -1544,6 +1547,9 @@
IYwAAAAASUVORK5CYII=
</value>
</data>
<metadata name="stMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 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

@ -89,7 +89,32 @@ namespace Switch_Toolbox.Library.Animations
SetValue(index, Frame);
}
public virtual void RemoveKeyFrame(int Frame)
{
}
public virtual void AddKeyFrame(string TextureName, float Frame = -1, bool IsConstant = false)
{
Constant = IsConstant;
//Add the texture if it does not exist for both wrapper and bfres itself
if (!MaterialAnimation.Textures.Contains(TextureName))
MaterialAnimation.Textures.Add(TextureName);
//Set our index
int index = MaterialAnimation.Textures.IndexOf(TextureName);
if (Frame == -1)
{
Frame = EndFrame + 1; //Add to the end of the list by default
}
//For non constants we load a curve
if (!Constant)
{
}
}
public virtual STGenericTexture GetActiveTexture(int Frame) { return null; }
}