Iām home in about one and a half hours depending on traffic. Then I will have a little time window of one hour to try this out before I have to leave again. Donāt know when Iāll be back home, I think at night. I thinking about a day off to work on MonoGame projects
Changed the line and everything compiled just fine. Now I tried to rebuild all content, to make it compatible with the latest MonoGame source version. I was getting several āBad tangent!ā popups but all content got compiled and nothing was marked as failed.
So far so good. I looked up the old XNA project, what the setup for importer and processor was for the hellknight model. It was set to āMD5Importerā and āMD5Processā. Now after setting up the reference to the MD5ContentPipeline project inside the pipeline tool I can only find the āMD5Processā entry for the model processor. I think these images explain it very good.
Also another issue is, that I opened up the MGCB file from my āEngineMGā project and some content appears at a wrong level. By level I mean directory level. I have directories for shaders, textures and so on. Also I think it should be explained good by an image what I mean (also notive the path visible in the image).
Iām already late so I cannot try to just readd all content to a new MGCB file⦠Maybe then it works?!
Hmm, I donāt know why the importer wouldnāt show up⦠When you have time to look at this again can you double check if the same syntax is used as the built in importers?
I havenāt seen the treeview issue before either, but itās probably not an issue when building.
What I can say now after some more tests is that if I create a new MGCB with the MonoGame pipeline tool from the latest source and add all folders (add existing folder for the five top level folders) all works as it should. So the new pipeline tool has some problems reading the old MGCB file.
Also the NullPointerException in CellBase.cs occured because I did not specify a string like so:
[ContentProcessor(DisplayName = "MD5Mesh Processor")]
Now that I added this to both the importer and processor, they show up in the pipeline tool and I can select the hellknight.md5mesh file without NullPointerException.
A KeyNotFoundException is thrown when I try to build the hellknight.md5mesh file:
Build started 28.01.2017 00:27:30
C:/MonoGame/EngineMG/EngineMG/Content/model/hellknight/hellknight.md5mesh
C:/MonoGame/EngineMG/EngineMG/Content/model/hellknight/hellknight.md5mesh: error: Importer 'MD5Importer' had unexpected failure!
System.Collections.Generic.KeyNotFoundException
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshHelper.IndexUpdateList.Update(Int32 from, Int32 to) in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshHelper.cs:Zeile 710.
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshHelper.MergeDuplicatePositions(MeshContent mesh, Single tolerance) in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshHelper.cs:Zeile 414.
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.MeshBuilder.FinishMesh() in C:\MonoGame.Framework.Content.Pipeline\Graphics\MeshBuilder.cs:Zeile 162.
at MD5Loader.MD5Importer.createMesh(NodeContent rootNode, SMeshInfo mesh) in C:\MonoGame\EngineMG\MD5LoaderPipelineExtensionLibraryMG\CMD5Importer.cs:Zeile 559.
at MD5Loader.MD5Importer.Import(String filename, ContentImporterContext context) in C:\MonoGame\EngineMG\MD5LoaderPipelineExtensionLibraryMG\CMD5Importer.cs:Zeile 168.
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context) in C:\MonoGame.Framework.Content.Pipeline\ContentImporter.cs:Zeile 45.
at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent) in C:\MonoGame.Framework.Content.Pipeline\Builder\PipelineManager.cs:Zeile 651.
Build 0 succeeded, 1 failed.
Time elapsed 00:00:00.57.
Crap, thatās definitely a bug in the implementation Are you willing to share the project so I can debug this?
EDIT: Hold on, I think I might now what Iām doing wrong. Iām gonna try and write a test that catches this and get a fix in.
I now realize I made some big mistakes when implementing this Iāll see if I can get this fixed.
EDIT: Itās not as bad as I initially thought I think this is actually not that hard to fix!
EDITEDIT: I set up a PR with my fixed, the build bots are having some issues currently, so the only way to try it is from source if youāre up for that @Kwyrky. PR is at https://github.com/MonoGame/MonoGame/pull/5444
Damn, I really need to get this implementation right
Animation stuff is not that easy. How complicated is it?
I was just talking about the meshbuilder. Itās the vertex merging code that has some issues. Itās a bit complex because you have to compute hashes and use some indirection for addressing indices to get it to be reasonably fast. If you do it naively itās N^2 complexity and takes way too long for a practical number of vertices. Donāt you have custom classes for animation?
I meant how complicated is the MeshBuilder implementation
Was saying that animation stuff is not easy because I thought this is perhaps the thing which makes it difficult to implement the MeshBuilder. But as I now understood it seems to be the vertex merging, so the part, which gets rid of unnecessary doubles of vertices?!
Yes, exactly. Thereās nothing difficult about MeshBuilder itself It does not support animation.
Good to hear that its now āonlyā the merging stuff, which is in the way of using the hellknight in MonoGame
Havenāt worked on it anymore. I put too much on my plate all at once Iāll try and get back to it soon.
Iāll do that. Iād really like to fix this up in the next few weeks, but uni is swamping us with projects this semester and that takes priority, so no guarantees
In the meantime, I will try to convert some more XNA projects to MonoGame
If anybody is interested in the XNA 4.0 content pipeline extension plus the animated model with textures, send me a pm. I donāt have the time or the knowledge to modify the MonoGame source, so that the model can be imported to MonoGame. But maybe someone wants to look at it.
Thatād be great. If anyone wants to help out, ping me and Iāll get you started.