XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Loading a Model in a Custom Processor

Last post 03-25-2008 12:35 PM by Ultrahead. 4 replies.
  • 03-24-2008 1:58 PM

    Loading a Model in a Custom Processor

    Hey everyone,

    I'm trying to load a model in a custom processor I built. I've tried to use the same pattern i've seen everywhere for loading textures.  This is the basic line of code I'm using:

    Model = new ExternalReference<ModelContent>(input.Name + ".fbx");

    When I run my game everything seems fine but when I check to make sure the model is there all I have is nulls.  Can someone point me in the right direction, because I can't find a single example of loading a model like this anywhere.

    Thanks,

    Origin

  • 03-24-2008 2:17 PM In reply to

    Re: Loading a Model in a Custom Processor

    Have you tried just using:

    Model = new ExternalReference<ModelContent>(input.Name);


    -----------------------------------------------
    Jim Welch
  • 03-24-2008 3:32 PM In reply to

    Re: Loading a Model in a Custom Processor

    That doesn't work because I'm not trying to reference a model I've already loaded into the Content Manager. Instead, I'm trying to add the model dynamically at compile time.

    Thanks for the reply though.
  • 03-24-2008 3:56 PM In reply to

    Re: Loading a Model in a Custom Processor

    Ok. I think I understand your issue now.

    -----------------------------------------------
    Jim Welch
  • 03-25-2008 12:35 PM In reply to

    Re: Loading a Model in a Custom Processor

    Answer

    My guess is that either you're referencing to the incorrect path or you didn't tell the CP to build the "external" model.

    // Take into account that you must set the build acyion to none so as to avoid creating 2 ".xnb" files.
    ModelProcessor myModelContent = context.BuildAsset<ModelContent, ModelContent> (new ExternalReference<ModelContent>(input.Name + ".fbx"), typeof(ModelProcessor).Name);

    For the latter use, base on your code, something like: For the former, read this thread: http://forums.xna.com/thread/5274.aspx

    ~Pete Need guidance? Just remember: Do as I say, not as I do ...
Page 1 of 1 (5 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG