MonoGame ModelProcessor

654 views Asked by At

Is there a MonoGame's equivalent of XNA's ModelProcessor?

I am using a custom AnimatorProcessor class, derived from ModelProcessor, similar to what's done in the "better skinned sample":

[ContentProcessor(DisplayName = "Animation Processor")]
public class AnimationProcessor : ModelProcessor
{
    // custom stuff
}

I am now trying to port this code to MonoGame, but it seems that (although MonoGame recently got its own pipeline) there is no ModelProcessor class in MonoGame pipeline projects.

I could use XNA pipeline, but the issue is then that all the model content classes use actual XNA classes/structs (vectors, quaternions), which reside in exactly the same namespace as MonoGame's, creating compile time conflicts in my main project. Meaning that I should map these classes from one assembly (XNA) to the other one (MonoGame), which is rather fugly.

(Update)

I realized that MonoGame indeed has a ModelProcessor inside its MonoGame.Framework.Content.Pipeline assembly, but then there is an additional MonoGame.ContentPipeline assembly (for which I am not sure if it's obsolete, or still has to be used within the pipeline).

But if I rebuild my AnimationProcessor to use the MonoGame's ModelProcessor, then Visual Studio cannot use it to import/process my fbx file. Building the content project fails with "Cannot find content processor 'AnimationProcessor'", and it's not even offered as an option in the drop down box for .fbx file (probably because Visual Studio looks for classes derived from XNA's processors, and it doesn't care for MonoGame).

Does anyone know how I should import the fbx content using a custom processor, and still have MonoGame classes instead of XNA's?

1

There are 1 answers

1
Dean Ellis On

MonoGame has its own content pipeline now. So what you really need to do is port your custom processors over to a new library which references the MonoGame.Framework.Content.Pipeline assembly. This library will then be compatible with the Pipeline tool.

You can find the documentation on this at http://www.monogame.net/documentation/?page=Using_The_Pipeline_Tool. Specifically look at the section for Custom Content Processors.