public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <VertexBufferContent>(new VertexBufferWriter()); manager.RegisterTypeWriter <IndexCollection>(new IndexBufferWriter()); // TODO: implement MaterialWriter //manager.RegisterTypeWriter<MaterialContent>(new MaterialWriter()); }
static void Main(string[] args) { log4net.Config.BasicConfigurator.Configure(new log4net.Appender.DebugAppender()); _opaqueData["TextureType"] = TextureType.Texture2D; if (!ParseCommandLine(args)) { return; } if (string.IsNullOrEmpty(_outputName)) { _outputName = string.Format("{0}.meb", Path.GetFileNameWithoutExtension(_imageName)); } //GetTypeWriters(); ProcessAssemblies(); string ext = Path.GetExtension(_imageName).ToLower(); var imp = _importers.FirstOrDefault(i => i.attribue.FileExtensions.Contains(ext)); if (imp.type == null) { Console.WriteLine("file format is not handled by TextureImporter."); return; } ContentManager manager = new ContentManager(_log); ContentTypeWriterManager contentTypeWriterManager = new ContentTypeWriterManager(); contentTypeWriterManager.RegisterTypeWriter <Texture2DContent>(new Texture2DWriter()); IContentImporter importer = CreateImporter(imp.type, _opaqueData); var content = importer.Import(_imageName, manager); IContentProcessor processor = CreateProcessor(FindDefaultProcessor(importer.GetType()), _opaqueData); object processedContent = processor.Process(content, new ContentProcessorContext()); ContentTypeWriter typeWriter = GetTypeWriter(processedContent.GetType()); using (FileStream stream = new FileStream(_outputName, FileMode.OpenOrCreate)) { ContentWriter writer = manager.CreateWriter(contentTypeWriterManager, stream); writer.WriteObject(processedContent, typeWriter); writer.Flush(); } }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <Matrix4>(new MatrixWriter()); manager.RegisterTypeWriter <VertexBufferContent>(new VertexBufferWriter()); manager.RegisterTypeWriter <IndexCollection>(new IndexBufferWriter()); manager.RegisterTypeWriter <Minotaur.Core.BoundingSphere>(new BoundingSphereWriter()); manager.RegisterTypeWriter <MaterialContent>(new MaterialWriter()); manager.RegisterTypeWriter <BoneAnimationsContent>(new BoneAnimationWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <VertexAttribute>(new VertexAttributeWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <Vector3>(new Vector3Writer()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <Quaternion>(new QuaternionWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <Minotaur.Core.BoundingSphere>(new BoundingSphereWriter()); //manager.RegisterTypeWriter<ModelMeshPartContent>(new ModelMeshPartWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <VectorKey>(new VectorKeyWriter()); manager.RegisterTypeWriter <QuaternionKey>(new QuaternionKeyWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <ShaderSourceContent>(new ShaderSourceWriter()); manager.RegisterTypeWriter <UniformValueContent>(new UniformValueWriter()); manager.RegisterTypeWriter <Color4>(new ColorWriter()); }
public override void Initialize(ContentTypeWriterManager manager) { manager.RegisterTypeWriter <Texture2DContent>(new Texture2DWriter()); }