4 Replies - 1276 Views - Last Post: 22 July 2013 - 05:56 AM

#1 mgulde  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 09-July 13

Loading model during runtime with custom processor

Posted 09 July 2013 - 01:22 AM

Hello all,

I am currently programming an editor, which can load *.fbx models during runtime by making use of the MSBuild functionality based on an example given here: http://xbox.create.m...forms_series_2. Additionally, I use a custom model processor to link custom effects to my model. Separately, it works like a charm, but for some reason I do not seem to be able to bring it together.

The class of the custom model processor is called "CustomModelProcessor" and allows to manually set the DefaultEffect in the fbx model properties to whatever file one wants. If I now set the SetMetadataValue "Processor" to "CustomModelProcessor" for the ProjectItem within the MSBuild project, I get the error message that the processor has not been found. The class of the custom model processor is referenced within the MSBuild project and also set in the using statement.

In general, I must confess that I am anything but sure about the key value pair names I can set at this point, since also "ModelProcessor" - the default and working processor - is different from "Content Processor" as given in the property tab of the fbx-model, when I load it into the project manually.

My questions are: How do I find out under what name the custom model processor can be set as the processor and how do I set the default effect file using the SetMetadataValue key value pairs?

Thanks a lot in advance,
Max

Is This A Good Question/Topic? 1
  • +

Replies To: Loading model during runtime with custom processor

#2 mgulde  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 09-July 13

Re: Loading model during runtime with custom processor

Posted 09 July 2013 - 02:48 AM

Hello all,

I made some progress concerning the above matter and can now specify my question: How do I set the build parameters for the model? I would like to have sth. like this in the end for the contentpipeline.xml file:

<Importer>FbxImporter</Importer>
<Processor>CustomModelEffect</Processor>
<Parameters>
   <Data Key="Effect">myEffectFile.fx</Data>
   <Data Key="GenerateTangentFrames">True</Data>
</Parameters>



I am able to set the importer and processor values now by using e.g.

projectitem.SetMetadataValue("Importer", importer);



but have no clue on how to set the remaining parameters.

Any ideas?

Cheers,
Max
Was This Post Helpful? 0
  • +
  • -

#3 mgulde  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 09-July 13

Re: Loading model during runtime with custom processor

Posted 10 July 2013 - 03:29 AM

Okay, problem has been solved and for those interested: The parameters can be looked up within the *.contentproj-file, e.g. "ProcessorParameters_TextureFormat" and then set accordingly.

There is a well documented source code available here: http://code.google.c.../3d-model-prep/

Cheers,
Max

Okay, problem has been solved and for those interested: The parameters can be looked up within the *.contentproj-file, e.g. "ProcessorParameters_TextureFormat" and then set accordingly.

There is a well documented source code available here: http://code.google.c.../3d-model-prep/

Cheers,
Max
Was This Post Helpful? 1
  • +
  • -

#4 mgulde  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 4
  • Joined: 09-July 13

Re: Loading model during runtime with custom processor

Posted 10 July 2013 - 04:23 AM

Okay, problem has been solved and for those interested: The parameters can be looked up within the *.contentproj-file, e.g. "ProcessorParameters_TextureFormat" and then set accordingly via the projectitem.setmetadatavalue() function.

There is a well documented source code available here: http://code.google.c.../3d-model-prep/

Cheers,
Max
Was This Post Helpful? 0
  • +
  • -

#5 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 591
  • View blog
  • Posts: 1,318
  • Joined: 24-April 12

Re: Loading model during runtime with custom processor

Posted 22 July 2013 - 05:56 AM

Do you (or anyone else for that matter) know where there are some .fbx models that have more than a single animation in them? "Dude" only has the "Take 001" animation and I would like to test my understanding of doing multiple animations.

Believe it or not, your question here has been at the forefront of my mind for the past 2 weeks. It got me to drop what I was working on (SDL) and refocus on extending the Content Pipeline and skinned animation which have, until now, been some of my weakest areas of knowledge. I have to confess that, even though I've modified the content pipeline a couple times and gone through several skinned animation tutorials and tried to mod them a bit, I'm still far from comfortable with either topic.

But I've spent the past 2 weeks trying to "get up to speed" to try and answer your question. I'm glad you found an answer because even though I understand what you're doing a whole lot better, I'm still not even fully understanding your question.

I think you will find that when you get to the level you are at, more often than not, you have to answer your own questions because its difficult to find anyone who knows more than you do about it.

So sorry that I wasn't able to help, but glad you found your answer! I've certainly learned a tremendous amount just trying to understand your question. And I'm getting the animation thing going fairly well.

And if you know where I might find some fully animated .fbx models, I would be much obliged if you pointed me in that direction.

This post has been edited by BBeck: 22 July 2013 - 05:58 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1