Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can one extend a model processor inside Windows Forms. In a normal XNA game you would simply create a new class like so(I think...):

public class ExtendedModelProcessor : ModelProcessor
    protected override ModelContent Process(NodeContent input, 
        ContentProcessorContext context)
        ModelContent m = base.Process(input,context)
        //my own code

How can I duplicate this inside Windows Forms project, I am working on a project from microsoft site, "WinFormsContentLoading sample". I tried creating a class like above, but didnt work, then I tried to change the processor on contentBuilder.Add(...,"ExtendedModelProcessor"). And I also tried creating a new .dll ContentExtensionLibrary and then adding it inside ContentBuilder class, under:

static string[] pipelineAssemblies =
    "Microsoft.Xna.Framework.Content.Pipeline.FBXImporter" + xnaVersion,
    "Microsoft.Xna.Framework.Content.Pipeline.XImporter" + xnaVersion,
    "Microsoft.Xna.Framework.Content.Pipeline.TextureImporter" + xnaVersion,
    "Microsoft.Xna.Framework.Content.Pipeline.EffectImporter" + xnaVersion,
    Application.StartupPath + "\\myDll.dll"

And adding the .dll to the same folder as the program. But nothing worked. How can I create an extension for ModelProcessor inside Windows Forms?


share|improve this question
Anyone........? – user1806687 Feb 21 '13 at 17:24
up vote 1 down vote accepted

Everything you have done so far seems correct. You just need the last step, which is to change the content builder configuration so that it actually uses your processor to build the model.

So open up MainForm.cs (right click it and select "View Code") and scroll down to line 100 (in the original sample). Then change this:

contentBuilder.Add(fileName, "Model", null, "ModelProcessor");

To match the name of your content processor, like this:

contentBuilder.Add(fileName, "Model", null, "ExtendedModelProcessor");

If you get an error message that says:

Cannot find content processor "ExtendedModelProcessor".

Then you need to fix up the path you specify in pipelineAssemblies (in ContentBuilder.cs) that points to your DLL. Any other error probably means that there's something wrong with your processor itself.

I notice you were trying to do this without creating a DLL at first. You can certainly do that, if you like. You can use your EXE in place of a DLL (they are both assemblies). But you still need to specify its path in the pipelineAssemblies array.

share|improve this answer
Silly me, thanks :D – user1806687 Feb 22 '13 at 16:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.