Error building game with blender model


I installed 3.6 and created an OpenGL (cross platform) project in visual studio. I added a simple blender model in the content manager and it builds just fine. When building the project in visual studio i get the following error:

1>------ Build started: Project: TestGame, Configuration: Debug Any CPU ------ 1> C:/Users/myuser/Projects/TestGame/TestGame/Content/House_1.blend 1> 1> Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 1> at Assimp.Unmanaged.AssimpLibrary.ImportFile(String file, PostProcessSteps flags, IntPtr fileIO, IntPtr propStore) 1> at Assimp.AssimpContext.ImportFile(String file, PostProcessSteps postProcessFlags) 1> at Microsoft.Xna.Framework.Content.Pipeline.OpenAssetImporter.Import(String filename, ContentImporterContext context) 1> at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(PipelineBuildEvent pipelineEvent, PipelineBuildEvent cachedEvent, String eventFilepath)
1> at MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.BuildContent(String sourceFilepath, String outputFilepath, String importerName, String processorName, OpaqueDataDictionary processorParameters)
1> at MGCB.BuildContent.Build(Int32& successCount, Int32& errorCount)
1> at MGCB.Program.Main(String[] args)
1>C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.Content.Builder.targets(90,5): error MSB3073: The command ““C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe” /@:“C:\Users\myuser\Projects\TestGame\TestGame\Content\Content.mgcb” /platform:DesktopGL /outputDir:“C:\Users\myuser\Projects\TestGame\TestGame\Content\bin\DesktopGL” /intermediateDir:“C:\Users\myuser\Projects\TestGame\TestGame\Content\obj\DesktopGL” /quiet” exited with code -1073741819.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Thanks for help.


I just found out that when I use an .obj, i get a green icon in the status list in the content manager. When using the .blend file it just does nothing. The clock icon is next to the file and the final status message does not get displayed.

I don’t do any blender stuff but I’m sure you will need to export your model in blender to a format the the contents pipeline can recognise.

I tend to export as .fbx rather than use the .blend file directly. .fbx files are pretty solid :slight_smile:

Exporting and importing is a sure thing. Monogame uses assimp for importing, which does support blender. I just don’t know if this is a monogame issue or a problem within assimp.

The callstack shows it is an issue inside AssImp with importing the .blend file. The MonoGame content pipeline does no special processing on 3D file formats. We just pass the file to AssImp and get the mesh data back.

MG’s version of assimp needs an update though. Assimp 4.0 was recently released, so it’s a good time to update. They didn’t include binaries in the release, so we’ll have to build assimp for all platforms ourselves.