Fix bone issues and skeleton importing

This commit is contained in:
KillzXGaming 2019-03-27 14:50:33 -04:00
parent d28a032b24
commit 01fda68f93
39 changed files with 146 additions and 69 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.vs/Switch_Toolbox/v15/Server/sqlite3/db.lock
*NodeEditorWinforms-master
*.resources
Debug/
Release/

Binary file not shown.

BIN
Switch_FileFormatsMain.zip Normal file

Binary file not shown.

View file

@ -31,6 +31,16 @@ namespace Bfres.Structs
return matrices;
}
public void AddBone(Bone bone)
{
node.Skeleton.Bones.Add(bone);
}
public void AddBone(ResU.Bone bone)
{
node.SkeletonU.Bones.Add(bone.Name, bone);
}
public class fsklNode : STGenericWrapper
{
public FSKL fskl;
@ -68,6 +78,31 @@ namespace Bfres.Structs
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Clear All Bones", null, ClearAction, Keys.Control | Keys.C));
}
public override void Replace(string FileName)
{
string extension = System.IO.Path.GetExtension(FileName);
if (extension == ".bfskl")
{
if (SkeletonU != null)
{
SkeletonU = new ResU.Skeleton();
SkeletonU.Import(FileName, GetResFileU());
Nodes.Clear();
fskl.bones.Clear();
BfresWiiU.ReadSkeleton(this, SkeletonU, fskl);
}
else
{
Skeleton = new Skeleton();
Skeleton.Import(FileName);
Nodes.Clear();
fskl.bones.Clear();
BfresSwitch.ReadSkeleton(this, Skeleton, fskl);
}
}
}
public ResFile GetResFile()
{
return ((BFRESGroupNode)Parent).GetResFile();
@ -124,11 +159,6 @@ namespace Bfres.Structs
Skeleton.Export(FileName, ((FMDL)Parent).GetResFile());
}
public override void Replace(string FileName)
{
Skeleton.Export(FileName, ((FMDL)Parent).GetResFile());
}
public override void OnClick(TreeView treeView)
{
UpdateEditor();
@ -154,11 +184,30 @@ namespace Bfres.Structs
node = new fsklNode();
node.fskl = this;
node.SkeletonU = skl;
BfresWiiU.SetSkeleton(node, skl, this);
BfresWiiU.ReadSkeleton(node, skl, this);
}
}
public class BfresBone : STBone
{
public bool UseSmoothMatrix { get; set; }
public bool UseRigidMatrix { get; set; }
public string BoneName
{
get
{
if (BoneU != null) return BoneU.Name;
else return Bone.Name;
}
set
{
if (BoneU != null) BoneU.Name = value;
else Bone.Name = value;
Text = value;
}
}
public bool FlagVisible = true;
public ResU.ResDict<ResU.UserData> UserDataU;
@ -179,6 +228,7 @@ namespace Bfres.Structs
SelectedImageKey = "bone";
ContextMenuStrip = new STContextMenuStrip();
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Rename", null, RenameAction, Keys.Control | Keys.I));
ContextMenuStrip.Items.Add(new ToolStripMenuItem("New Child Bone", null, NewAction, Keys.Control | Keys.I));
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Import Child Bone", null, ImportAction, Keys.Control | Keys.I));
ContextMenuStrip.Items.Add(new ToolStripSeparator());
@ -190,7 +240,16 @@ namespace Bfres.Structs
protected void ImportAction(object sender, EventArgs args) { ImportChild(); }
protected void ReplaceAction(object sender, EventArgs args) { Replace(); }
protected void NewAction(object sender, EventArgs args) { NewChild(); }
protected void RenameAction(object sender, EventArgs args) { Rename(); }
public void Rename()
{
RenameDialog dialog = new RenameDialog();
dialog.SetString(Text);
if (dialog.ShowDialog() == DialogResult.OK) { BoneName = dialog.textBox1.Text; }
}
public void CloneBaseInstance(STBone genericBone)
{
Text = genericBone.Text;
@ -283,6 +342,9 @@ namespace Bfres.Structs
BfresWiiU.ReadBone(bn, BoneU, false);
Nodes.Add(bn);
skeletonParent.bones.Add(bn);
BoneU.ParentIndex = (ushort)bn.parentIndex;
((FSKL)skeletonParent).AddBone(BoneU);
}
else
{
@ -290,8 +352,11 @@ namespace Bfres.Structs
Bone.Name = CheckDuplicateBoneNames("NewBone");
BfresSwitch.ReadBone(bn, Bone, false);
Nodes.Add(bn);
skeletonParent.bones.Add(bn);
((FSKL)skeletonParent).AddBone(Bone);
}
}
@ -314,6 +379,7 @@ namespace Bfres.Structs
BfresWiiU.ReadBone(bn, BoneU, false);
Nodes.Add(bn);
skeletonParent.bones.Add(bn);
((FSKL)skeletonParent).AddBone(BoneU);
}
else
{
@ -324,6 +390,7 @@ namespace Bfres.Structs
BfresSwitch.ReadBone(bn, Bone, false);
Nodes.Add(bn);
skeletonParent.bones.Add(bn);
((FSKL)skeletonParent).AddBone(Bone);
}
}
}

