Montana Jones

This will probably be quite obvious once the answer is explained to me, but i am using a custom model processor, whenever i use it on .x models that are are added to the project (not just linked to but actually copied into projects directory) i get an error that more than one asset with that name is produced when i try to build, while if i use the custom processor on a model that is only linked from another project, it doesn't complain at all. How can i stop duplicates from occurring when i am using non-linked content

(Thanks)


Re: XNA Game Studio Express Custom Processors and Asset Duplication

Shawn Hargreaves - MSFT

What exactly is the wording of the error

Is there any chance you have some other asset with the same asset name in your project Maybe an effect or texture that shares the same name as the mesh





Re: XNA Game Studio Express Custom Processors and Asset Duplication

Montana Jones

Hmm, the exact wording is "More than one output asset is named '<asset_name>'. You must explicitly specify asset names to resolve the conflict".

And theres no chance of me having another asset with the same name and different extension in the project as there are only five assets, if i set the Content PRocessor for any of the non-linked assets to my processor it gives this error, if i set it back to 'Model - XNA Framework' its fine and doesn't give me this error, while if i use it for any of my linked in models i don't get the error message for either of the processors.

(thanks for the help :) )




Re: XNA Game Studio Express Custom Processors and Asset Duplication

Shawn Hargreaves - MSFT

Can you give some more details of what your custom processor does Maybe post the code for it





Re: XNA Game Studio Express Custom Processors and Asset Duplication

Montana Jones

Oh, right yeah, sorry, It extends the ModelProcessor class,

overriding the Process method only:

public override ModelContent Process(NodeContent input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context)
{
ModelContent modelContent = base.Process(input, context);

ProcessInfo(input, modelContent);

return(modelContent);
}


clearly all the additional work takes place in ProcessInfo, its a fair amount of code, too much to post up i think, but all it does is traverse the NodeContent passed into it and modify the ModelContent by adding custom data structures to tag properties.

I also wrote a ContentTypeWriter specifically for the custom data structure i added in the Tag properties (so it didn't extend ContentTypeWriter<ModelContent>, it extended ContentTypeWriter<NewDataStructure>) and when i process a linked asset, my reader can indeed read what the contentwriter wrote and i can use the content in my application and i have gotten the expected results with the test cases i have used so far. There's too much code too post here, but if no one has the foggiest idea still, i was hoping to post it on my website as a starting point for anyone else looking to write a processor for animation data (if that animation sample is going to be caught up in the release process for much longer), people can take a better look at it then, but it would be nice to get it fixed up before then




Re: XNA Game Studio Express Custom Processors and Asset Duplication

Montana Jones

in fact, if i comment out the ProcessInfo line and the processor is in effect doing nothing (and i also comment out the stuff i do in the Write method of the contenttypewriter for the custom data structure, leaving the Write method empty i still get this problem anyway (the content writer shouldn't even be called anyway since without that ProcessInfo line, the custom data structure isn't added to the any of the Tags in modelContent, so it looks like an empty processor that extends ModelProcessor is enough to cause this problem.

At least for me anyway, does anyone else get this problem




Re: XNA Game Studio Express Custom Processors and Asset Duplication

Montana Jones

Has anyone extended any other type of built in processor and come across the same problem as i said above, writing an empty processor that extends the ModelProcessor class is enough to cause the problem for me, is it something to do with my project configuration i don't recall changing it from the default config tho




Re: XNA Game Studio Express Custom Processors and Asset Duplication

Jon Watte

No, I've done that and it works fine.






Re: XNA Game Studio Express Custom Processors and Asset Duplication

Montana Jones

hmm ok, thats strange cos i have a similar issue when using shaders, and this is just using the default Effect Processor, though its the other way around, if i link it in it doesn't work, i can't load it from the pipeline, when i do try i get an exception during runtime saying it couldn't be found (on the 360), however if i actually add it (not just add a link to it) to the 360 project, the same code loads it up absolutely fine (and the effect works)