A few fixes.

Fix viewport not loading base drawables.
Fix animation player having issues with new animation classes.
Fix gfmdl for pkmn lets go.
Disable vertex color loading for gfmdl for now till fixed.
This commit is contained in:
KillzXGaming 2019-11-12 16:29:00 -05:00
parent 761432a140
commit b225c942e5
5 changed files with 39 additions and 10 deletions

View file

@ -165,8 +165,10 @@ namespace FirstPlugin
Version = reader.ReadUInt32();
Boundings = reader.ReadSingles(9);
if (Version >= 32)
reader.ReadUInt32();
//This value is usually 68 for pkmn sw/sh
uint check = reader.ReadUInt32();
if (check > 100)
reader.Seek(-4);
long TextureOffset = reader.ReadOffset(true, typeof(uint));
long ShaderNameOffset = reader.ReadOffset(true, typeof(uint));
@ -324,8 +326,8 @@ namespace FirstPlugin
vertex.boneWeights = new List<float>(Buffer.Weights[v]);
if (Buffer.BoneIndex.Count > 0)
vertex.boneIds = new List<int>(Buffer.BoneIndex[v]);
if (Buffer.Colors1.Count > 0)
vertex.col = Buffer.Colors1[v] / 255f;
// if (Buffer.Colors1.Count > 0)
// vertex.col = Buffer.Colors1[v] / 255f;
if (Buffer.Binormals.Count > 0)
vertex.bitan = Buffer.Binormals[v];

View file

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Xml;
using System.IO;
namespace Toolbox.Library
namespace Toolbox.Library.Collada
{
public class ColladaWriter : IDisposable
{
@ -84,9 +84,36 @@ namespace Toolbox.Library
Writer.WriteEndElement();
}
public void WriteLibraryMaterials(List<Material> materials)
{
Writer.WriteStartElement("library_materials");
for (int i = 0; i < materials?.Count; i++)
{
Writer.WriteStartElement("library_effects");
Writer.WriteEndElement();
}
Writer.WriteEndElement();
}
public void WriteLibraryEffects(List<Material> materials)
{
Writer.WriteStartElement("library_effects");
for (int i = 0; i < materials?.Count; i++)
{
Writer.WriteStartElement("library_effects");
Writer.WriteEndElement();
}
Writer.WriteEndElement();
}
public void Dispose()
{
Writer.Close();
}
}
public class Material
{
public string Name { get; set; }
}
}

View file

@ -232,8 +232,8 @@ namespace Toolbox.Library
private void animationPlayBtn_Click(object sender, EventArgs e)
{
if (currentAnimation == null || currentAnimation.FrameCount <= 0 &&
stCurrentAnimation == null || stCurrentAnimation.FrameCount <= 0)
if (currentAnimation?.FrameCount <= 0 &&
stCurrentAnimation?.FrameCount <= 0)
return;
if (AnimationPlayerState == PlayerState.Playing)

View file

@ -248,11 +248,11 @@ namespace Toolbox.Library
var skybox = new DrawableSkybox();
var background = new DrawableBackground();
/* scene.staticObjects.Add(floor);
scene.staticObjects.Add(floor);
scene.staticObjects.Add(xyzLnes);
scene.staticObjects.Add(skybox);
scene.staticObjects.Add(background);
*/
// scene.objects.Add(new SingleObject(new Vector3(0, 0, 0)));
// LoadFog();

View file

@ -247,7 +247,7 @@
<Compile Include="Compression\Formats\Zlib.cs" />
<Compile Include="Config.cs" />
<Compile Include="Enums\CompressionType.cs" />
<Compile Include="FileFormats\DAE\DAE_Writer.cs" />
<Compile Include="FileFormats\DAE\ColladaWriter.cs" />
<Compile Include="FileFormats\DDS\RGBAPixelDecoder.cs" />
<Compile Include="FileSystem\VirtualFileTreeNode.cs" />
<Compile Include="FileSystem\VirtualTreeNode.cs" />