nine.content in 1.6

Apr 3, 2013 at 11:26 AM
Edited Apr 3, 2013 at 11:43 AM
hello yufei

i´ve written a simple .blend-pipeline-importer - to natively get .blend-files compiled into XNB´s ...

now to get the nine 1.6-pipeline up and running i added a simple console project that uses the Nine.Serialization.Package.BuildDirectory - method to traverse an entire directory-tree and screw contents into one package.

i built a wrapper around my blend-importer and defined the corresponding XmlnsDefinition to this wrappers namespace.

so the wrapper seems to get correctly booted (.importer definition file is found, ...)

now i get an error with which a can´t do anything - except believe i´m missing something relevant:
NotSupportedException - Don't know how to write: Microsoft.Xna.Framework.Graphics.Model

can u help me?

or have you thought a better way to precompile all assets of a game?

my goal would be to have a small set of precompiled asses-package-binaries for my game (for each target platform)

thanx a lot
Apr 3, 2013 at 11:59 AM
Edited Apr 3, 2013 at 12:00 PM
This is still a work in progress. You cannot write Model, ModelContent -> Model is a one way street.

What I have in mind is to find a place to keep a mapping between ModelContent and Model, to load a Model, you need to first get the ModelContent with XNA model importer and processor, and then the ModelContent is compiled into xnb and finally loaded into Model. The mapping from Model to ModelContent has to be stored somewhere, so when you’re trying to write a model, it’ll first find the ModelContent and write that ModelContent.

I have this logic working with SpriteFont so far using ISerializationOverride, see SpriteFontImporter.cs, but I still need some changes for it work from end to end. Especially when you consider a XAML scene that contains a model, when you are trying to save that scene, you don’t want to save the content (verts & indices) of the model, but rather just a string reference to where the model should be loaded.

Thanks for trying out the lasted unstable develop-in-progress version of Nine, I really approciate that and hope you enjoy it. If you’d like to, I’ll be more than happy to adopt your changes and together we can make things better.
Apr 3, 2013 at 12:47 PM
Edited Apr 3, 2013 at 12:57 PM
hmmm - my importer uses the pipeline-dom as output-format --> that is it generates a nodecontent-tree (eg. modelcontent, animationcontent, ...)
i´m getting the same error with an fbx-model ... thats clear cause i simply copied your FbxModelImporter ;-)

so you are not going to use XNB as carrier-format. instead you are going to have a new intermediate-format?

if i´d more time i would love to work with you on nine - i´ll take a closer look into it all ...
Apr 3, 2013 at 3:11 PM
i´m not sure but:
currently i cannot instruct class Package to construct something else than the default model-prcessor of the importer defines (normally Xna.Model - which cannot be written yet within the BinarySerializer).

would it a way to re-implement the package-class to use class ContentPipeline (with the pipeline-builder inside) instead? this would be a task that i could take over ...

as i understand now the "package" should only be a ZIP-archive containing more .xnb´s
Apr 6, 2013 at 3:13 AM
No, the package is a zip archive of a custom binary format used by Nine.Serialization.BinarySerializer.
Apr 12, 2013 at 11:12 PM
with the latest commit it works

thank you!
May 1, 2013 at 9:33 PM
Edited May 2, 2013 at 7:13 AM