Loading model at run-time

Nov 30, 2009 at 7:49 PM

Hello,

I'm trying your engine for my new title ( http://foxcoon.free.fr/3dvf_forum/ChibisBomba_Promo_1.jpg )

Your engine seems to have everything I need but a good game needs a good editor.

To write a good editor I need to load model at run time

I tried to use the sample : http://creators.xna.com/fr-FR/sample/winforms_series2 with the Xen.Ex.ModelImporter class without success

When I do

contentBuilder.Add(XXX,XXX, null, "ModelImporter");

I get the error : "Cannot find content processor "ModelImporter"."

 

Does someone have a clue ?

 

Thanks you !

 

Coordinator
Dec 1, 2009 at 10:36 AM

Hi. I've had a really quick look at what is going on, unfortunately I can't look to deeply right now.

From what I can see, the ContentBuilder is hard coded to link to the four main XNA content pipeline DLLs (eg, FBXImporter). So it will need to be modified to also reference the xen model importer dll. If you look in the code for ContentBuilder, you can see code setting up the 'pipelineAssemblies' string array. This is hard coded to link to the .dlls by assembly FullName.
I'd recommend (as a starting point) adding support with that class to link to an Assembly (ideally, directly through the Assembly object - not through string name, as the xen .dlls won't be in the GAC). I'm not sure what else may be needed after that...

Your game looks excellent btw :-)

Dec 1, 2009 at 11:36 PM

"you can see code setting up the 'pipelineAssemblies' string array"

That's what I tried but I would have to sign all Xen assembly and send all to the GAC :/

"I'd recommend (as a starting point) adding support with that class to link to an Assembly"

What do you mean exactly ?

Everything seems to be added as a string to the BuildEngine 

 // Register any custom importers or processors.
foreach (string pipelineAssembly in pipelineAssemblies)
{
      msBuildProject.AddNewItem("Reference", pipelineAssembly);
}

You know another way to do it ?

Thank you for your work !

 

Coordinator
Dec 2, 2009 at 12:56 AM
Edited Dec 2, 2009 at 12:57 AM

I was thinking about this again,

provided the model importer .dll is in the currently working directory then it should load OK without being in the gac.

A way to do this, would be to add a method to the builder class, which adds extra refernces to the pipelineAssembly string list...
And by far the most reliable way, would be to pass in a reference to an assembly object.

So, something like this:

public void AddReference(System.Reflection.Assembly asm)
{
    pipelineAssembly.Add(asm.FullName);
}

And call it something like this:

builder.AddReference(typeof(Xen.Ex.ModelImporter.ModelImporter).Assembly);

I guess the string you'd pass in for the creation type would then be "Xen.Ex.ModelImporter.ModelImporter", but I'm not 100% sure how the builder class has been designed.

Dec 2, 2009 at 11:59 AM

"I was thinking about this again,

provided the model importer .dll is in the currently working directory then it should load OK without being in the gac.

A way to do this, would be to add a method to the builder class, which adds extra refernces to the pipelineAssembly string list..."

Already tried but it never worked :/

"And call it something like this:

builder.AddReference(typeof(Xen.Ex.ModelImporter.ModelImporter).Assembly);"

There's nothing like that, it seems the build engine really likes strings...

 

Hope we'll find how to process !

Thanks



Feb 25, 2011 at 10:36 AM
Edited Feb 27, 2011 at 5:22 PM

Hey Everyone,

On this moment I've got the same problem. Has anyone found  a solution to this problem?

I have tried adding the dll by string/location and by adding it to the GAC. It still gives the same error: "ModelImporter" processor not found.

Is everyone sure the string that you need to pass as processor is "ModelImporter" because the standard FBX/X processor = "ModelProcessor".

I also tried adding the namespaces to the string ("Xen.Ex.ModelImporter.ModelImporter") etc. but nothing seems to work.

 

Thanks in advance,

Feb 27, 2011 at 5:22 PM

Hey Everyone,

StatusUnknown helped me with the problem and I think its nice to share the solution for other people that maybe get this problem.

it was rather simple actually! I loaded the debug dll and It should have been the dll from the shared bin folder.

Just pass it into the pipelineAssemblies like this and it works ;)  @"(your folders)\Xen\bin\Xen.Ex.ModelImporter\Xen.Ex.ModelImporter.dll",          

 

Greetings,