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

Adjust assimp version to a more stable build. Add bmd replacing/exporting

This commit is contained in:
KillzXGaming 2019-07-12 19:44:17 -04:00
parent 7364a1d6e1
commit d9db8c3b09
13 changed files with 53 additions and 9 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ Debug/
Release/
BrawlboxHelper/BrawlHelperTest2.cs
BrawlboxHelper/BrawlHelperTest2.zip
Toolbox/Lib.zip

Binary file not shown.

View File

@ -95,6 +95,7 @@ namespace FirstPlugin
public DrawableContainer DrawableContainer = new DrawableContainer();
public Model BMDFile;
public STSkeleton Skeleton;
private TreeNode TextureFolder;
private TreeNode ShapeFolder;
private TreeNode MaterialFolder;
@ -107,12 +108,24 @@ namespace FirstPlugin
//Set renderer
Renderer = new BMD_Renderer();
Skeleton = new STSkeleton();
DrawableContainer.Name = FileName;
DrawableContainer.Drawables.Add(Renderer);
DrawableContainer.Drawables.Add(Skeleton);
Textures = new Dictionary<string, STGenericTexture>();
BMD_Renderer.TextureContainers.Add(this);
BMDFile = Model.Load(stream);
LoadBMD(BMDFile);
}
private void LoadBMD(Model model)
{
Nodes.Clear();
ShapeFolder = new TreeNode("Shapes");
SkeletonFolder = new TreeNode("Skeleton");
MaterialFolder = new TreeNode("Materials");
@ -122,13 +135,12 @@ namespace FirstPlugin
Nodes.Add(SkeletonFolder);
Nodes.Add(TextureFolder);
BMDFile = Model.Load(stream);
var skeleton = new STSkeleton();
DrawableContainer.Drawables.Add(skeleton);
FillSkeleton(BMDFile.Scenegraph, skeleton, BMDFile.Joints.FlatSkeleton);
BMDFile = model;
foreach (var bone in skeleton.bones)
FillSkeleton(BMDFile.Scenegraph, Skeleton, BMDFile.Joints.FlatSkeleton);
foreach (var bone in Skeleton.bones)
{
if (bone.Parent == null)
SkeletonFolder.Nodes.Add(bone);
@ -140,7 +152,6 @@ namespace FirstPlugin
var curShape = BMDFile.Shapes.Shapes[BMDFile.Shapes.RemapTable[i]];
var mat = new BMDMaterialWrapper(BMDFile.Materials.GetMaterial(i), BMDFile);
mat.Text = BMDFile.Materials.GetMaterialName(i);
MaterialFolder.Nodes.Add(mat);
var shpWrapper = new BMDShapeWrapper(curShape, BMDFile, mat);
@ -280,9 +291,35 @@ namespace FirstPlugin
{
List<ToolStripItem> Items = new List<ToolStripItem>();
Items.Add(new STToolStipMenuItem("Save", null, SaveAction, Keys.Control | Keys.S));
Items.Add(new STToolStripSeparator());
Items.Add(new STToolStipMenuItem("Export", null, ExportAction, Keys.Control | Keys.E));
Items.Add(new STToolStipMenuItem("Replace", null, ReplaceAction, Keys.Control | Keys.R));
return Items.ToArray();
}
private void ExportAction(object sender, EventArgs args)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Collada DAE |*.dae;";
if (sfd.ShowDialog() == DialogResult.OK)
{
BMDFile.ExportAssImp(sfd.FileName, "dae", new ExportSettings());
}
}
private void ReplaceAction(object sender, EventArgs args)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Collada DAE |*.dae;";
if (ofd.ShowDialog() == DialogResult.OK)
{
Arguments arguments = new Arguments();
arguments.input_path = ofd.FileName;
var model = Model.Load(arguments);
LoadBMD(model);
}
}
private void SaveAction(object sender, EventArgs args)
{
SaveFileDialog sfd = new SaveFileDialog();

BIN
Toolbox/Lib/Assimp32.dll Normal file

Binary file not shown.

BIN
Toolbox/Lib/Assimp64.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -301,9 +301,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="assimp.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Gl_EditorFramework.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -322,6 +319,12 @@
<Content Include="Lib\aamp_hashed_names.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Assimp32.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Assimp64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\AssimpNet.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@ -432,6 +435,9 @@
<Content Include="Lib\NAudio.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\Newtonsoft.Json.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\ObjectListView.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

Binary file not shown.