View file

@ -54,6 +54,8 @@ namespace FirstPlugin
{
var mat = MatrixExenstion.GetMatrixInverted(bone);
bn.ParentIndex = (ushort)bone.parentIndex;
if (bn.SmoothMatrixIndex > -1)
model.Skeleton.InverseModelMatrices[bn.SmoothMatrixIndex] = mat;
}

View file

@ -309,7 +309,7 @@ namespace FirstPlugin
return attd.Data;
}
public static void SetSkeleton(this TreeNodeCustom skl, Skeleton skeleton, FSKL RenderableSkeleton)
public static void ReadSkeleton(this TreeNodeCustom skl, Skeleton skeleton, FSKL RenderableSkeleton)
{
if (skeleton.MatrixToBoneList == null)
skeleton.MatrixToBoneList = new List<ushort>();

View file

@ -536,7 +536,7 @@
this.textureBP.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textureBP.BackColor = System.Drawing.Color.Transparent;
this.textureBP.BackColor = System.Drawing.Color.Empty;
this.textureBP.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("textureBP.BackgroundImage")));
this.textureBP.Location = new System.Drawing.Point(14, 146);
this.textureBP.MinimumSize = new System.Drawing.Size(280, 365);

View file

@ -122,7 +122,7 @@
// ovlColumn1
//
this.ovlColumn1.AspectName = "Name";
this.ovlColumn1.HeaderForeColor = System.Drawing.Color.Transparent;
this.ovlColumn1.HeaderForeColor = System.Drawing.Color.Empty;
this.ovlColumn1.Text = "Name";
this.ovlColumn1.Width = 170;
//

View file

@ -20,7 +20,7 @@ namespace FirstPlugin.Forms
private void ColorWheel_Paint(object sender, PaintEventArgs e)
{
DrawColorWheel(e.Graphics, Color.Transparent, 0, 0, ClientSize.Width, ClientSize.Height);
DrawColorWheel(e.Graphics, Color.Empty, 0, 0, ClientSize.Width, ClientSize.Height);
}
private void DrawColorWheel(Graphics gr, Color outline_color,

View file

@ -16,7 +16,7 @@ namespace FirstPlugin.Forms
if (IsColor)
return pictureBox1.BackColor;
else
return Color.Transparent;
return Color.Empty;
}
public vector3SliderPanel(string UniformName, float[] values, BfresShaderParam param)

View file

@ -15,7 +15,7 @@ namespace FirstPlugin.Forms
if (IsColor)
return colorPB.BackColor;
else
return Color.Transparent;
return Color.Empty;
}
public Color GetAlphaColor()
@ -23,7 +23,7 @@ namespace FirstPlugin.Forms
if (IsColor)
return alphaPB.BackColor;
else
return Color.Transparent;
return Color.Empty;
}
public vector4SliderPanel(string UniformName, float[] values, BfresShaderParam param)

View file

@ -43,7 +43,7 @@
//
// pictureBoxCustom1
//
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Empty;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(252, 25);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";

View file

