static void TestMapgeo() { MapGeometry mgeo = new MapGeometry(@"C:/Users/Crauzer/Desktop/data/maps/mapgeometry/sr/base_srx.mapgeo"); string randomMaterialName = mgeo.Models[180].Submeshes[0].Material; mgeo.Models.Clear(); OBJFile object1 = new OBJFile("room155.obj"); OBJFile object2 = new OBJFile("room156.obj"); OBJFile object3 = new OBJFile("room157.obj"); AddOBJ(object1, "MapGeo_Instance_0"); AddOBJ(object2, "MapGeo_Instance_1"); AddOBJ(object3, "MapGeo_Instance_2"); mgeo.Write("base_srx.mapgeo.edited", 7); void AddOBJ(OBJFile obj, string name) { //We will add each object 2 times just for fun to see how transformation works (List <ushort> indices, List <MapGeometryVertex> vertices) = obj.GetMGEOData(); Matrix4x4 transformation = Matrix4x4.CreateTranslation(new Vector3(0, 50, 100)); MapGeometrySubmesh submesh = new MapGeometrySubmesh("", 0, (uint)indices.Count, 0, (uint)vertices.Count); MapGeometryModel model1 = new MapGeometryModel(name, vertices, indices, new List <MapGeometrySubmesh>() { submesh }, MapGeometryLayer.AllLayers); mgeo.AddModel(model1); } }
static void Main(string[] args) { //SimpleSkin skn = new SimpleSkin("C:/dev/proxy/kek.skn"); // //OBJConverter.ConvertSKN(skn).Write("C:/dev/proxy/kek.obj"); MapGeometry mgeo = new MapGeometry("C:/Users/Crauzer/Desktop/New Folder/e7ef6cc4fece0526.mapgeo"); mgeo.Write("C:/Users/Crauzer/Desktop/New Folder/e7ef6cc4fece0526_write.mapgeo", 11); mgeo = new MapGeometry("C:/Users/Crauzer/Desktop/New Folder/e7ef6cc4fece0526_write.mapgeo"); }
static void BildgeWaterRift(MapGeometry mgeo) { //Model Bulk Loading var fileCount = (from file in Directory.EnumerateFiles(@"K:\Riot Games\LeagueSkins\BildgewaterRift\3dmodelsnewnew", "*.obj", System.IO.SearchOption.AllDirectories) select file).Count(); int OBJsToCreate = fileCount + 1; OBJFile[] OBJs = new OBJFile[OBJsToCreate]; for (int i = 1; i < OBJsToCreate; i++) { OBJs[i] = new OBJFile($@"K:\Riot Games\LeagueSkins\BildgewaterRift\3dmodelsnewnew\room{i}.obj"); int j = i; AddModel(OBJs[i], $"MapGeo_Instance_{i}", $"Maps/KitPieces/Summoners_Rift/Materials/room{i}", mgeo, i, j); } mgeo.Write(@"K:\Riot Games\LeagueSkins\BildgewaterRift\Map11\data\maps\mapgeometry\sr\base_srx.mapgeo", 11); }