1
0
mirror of synced 2024-12-02 19:17:24 +01:00
Switch-Toolbox/Switch_FileFormatsMain/GUI/BFRES/Shape/BfresShapeEditor.cs

335 lines
11 KiB
C#
Raw Normal View History

Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
using System;
using FirstPlugin.Forms;
using OpenTK;
using System.Windows.Forms;
using Switch_Toolbox.Library;
using Bfres.Structs;
using Switch_Toolbox.Library.Forms;
using Switch_Toolbox.Library.Rendering;
using Syroot.NintenTools.NSW.Bfres;
using ResU = Syroot.NintenTools.Bfres;
namespace FirstPlugin
{
public partial class BfresShapeEditor : UserControl
{
public BfresShapeEditor()
{
InitializeComponent();
stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
lodListView.FullRowSelect = true;
btnFacesView.Enabled = false;
vertexBufferDropDownPanel.IsExpanded = false;
levelOfDetailDropDownPanel.IsExpanded = false;
keyShapeDropDownPanel.IsExpanded = false;
BackColor = FormThemes.BaseTheme.FormBackColor;
ForeColor = FormThemes.BaseTheme.FormForeColor;
rotModeCB.SelectedIndex = 0;
measureCB.SelectedIndex = 0;
posXUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
posYUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
posZUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
RotXUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
RotYUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
RotZUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
RotWUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
ScaXUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
ScaYUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
ScaZUD.ValueChanged += new EventHandler(valueUD_ValueChanged);
}
FSHP activeShape;
FSHP.LOD_Mesh activeLodMesh;
bool IsLoaded = false;
bool IsBoneListLoaded = false;
bool IsMatListLoaded = false;
public void LoadShape(FSHP fshp)
{
InitializeControls();
activeShape = fshp;
shapeVertexSkinCountUD.Value = (decimal)fshp.VertexSkinCount;
FMDL fmdl = fshp.GetParentModel();
//Load info
nameTB.Bind(fshp, "Text");
shapeIndexUD.Value = fmdl.shapes.IndexOf(fshp);
//Load meshes to toggle LOD display
for (int i = 0; i < fshp.lodMeshes.Count; i++)
{
lodDisplayCB.Items.Add($"mesh {i}");
}
lodDisplayCB.SelectedIndex = activeShape.DisplayLODIndex;
//Load material (all materials will load when activated)
materialComboBox1.Items.Add(fshp.GetMaterial().Text);
materialComboBox1.SelectedIndex = 0;
//Load bone binded (all bones will load when activated)
bonesCB.Items.Add(fmdl.Skeleton.bones[fshp.BoneIndex].Text);
bonesCB.SelectedIndex = 0;
//Load transform
GetShapeTransform();
if (fshp.VertexBufferU != null)
{
vertexBufferSkinCountUD.Maximum = (decimal)fshp.VertexBufferU.VertexSkinCount;
Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
vertexBufferSkinCountUD.Value = (decimal)fshp.VertexBufferU.VertexSkinCount;
vertexBufferList1.LoadVertexBuffers(fshp, fshp.VertexBufferU);
}
else
{
vertexBufferSkinCountUD.Maximum = (decimal)fshp.VertexBuffer.VertexSkinCount;
Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
vertexBufferSkinCountUD.Value = (decimal)fshp.VertexBuffer.VertexSkinCount;
vertexBufferList1.LoadVertexBuffers(fshp, fshp.VertexBuffer);
}
2019-04-12 02:25:00 +02:00
vtxCountUD.Maximum = fshp.vertices.Count;
vtxCountUD.Value = fshp.vertices.Count;
Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
if (fshp.ShapeU != null)
keyShapeList1.LoadKeyShapes(fshp.ShapeU.KeyShapes);
else
keyShapeList1.LoadKeyShapes(fshp.Shape.KeyShapes, fshp.Shape.KeyShapeDict);
int lodIndx = 0;
foreach (var mesh in fshp.lodMeshes)
lodListView.Items.Add($"Detail Level {lodIndx++}");
IsLoaded = true;
}
private void InitializeControls()
{
IsLoaded = false;
IsBoneListLoaded = false;
IsMatListLoaded = false;
Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
lodDisplayCB.Items.Clear();
lodListView.Items.Clear();
bonesCB.Items.Clear();
materialComboBox1.Items.Clear();
rotModeCB.SelectedIndex = 0;
}
private void ReloadBoneList()
{
if (!IsLoaded)
return;
if (!IsBoneListLoaded)
{
bonesCB.Items.Clear();
foreach (var bn in activeShape.GetParentModel().Skeleton.bones)
bonesCB.Items.Add(bn.Text);
bonesCB.SelectedIndex = activeShape.BoneIndex;
IsBoneListLoaded = true;
}
}
private void GetShapeTransform()
{
Vector3 translate = new Vector3(0);
Vector3 scale = new Vector3(1);
Vector4 rotate = new Vector4(0);
translate = activeShape.boundingBoxes[0].Center;
posXUD.Value = (decimal)translate.X;
posYUD.Value = (decimal)translate.Y;
posZUD.Value = (decimal)translate.Z;
RotXUD.Value = (decimal)rotate.X;
RotYUD.Value = (decimal)rotate.Y;
RotZUD.Value = (decimal)rotate.Z;
RotWUD.Value = 1;
ScaXUD.Value = (decimal)scale.X;
ScaYUD.Value = (decimal)scale.Y;
ScaZUD.Value = (decimal)scale.Z;
}
private void materialComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoaded)
return;
if (materialComboBox1.SelectedIndex >= 0 && IsMatListLoaded)
Add files for the new one. Rework UI from scratch with proper themes and custom controls. MDI windows are now used for workspaces, comparing docs, and multiple usages. Tabs organise multiple workspaces and you can keep mdi windows maximized if you want to only use tabs. Themes currently include dark and white theme but plan to have XML files with list of color and styles Alot of things optimized. UI is very fast and snappy now Dae rigging fixed. Dae bones can be imported. Dae with textures can be imported and exported to a folder Custom sampler editor for sampler data. Texture refs, shader options, params, render info, and basically all material data can be added/removed and edited User data editor Update opengl framework by JuPaHe64 to the newest. Includes an origintation cube, multiple models in a scene, and many improvements Skeleton can be viewed GFPAK with some fixes in saving NUTEXB has proper mip map viewing PTCL Editor (Wii U and Switch). Can edit colors ( Wii U) and view textures. Also EFFN files in smash ultimate can be previewed Files can be associated with the program and opened with on clicking them ASTC textures can be viewed UVs can be viewed. Includes wrap modes and also translating and scaling for some basic edits Textures use a new editor. It includes channel viewing and some new editing options Fixed black textures on some wii u bfres Fixed saving sarcs in sarcs Shortcut keys have been added in. CTRL + S can save the active file in the currently used window Fix more issues with bfres crashing File - New includes BNTX for creating new bntx files from scatch Raw shader binaries can be extracted from bnsh and bfsha. Yuzu and Ryujinx can decompile these Sharc files can have source data previewed and shader programs in XML Aamp v1 and v2 data can be previewed. v1 can be edited and saved atm, v2 will be at a later update Byaml uses it's own editor instead of a seperate window for easy saving within sarcs Archives have a hex viewer Dae exporting greatly improved and can export rigged meshes Scene, shader param, srt, color, and texture pattern animations can all be previewed (in a list) Memory usage is greatly improved Narc (Nitro Archives) can be viewed and extracted. Fixed importing TGA images Support importing ASTC textures for bntx Added in PBR lighting for bfres from my implimentaion in forge Added gradient background for viewport. This can be edited in the settings Added skybox background option for viewport. Can load cubemaps Added grid with customizable cells for viewport. DDS decompression no longer requires Direct X tex. Zlib decompression has been improved for opening files that use it Rigid bones are properly ordered on importing a mesh. May fix some exploding issues. Endianness for KCL can be toggled for saving. Will be set to what it was using orignally Tangents can be filled with a constant value. Will allow them to not cause seams nor flat lighting however normal maps may not work as good Vertex buffers can be added and removed. Also re encoded Parameters now use drop down panels with values for easier editing Reworked the bone editor. Everything for a bone can be fully edited now besides the index, billboard index and parent index which get set automatically Fixed animation scaling for skeletal animations finally! Textures can be loaded in a tab now with thumbnail displaying for easy real time edits while previewing in the viewport Fixed support for audio files to be big endian in BARS Textures for switch now use their own folder. You can easily add textures to this and add textures to bfres that have no bntx. If there are no textures then the bfres will automatically not have one on save. Animations are split into multiple sub sections for switch's material animation for easier access Bfres for wii u has better binary exporting and is fully compatiable with Wexos Toolbox (to and from) Every section can be added in as new for both wii u and switch. Every section can be renamed properly and mostly everything can be edited. (Key frame editing and a more in depth curve editor later) Added option to copy UV channel Bone weights can be previewed Tons of fixes for the switch bfres library with more games working. Splatoon 2 (more work now), BOTW, Kirby Star Allies, and more! Fixed 3.3 Wii U bfres from not opening Wii U Sharcfb files can have shader program data previewed (XML) And possibly alot more things i missed! All this is still experimental but will improve over the next few weeks
2019-03-23 17:55:09 +01:00
{
activeShape.MaterialIndex = materialComboBox1.SelectedIndex;
materialIndexUD.Value = materialComboBox1.SelectedIndex;
}
LibraryGUI.Instance.UpdateViewport();
}
private void ReloadMaterialList()
{
if (!IsLoaded)
return;
//For optmization purposes. Load a list when used instead
if (!IsMatListLoaded)
{
materialComboBox1.Items.Clear();
foreach (FMAT mat in activeShape.GetParentModel().materials.Values)
materialComboBox1.Items.Add(mat.Text);
materialComboBox1.SelectedIndex = activeShape.MaterialIndex;
IsMatListLoaded = true;
}
}
private void bonesCB_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoaded)
return;
if (bonesCB.SelectedIndex >= 0 && IsBoneListLoaded)
{
activeShape.BoneIndex = bonesCB.SelectedIndex;
boneIndexUD.Value = bonesCB.SelectedIndex;
}
LibraryGUI.Instance.UpdateViewport();
}
private void valueUD_ValueChanged(object sender, EventArgs e)
{
}
private void stDropDownPanel1_Load(object sender, EventArgs e)
{
}
private void rotModeCB_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void materialComboBox1_Click(object sender, EventArgs e) {
}
private void materialComboBox1_KeyDown(object sender, KeyEventArgs e) {
ReloadMaterialList();
}
private void materialComboBox1_MouseDown(object sender, MouseEventArgs e){
ReloadMaterialList();
}
private void bonesCB_KeyDown(object sender, KeyEventArgs e) {
ReloadBoneList();
}
private void bonesCB_MouseDown(object sender, MouseEventArgs e) {
ReloadBoneList();
}
private void boneListBtn_Click(object sender, EventArgs e)
{
BoneIndexList indexViewer = new BoneIndexList("Bone Index List");
if (activeShape.ShapeU != null)
{
indexViewer.LoadIndices(activeShape.ShapeU.SkinBoneIndices,
activeShape.GetParentModel().Skeleton);
}
else
{
indexViewer.LoadIndices(activeShape.Shape.SkinBoneIndices,
activeShape.GetParentModel().Skeleton);
}
indexViewer.Show(this);
}
private void lodDisplayCB_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoaded)
return;
if (lodDisplayCB.SelectedIndex != -1)
{
activeShape.DisplayLODIndex = lodDisplayCB.SelectedIndex;
activeShape.UpdateVertexData();
LibraryGUI.Instance.UpdateViewport();
}
}
private void stDropDownPanel6_Paint(object sender, PaintEventArgs e)
{
}
private void lodListView_SelectedIndexChanged(object sender, EventArgs e)
{
if (lodListView.SelectedIndices.Count > 0)
{
btnFacesView.Enabled = true;
subMeshesViewBtn.Enabled = true;
int index = lodListView.SelectedIndices[0];
activeLodMesh = activeShape.lodMeshes[index];
lodFormatCB.Bind(typeof(STIndexFormat), activeLodMesh, "IndexFormat");
lodFormatCB.SelectedItem = activeLodMesh.IndexFormat;
lodPrimativeTypeCB.Bind(typeof(STPolygonType), activeLodMesh, "PrimitiveType");
lodPrimativeTypeCB.SelectedItem = activeLodMesh.PrimitiveType;
lodVertexSkipUD.Value = activeLodMesh.FirstVertex;
lodFaceCountUD.Value = activeLodMesh.faces.Count;
}
else
{
btnFacesView.Enabled = false;
activeLodMesh = null;
lodFormatCB.DataSource = null;
lodPrimativeTypeCB.DataSource = null;
lodFormatCB.Items.Clear();
lodPrimativeTypeCB.Items.Clear();
lodVertexSkipUD.Value = 0;
lodFaceCountUD.Value = 0;
subMeshesViewBtn.Enabled = false;
}
}
private void btnFacesView_Click(object sender, EventArgs e)
{
if (activeLodMesh != null)
{
FaceIndiceListViewer viewer = new FaceIndiceListViewer();
viewer.LoadIndices(activeLodMesh.faces);
viewer.Show(this);
}
}
private void subMeshesViewBtn_Click(object sender, EventArgs e)
{
if (activeLodMesh != null)
{
SubMeshEditor editor = new SubMeshEditor();
editor.LoadMesh(activeLodMesh, activeShape);
if (editor.ShowDialog() == DialogResult.OK)
{
}
}
}
}
}