@ -155,6 +155,8 @@
this.stFlowLayoutPanel1.Controls.Add(this.stDropDownPanel5);
this.stFlowLayoutPanel1.Controls.Add(this.stDropDownPanel6);
this.stFlowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stFlowLayoutPanel1.FixedHeight = false;
this.stFlowLayoutPanel1.FixedWidth = true;
this.stFlowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.stFlowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.stFlowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
@ -175,8 +177,8 @@
this.stDropDownPanel1.PanelName = "Bone Info";
this.stDropDownPanel1.PanelValueName = "";
this.stDropDownPanel1.SetIcon = null;
this.stDropDownPanel1.SetIconAlphaColor = System.Drawing.Color.Transparent;
this.stDropDownPanel1.SetIconColor = System.Drawing.Color.Transparent;
this.stDropDownPanel1.SetIconAlphaColor = System.Drawing.Color.Empty;
this.stDropDownPanel1.SetIconColor = System.Drawing.Color.Empty;
this.stDropDownPanel1.Size = new System.Drawing.Size(633, 113);
this.stDropDownPanel1.TabIndex = 0;
//
@ -186,6 +188,7 @@
this.boneInfoPanel1.Name = "boneInfoPanel1";
this.boneInfoPanel1.Size = new System.Drawing.Size(604, 87);
this.boneInfoPanel1.TabIndex = 1;
this.boneInfoPanel1.Load += new System.EventHandler(this.boneInfoPanel1_Load);
//
// stDropDownPanel2
//
@ -199,8 +202,8 @@
this.stDropDownPanel2.PanelName = "Transform";
this.stDropDownPanel2.PanelValueName = "";
this.stDropDownPanel2.SetIcon = null;
this.stDropDownPanel2.SetIconAlphaColor = System.Drawing.Color.Transparent;
this.stDropDownPanel2.SetIconColor = System.Drawing.Color.Transparent;
this.stDropDownPanel2.SetIconAlphaColor = System.Drawing.Color.Empty;
this.stDropDownPanel2.SetIconColor = System.Drawing.Color.Empty;
this.stDropDownPanel2.Size = new System.Drawing.Size(633, 151);
this.stDropDownPanel2.TabIndex = 1;
//
@ -627,8 +630,8 @@
this.stDropDownPanel3.PanelName = "Billboard";
this.stDropDownPanel3.PanelValueName = "";
this.stDropDownPanel3.SetIcon = null;
this.stDropDownPanel3.SetIconAlphaColor = System.Drawing.Color.Transparent;
this.stDropDownPanel3.SetIconColor = System.Drawing.Color.Transparent;
this.stDropDownPanel3.SetIconAlphaColor = System.Drawing.Color.Empty;
this.stDropDownPanel3.SetIconColor = System.Drawing.Color.Empty;
this.stDropDownPanel3.Size = new System.Drawing.Size(633, 95);
this.stDropDownPanel3.TabIndex = 2;
//
@ -703,8 +706,8 @@
this.stDropDownPanel4.PanelName = "Matricies";
this.stDropDownPanel4.PanelValueName = "";
this.stDropDownPanel4.SetIcon = null;
this.stDropDownPanel4.SetIconAlphaColor = System.Drawing.Color.Transparent;
this.stDropDownPanel4.SetIconColor = System.Drawing.Color.Transparent;
this.stDropDownPanel4.SetIconAlphaColor = System.Drawing.Color.Empty;
this.stDropDownPanel4.SetIconColor = System.Drawing.Color.Empty;
this.stDropDownPanel4.Size = new System.Drawing.Size(633, 95);
this.stDropDownPanel4.TabIndex = 3;
//
@ -795,7 +798,7 @@
this.stDropDownPanel5.PanelName = "Transform Modes";
this.stDropDownPanel5.PanelValueName = "";
this.stDropDownPanel5.SetIcon = null;
this.stDropDownPanel5.SetIconAlphaColor = System.Drawing.Color.Transparent;
this.stDropDownPanel5.SetIconAlphaColor = System.Drawing.Color.Empty;
this.stDropDownPanel5.SetIconColor = System.Drawing.Color.Transparent;
this.stDropDownPanel5.Size = new System.Drawing.Size(633, 136);
this.stDropDownPanel5.TabIndex = 4;

