Using a custom Effect with XNAnimation Library

Aug 16, 2009 at 9:21 PM

So, I've been trying out the library, and it seems great so far!

However, there is one thing I have a problem with. The skinnedeffect which is assigned by default. I need to use my own effect on my models. I've done some tests and assigned an effect manually, but if I do that I lose all the exported properties. I guess thats lost when the skinnedmodelbasiceffect is assigned.

So, I wonder, is there a way of skipping the effect assignment done in the model processing? I basically assign all material parameters and textures in 3dsmax, and they are exported fine using .x exporter. But, I lose them using the skinnedmodelbasiceffect.

Any help would be great! Thanks!



Aug 24, 2009 at 9:56 PM

So, I solved this by commenting out the parts in the model processor that dealt with the effect. It worked well :)

Nov 3, 2009 at 3:25 PM

hi all,
i am facing with the same problem, all the material have been lost when using own effects,

but i dont know to comment which parts in the model processor,

any clues?



Nov 7, 2009 at 1:55 PM

Same Problem.

How do you comment which class n function? Also are you referring to the source?


Nov 7, 2009 at 3:12 PM

ok, I upgraded and referenced the xnanimation and the pipeline directly in my solution.

You can also open the animation library source and edit and recompile the dlls.

Anyway, the file I edited was:


and in this function

public override SkinnedModelContent Process(NodeContent input, ContentProcessorContext context)


scroll down to

// Process model's materials
//ProcessMaterials(input, context);


So, I just commented out the ProcessMaterials function, and recompiled.

It will now just skip doing anything to the material. Well, Im a newbie also, but this seems to work fine, and itll keep whatever shader you have assigned to the meshes. I use a scripted material which references an .fx file. Works alright, and I dont really have to do anything with the material, everything comes through fine.