mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Add sharpyaml and latest bfres wii u lib
This commit is contained in:
parent
432e639081
commit
bfacab21da
8 changed files with 103 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -41,6 +41,11 @@ namespace Bfres.Structs
|
|||
node.SkeletonU.Bones.Add(bone.Name, bone);
|
||||
}
|
||||
|
||||
public FMDL GetModelParent()
|
||||
{
|
||||
return (FMDL)node.Parent;
|
||||
}
|
||||
|
||||
public class fsklNode : STGenericWrapper
|
||||
{
|
||||
public FSKL fskl;
|
||||
|
@ -409,6 +414,7 @@ namespace Bfres.Structs
|
|||
protected void ReplaceAction(object sender, EventArgs args) { Replace(); }
|
||||
protected void NewAction(object sender, EventArgs args) { NewChild(); }
|
||||
protected void RenameAction(object sender, EventArgs args) { Rename(); }
|
||||
protected void DeleteAction(object sender, EventArgs args) { Delete(); }
|
||||
|
||||
public void Rename()
|
||||
{
|
||||
|
@ -528,6 +534,56 @@ namespace Bfres.Structs
|
|||
}
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
//For these to work
|
||||
//Shift bone node array in skeleton
|
||||
//Shift all indices in each shape's bone list
|
||||
//Shift every index in all the vertices indices from the changed node array
|
||||
//Shift every bone index in the shape
|
||||
//Shift each smooth index in each bone
|
||||
//Shift each rigid index in each bone
|
||||
//Remove the existing inverse matrix from the list
|
||||
|
||||
string MappedNames = "";
|
||||
var model = ((FSKL)skeletonParent).GetModelParent();
|
||||
|
||||
int CurrentIndex = GetIndex();
|
||||
|
||||
if (model.Skeleton.bones.Count == 1)
|
||||
{
|
||||
MessageBox.Show("A single bone must exist in every model!", "Bone Delete",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var shape in model.shapes)
|
||||
{
|
||||
if (shape.BoneIndex == CurrentIndex)
|
||||
MappedNames += $"{shape.Text}\n";
|
||||
|
||||
if (shape.BoneIndices.Contains((ushort)CurrentIndex))
|
||||
MappedNames += $"{shape.Text}\n";
|
||||
}
|
||||
if (MappedNames != "")
|
||||
{
|
||||
var result = STOptionsDialog.Show("Shapes are mapped to this bone. Are you sure you want to remove this? (Will default to first bone)",
|
||||
"Bone Delete", MappedNames);
|
||||
|
||||
if (result == DialogResult.Yes)
|
||||
RemoveBone(model, CurrentIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveBone(model, CurrentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveBone(FMDL model, int CurrentIndex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ImportChild()
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
|
|
Binary file not shown.
44
Toolbox/Lib/Licenses/SharpYaml COPYRIGHT.txt
Normal file
44
Toolbox/Lib/Licenses/SharpYaml COPYRIGHT.txt
Normal file
|
@ -0,0 +1,44 @@
|
|||
Copyright (c) 2013-2016 SharpYaml - Alexandre Mutel
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
SharpYaml is a fork of YamlDotNet https://github.com/aaubry/YamlDotNet
|
||||
published with the following license:
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2008, 2009, 2010, 2011, 2012 Antoine Aubry
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
BIN
Toolbox/Lib/SharpYaml.dll
Normal file
BIN
Toolbox/Lib/SharpYaml.dll
Normal file
Binary file not shown.
|
@ -357,6 +357,9 @@
|
|||
<Content Include="Lib\SFGraphics.Utils.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Lib\SharpYaml.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Lib\Syroot.BinaryData.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in a new issue