View file

@ -200,5 +200,10 @@ namespace FirstPlugin
SetBoneTransform(activeBone);
}
}
private void boneInfoPanel1_Load(object sender, EventArgs e)
{
}
}
}

View file

@ -49,6 +49,7 @@
this.nameTB.Name = "nameTB";
this.nameTB.Size = new System.Drawing.Size(227, 20);
this.nameTB.TabIndex = 0;
this.nameTB.TextChanged += new System.EventHandler(this.nameTB_TextChanged);
//
// stLabel1
//

View file

@ -36,12 +36,16 @@ namespace FirstPlugin
nameIndexUD.Value = bn.GetIndex();
nameTB.Bind(bn, "Text");
nameTB.Bind(bn, "BoneName");
parentIndexUD.Bind(bn, "parentIndex");
visibleChk.Bind(bn, "IsVisible");
Loaded = true;
}
private void nameTB_TextChanged(object sender, EventArgs e)
{
}
}
}

View file

@ -274,7 +274,7 @@
this.pictureBoxCustom1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Empty;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(6, 102);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";
@ -339,7 +339,7 @@
//
this.animationTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.animationTrackBar.BackColor = System.Drawing.Color.Transparent;
this.animationTrackBar.BackColor = System.Drawing.Color.Empty;
this.animationTrackBar.BarInnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.animationTrackBar.BarPenColorBottom = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.animationTrackBar.BarPenColorTop = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));

View file

@ -42,7 +42,7 @@
this.pictureBoxCustom1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Empty;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";

View file

@ -63,7 +63,7 @@
this.pictureBoxCustom1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Empty;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(3, 56);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";

View file

