Пример #1
0
        public void Halo1TestCOLLADABSPExport()
        {
            using (var handler = new TagIndexHandler <Managers.TagIndex>(BlamVersion.Halo1_CE, kTestTagIndexTagsPath))
            {
                var tagindex = handler.IndexInterface;
                foreach (var model_def in BSPTestDefinitions)
                {
                    StartStopwatch();
                    {
                        model_def.Open(tagindex);
                        Console.WriteLine(model_def.TypeString + " LOAD: Time taken: {0}", m_testStopwatch.Elapsed);
                    }
                    Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch());

                    var halo1 = new BlamLib.Render.COLLADA.Halo1.ColladaHalo1(tagindex, model_def.TagIndex);

                    halo1.Overwrite        = true;
                    halo1.RelativeFilePath = Path.Combine(kTestTagIndexTagsPath, @"data\");

                    halo1.ClearRegister();

                    foreach (var info in halo1)
                    {
                        halo1.RegisterForExport(info);
                    }

                    var bsp_info = halo1[0] as Render.COLLADA.Halo1.ColladaHalo1BSPInfo;

                    StartStopwatch();
                    halo1.Export(bsp_info.Name);
                    Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", bsp_info.Name, StopStopwatch());

                    foreach (string report in halo1.Reports())
                    {
                        Console.WriteLine(report);
                    }

                    model_def.Close(tagindex);
                }
            }
        }
Пример #2
0
		public void Halo1TestCOLLADABSPExport()
		{
			using (var handler = new TagIndexHandler<Managers.TagIndex>(BlamVersion.Halo1_CE, kTestTagIndexTagsPath))
			{
				var tagindex = handler.IndexInterface;
				foreach (var model_def in BSPTestDefinitions)
				{
					StartStopwatch();
					{
						model_def.Open(tagindex);
						Console.WriteLine(model_def.TypeString + " LOAD: Time taken: {0}", m_testStopwatch.Elapsed);
					}
					Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch());

					var halo1 = new BlamLib.Render.COLLADA.Halo1.ColladaHalo1(tagindex, model_def.TagIndex);

					halo1.Overwrite = true;
					halo1.RelativeFilePath = Path.Combine(kTestTagIndexTagsPath, @"data\");

					halo1.ClearRegister();

					foreach (var info in halo1)
						halo1.RegisterForExport(info);

					var bsp_info = halo1[0] as Render.COLLADA.Halo1.ColladaHalo1BSPInfo;

					StartStopwatch();
					halo1.Export(bsp_info.Name);
					Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", bsp_info.Name, StopStopwatch());

					foreach (string report in halo1.Reports())
						Console.WriteLine(report);

					model_def.Close(tagindex);
				}
			}
		}
Пример #3
0
        public void Halo1TestCOLLADAModelExport()
        {
            using (var handler = new TagIndexHandler <Managers.TagIndex>(BlamVersion.Halo1_CE, kTestTagIndexTagsPath))
            {
                var tagindex = handler.IndexInterface;
                foreach (var model_def in ModelTestDefinitions)
                {
                    // load the tag with dependents
                    StartStopwatch();
                    {
                        model_def.Open(tagindex);
                        Console.WriteLine("{0} LOAD: Time taken: {1}", model_def.TypeString, m_testStopwatch.Elapsed);
                    }
                    Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch());

                    // create a halo1 collada interface with the gbxmodel datum
                    var object_tag = tagindex[model_def.TagIndex].TagDefinition as Blam.Halo1.Tags.object_group;

                    var halo1 = new BlamLib.Render.COLLADA.Halo1.ColladaHalo1(tagindex, object_tag.Model.Datum);

                    // set the interfaces settings (want to look into a better way of doing this)
                    halo1.Overwrite        = true;
                    halo1.RelativeFilePath = Path.Combine(kTestTagIndexTagsPath, @"data\");

                    // export each permutation and lod separately
                    foreach (var info in halo1)
                    {
                        // clear the export register
                        halo1.ClearRegister();
                        // add the info object to export
                        halo1.RegisterForExport(info);

                        var model_info = info as Render.COLLADA.Halo1.ColladaHalo1ModelInfo;

                        string name = string.Format("{0}-perm{1}-lod{2}", model_info.Name, model_info.Permutation, model_info.LevelOfDetail);

                        StartStopwatch();
                        halo1.Export(name);
                        Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", name, StopStopwatch());

                        // print any errors
                        foreach (string report in halo1.Reports())
                        {
                            Console.WriteLine(report);
                        }
                    }

                    // export all the models into a single collada file
                    halo1.ClearRegister();
                    foreach (var info in halo1)
                    {
                        halo1.RegisterForExport(info);
                    }

                    string name_all = Path.GetFileNameWithoutExtension(model_def.Name) + "_all";

                    StartStopwatch();
                    halo1.Export(name_all);
                    Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", name_all, StopStopwatch());

                    foreach (string report in halo1.Reports())
                    {
                        Console.WriteLine(report);
                    }

                    model_def.Close(tagindex);
                }
            }
        }
Пример #4
0
		public void Halo1TestCOLLADAModelExport()
		{
			using (var handler = new TagIndexHandler<Managers.TagIndex>(BlamVersion.Halo1_CE, kTestTagIndexTagsPath))
			{
				var tagindex = handler.IndexInterface;
				foreach (var model_def in ModelTestDefinitions)
				{
					// load the tag with dependents
					StartStopwatch();
					{
						model_def.Open(tagindex);
						Console.WriteLine("{0} LOAD: Time taken: {1}", model_def.TypeString, m_testStopwatch.Elapsed);
					}
					Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch());

					// create a halo1 collada interface with the gbxmodel datum
					var object_tag = tagindex[model_def.TagIndex].TagDefinition as Blam.Halo1.Tags.object_group;

					var halo1 = new BlamLib.Render.COLLADA.Halo1.ColladaHalo1(tagindex, object_tag.Model.Datum);

					// set the interfaces settings (want to look into a better way of doing this)
					halo1.Overwrite = true;
					halo1.RelativeFilePath = Path.Combine(kTestTagIndexTagsPath, @"data\");

					// export each permutation and lod separately
					foreach (var info in halo1)
					{
						// clear the export register
						halo1.ClearRegister();
						// add the info object to export
						halo1.RegisterForExport(info);
						
						var model_info = info as Render.COLLADA.Halo1.ColladaHalo1ModelInfo;

						string name = string.Format("{0}-perm{1}-lod{2}", model_info.Name, model_info.Permutation, model_info.LevelOfDetail);

						StartStopwatch();
						halo1.Export(name);
						Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", name, StopStopwatch());

						// print any errors
						foreach (string report in halo1.Reports())
							Console.WriteLine(report);
					}

					// export all the models into a single collada file
					halo1.ClearRegister();
					foreach (var info in halo1)
						halo1.RegisterForExport(info);

					string name_all = Path.GetFileNameWithoutExtension(model_def.Name) + "_all";

					StartStopwatch();
					halo1.Export(name_all);
					Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", name_all, StopStopwatch());

					foreach (string report in halo1.Reports())
						Console.WriteLine(report);

					model_def.Close(tagindex);
				}
			}
		}