@ -104,7 +104,7 @@
//
// color1Index0
//
this.color1Index0.BackColor = System.Drawing.Color.Transparent;
this.color1Index0.BackColor = System.Drawing.Color.Empty;
this.color1Index0.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index0.Location = new System.Drawing.Point(181, 46);
this.color1Index0.Name = "color1Index0";
@ -116,7 +116,7 @@
//
// color0Index0
//
this.color0Index0.BackColor = System.Drawing.Color.Transparent;
this.color0Index0.BackColor = System.Drawing.Color.Empty;
this.color0Index0.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index0.Location = new System.Drawing.Point(6, 46);
this.color0Index0.Name = "color0Index0";
@ -128,7 +128,7 @@
//
// color0Index1
//
this.color0Index1.BackColor = System.Drawing.Color.Transparent;
this.color0Index1.BackColor = System.Drawing.Color.Empty;
this.color0Index1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index1.Location = new System.Drawing.Point(6, 102);
this.color0Index1.Name = "color0Index1";
@ -140,7 +140,7 @@
//
// color1Index1
//
this.color1Index1.BackColor = System.Drawing.Color.Transparent;
this.color1Index1.BackColor = System.Drawing.Color.Empty;
this.color1Index1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index1.Location = new System.Drawing.Point(181, 102);
this.color1Index1.Name = "color1Index1";
@ -152,7 +152,7 @@
//
// color0Index3
//
this.color0Index3.BackColor = System.Drawing.Color.Transparent;
this.color0Index3.BackColor = System.Drawing.Color.Empty;
this.color0Index3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index3.Location = new System.Drawing.Point(6, 214);
this.color0Index3.Name = "color0Index3";
@ -164,7 +164,7 @@
//
// color1Index3
//
this.color1Index3.BackColor = System.Drawing.Color.Transparent;
this.color1Index3.BackColor = System.Drawing.Color.Empty;
this.color1Index3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index3.Location = new System.Drawing.Point(181, 214);
this.color1Index3.Name = "color1Index3";
@ -176,7 +176,7 @@
//
// color0Index2
//
this.color0Index2.BackColor = System.Drawing.Color.Transparent;
this.color0Index2.BackColor = System.Drawing.Color.Empty;
this.color0Index2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index2.Location = new System.Drawing.Point(6, 158);
this.color0Index2.Name = "color0Index2";
@ -188,7 +188,7 @@
//
// color1Index2
//
this.color1Index2.BackColor = System.Drawing.Color.Transparent;
this.color1Index2.BackColor = System.Drawing.Color.Empty;
this.color1Index2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index2.Location = new System.Drawing.Point(181, 158);
this.color1Index2.Name = "color1Index2";
@ -200,7 +200,7 @@
//
// color0Index7
//
this.color0Index7.BackColor = System.Drawing.Color.Transparent;
this.color0Index7.BackColor = System.Drawing.Color.Empty;
this.color0Index7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index7.Location = new System.Drawing.Point(6, 438);
this.color0Index7.Name = "color0Index7";
@ -212,7 +212,7 @@
//
// color1Index7
//
this.color1Index7.BackColor = System.Drawing.Color.Transparent;
this.color1Index7.BackColor = System.Drawing.Color.Empty;
this.color1Index7.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index7.Location = new System.Drawing.Point(181, 438);
this.color1Index7.Name = "color1Index7";
@ -224,7 +224,7 @@
//
// color0Index6
//
this.color0Index6.BackColor = System.Drawing.Color.Transparent;
this.color0Index6.BackColor = System.Drawing.Color.Empty;
this.color0Index6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index6.Location = new System.Drawing.Point(6, 382);
this.color0Index6.Name = "color0Index6";
@ -236,7 +236,7 @@
//
// color1Index6
//
this.color1Index6.BackColor = System.Drawing.Color.Transparent;
this.color1Index6.BackColor = System.Drawing.Color.Empty;
this.color1Index6.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index6.Location = new System.Drawing.Point(181, 382);
this.color1Index6.Name = "color1Index6";
@ -248,7 +248,7 @@
//
// color0Index5
//
this.color0Index5.BackColor = System.Drawing.Color.Transparent;
this.color0Index5.BackColor = System.Drawing.Color.Empty;
this.color0Index5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index5.Location = new System.Drawing.Point(6, 326);
this.color0Index5.Name = "color0Index5";
@ -260,7 +260,7 @@
//
// color1Index5
//
this.color1Index5.BackColor = System.Drawing.Color.Transparent;
this.color1Index5.BackColor = System.Drawing.Color.Empty;
this.color1Index5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index5.Location = new System.Drawing.Point(181, 326);
this.color1Index5.Name = "color1Index5";
@ -272,7 +272,7 @@
//
// color0Index4
//
this.color0Index4.BackColor = System.Drawing.Color.Transparent;
this.color0Index4.BackColor = System.Drawing.Color.Empty;
this.color0Index4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color0Index4.Location = new System.Drawing.Point(6, 270);
this.color0Index4.Name = "color0Index4";
@ -284,7 +284,7 @@
//
// color1Index4
//
this.color1Index4.BackColor = System.Drawing.Color.Transparent;
this.color1Index4.BackColor = System.Drawing.Color.Empty;
this.color1Index4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.color1Index4.Location = new System.Drawing.Point(181, 270);
this.color1Index4.Name = "color1Index4";
@ -408,7 +408,7 @@
//
// pictureBox2
//
this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
this.pictureBox2.BackColor = System.Drawing.Color.Empty;
this.pictureBox2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.BackgroundImage")));
this.pictureBox2.Location = new System.Drawing.Point(14, 192);
this.pictureBox2.Name = "pictureBox2";
@ -419,7 +419,7 @@
//
// pictureBox3
//
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
this.pictureBox3.BackColor = System.Drawing.Color.Empty;
this.pictureBox3.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox3.BackgroundImage")));
this.pictureBox3.Location = new System.Drawing.Point(14, 361);
this.pictureBox3.Name = "pictureBox3";
@ -430,7 +430,7 @@
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackColor = System.Drawing.Color.Empty;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Location = new System.Drawing.Point(14, 41);
this.pictureBox1.Name = "pictureBox1";

View file

@ -143,7 +143,7 @@
//
this.stPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stPanel4.BackColor = System.Drawing.Color.Transparent;
this.stPanel4.BackColor = System.Drawing.Color.Empty;
this.stPanel4.Controls.Add(this.btnStop);
this.stPanel4.Controls.Add(this.btnForward1);
this.stPanel4.Controls.Add(this.btnPlay);
@ -247,7 +247,7 @@
this.pictureBoxCustom1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxCustom1.BackColor = System.Drawing.Color.Empty;
this.pictureBoxCustom1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBoxCustom1.BackgroundImage")));
this.pictureBoxCustom1.Location = new System.Drawing.Point(167, 3);
this.pictureBoxCustom1.Name = "pictureBoxCustom1";

View file

@ -206,7 +206,7 @@
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackColor = System.Drawing.Color.Empty;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.pictureBox1.Location = new System.Drawing.Point(237, 0);

View file

@ -390,7 +390,7 @@ namespace FirstPlugin
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackColor = System.Drawing.Color.Empty;
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Left;
this.pictureBox1.Location = new System.Drawing.Point(237, 0);

View file

@ -577,7 +577,7 @@ namespace Switch_Toolbox.Library
if (ext == ".ply")
formatID = "ply";
if (v.ExportFile(scene, FileName, formatID, PostProcessSteps.FlipUVs | PostProcessSteps.ValidateDataStructure))
if (v.ExportFile(scene, FileName, formatID, PostProcessSteps.ValidateDataStructure))
MessageBox.Show($"Exported {FileName} Successfuly!");
else
MessageBox.Show($"Failed to export {FileName}!");

View file

@ -31,13 +31,15 @@ namespace FlatTabControl
private bool bUpDown; // true when the button UpDown is required
private ImageList leftRightImages = null;
private const int nMargin = 5;
private Color mBackColor = Color.Transparent;
private Color mShadowColor = Color.Transparent;
private Color mBackColor = Color.Empty;
private Color mShadowColor = Color.Empty;
public FlatTabControl()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
myBackColor = FormThemes.BaseTheme.FormBackColor;
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// double buffering
this.SetStyle(ControlStyles.UserPaint, true);
@ -46,7 +48,6 @@ namespace FlatTabControl
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
myBackColor = FormThemes.BaseTheme.FormBackColor;
bUpDown = false;

View file

@ -220,7 +220,7 @@ namespace Switch_Toolbox.Library
private void CalculateTanBitanArrays(List<int> faces, Vector3[] tanArray, Vector3[] bitanArray, bool UseUVLayer2)
{
if (vertices.Count < 3)
if (vertices.Count < 3 || lodMeshes.Count <= 0)
return;
for (int i = 0; i < lodMeshes[DisplayLODIndex].displayFaceSize; i += 3)

View file

@ -76,8 +76,6 @@ namespace Switch_Toolbox.Library.IO
public void CompressData(CompressionType CompressionType, byte[] data)
{
MessageBox.Show(data.Length.ToString());
switch (CompressionType)
{
case CompressionType.Yaz0:

View file

@ -442,7 +442,6 @@ namespace Switch_Toolbox.Library.IO
using (var source = LZ4Stream.Decode(new MemoryStream(data)))
{
source.CopyTo(mem);
mem.Write(data, 0, data.Length);
}
return mem.ToArray();
}
@ -452,12 +451,8 @@ namespace Switch_Toolbox.Library.IO
var stream = new MemoryStream();
using (var writer = new FileWriter(stream))
{
writer.Write(data.Length);
MessageBox.Show(data.Length.ToString());
byte[] buffer = LZ4.Frame.LZ4Frame.Compress(new MemoryStream(data), LZ4.Frame.LZ4MaxBlockSize.Auto, true, true, false, false, true);
byte[] buffer = LZ4.Frame.LZ4Frame.Compress(new MemoryStream(data), LZ4.Frame.LZ4MaxBlockSize.Auto, true, true, false, true, false);
writer.Write(buffer, 0, buffer.Length);
}
return stream.ToArray();

View file

@ -68,7 +68,7 @@ namespace Switch_Toolbox.Library
public static bool UseDebugDomainExceptionHandler;
public static bool DisableUpdatePrompt;
public static bool MaximizeMdiWindow = false;
public static bool MaximizeMdiWindow = true;
public static GridSettings gridSettings = new GridSettings();
public class GridSettings