diff --git a/Charm/ActivityMapEntityView.xaml.cs b/Charm/ActivityMapEntityView.xaml.cs index edd7ac9e..1fc21dfe 100644 --- a/Charm/ActivityMapEntityView.xaml.cs +++ b/Charm/ActivityMapEntityView.xaml.cs @@ -15,6 +15,7 @@ using Tiger.Schema.Activity; using Tiger.Schema.Activity.DESTINY1_RISE_OF_IRON; using Tiger.Schema.Activity.DESTINY2_SHADOWKEEP_2601; +using Tiger.Schema.Activity.DESTINY2_WITCHQUEEN_6307; using Tiger.Schema.Entity; using Tiger.Schema.Havok; using Tiger.Schema.Shaders; @@ -526,11 +527,6 @@ private static void ExportIndividual(List dataTables, string hash, str ExporterScene dynamicScene = Exporter.Get().CreateScene(entity.Hash, ExportType.EntityInMap); dynamicScene.AddEntity(entry.GetEntityHash(), entity.Load(ExportDetailLevel.MostDetailed), entity.Skeleton?.GetBoneNodes()); entity.SaveMaterialsFromParts(dynamicScene, entity.Load(ExportDetailLevel.MostDetailed)); - - if (_config.GetS2VMDLExportEnabled()) - { - Source2Handler.SaveEntityVMDL($"{savePath}/Entities", entity); - } } } } @@ -545,11 +541,6 @@ private static void ExportIndividual(List dataTables, string hash, str ExporterScene dynamicScene = Exporter.Get().CreateScene(entity.Hash, ExportType.EntityInMap); dynamicScene.AddEntity(entry.GetEntityHash(), entity.Load(ExportDetailLevel.MostDetailed), entity.Skeleton?.GetBoneNodes()); entity.SaveMaterialsFromParts(dynamicScene, entity.Load(ExportDetailLevel.MostDetailed)); - - if (_config.GetS2VMDLExportEnabled()) - { - Source2Handler.SaveEntityVMDL($"{savePath}/Entities", entity); - } } if (entry.DataResource.GetValue(dataTable.GetReader()) is SMapSkyEntResource skyResource) { @@ -560,18 +551,13 @@ private static void ExportIndividual(List dataTables, string hash, str ExporterScene skyScene = Exporter.Get().CreateScene(element.Unk60.TagData.Unk08.Hash, ExportType.EntityInMap); skyScene.AddModel(element.Unk60.TagData.Unk08); - - if (_config.GetS2VMDLExportEnabled()) - { - Source2Handler.SaveEntityVMDL($"{savePath}/Entities", element.Unk60.TagData.Unk08.Hash, element.Unk60.TagData.Unk08.Load(ExportDetailLevel.MostDetailed, null)); - } } } if (entry.DataResource.GetValue(dataTable.GetReader()) is SMapTerrainResource terrainArrangement) { ExporterScene staticScene = Exporter.Get().CreateScene($"{terrainArrangement.Terrain.Hash}_Terrain", ExportType.StaticInMap); terrainArrangement.Terrain.Load(); - terrainArrangement.Terrain.LoadIntoExporter(staticScene, savePath, _config.GetUnrealInteropEnabled() || _config.GetS2ShaderExportEnabled(), true); + terrainArrangement.Terrain.LoadIntoExporter(staticScene, savePath); } }); } diff --git a/Charm/DevView.xaml.cs b/Charm/DevView.xaml.cs index ceeb6907..a237b253 100644 --- a/Charm/DevView.xaml.cs +++ b/Charm/DevView.xaml.cs @@ -20,7 +20,7 @@ using Tiger.Schema.Investment; using Tiger.Schema.Shaders; using Tiger.Schema.Havok; -+using Tiger.Schema.Static; +using Tiger.Schema.Static; namespace Charm; diff --git a/Charm/EntityView.xaml.cs b/Charm/EntityView.xaml.cs index 5938dbba..273e1f21 100644 --- a/Charm/EntityView.xaml.cs +++ b/Charm/EntityView.xaml.cs @@ -139,6 +139,14 @@ public static void Export(List entities, string name, ExportTypeFlag exp } } + if (exportType == ExportTypeFlag.Full) + { + if (config.GetUnrealInteropEnabled()) + { + AutomatedExporter.SaveInteropUnrealPythonFile(savePath, name, AutomatedExporter.ImportType.Entity, config.GetOutputTextureFormat()); + } + } + // Scale and rotate // fbxHandler.ScaleAndRotateForBlender(boneNodes[0]); Tiger.Exporters.Exporter.Get().Export(); @@ -234,23 +242,10 @@ public static void ExportGearShader(ApiItem item, string itemName, string savePa } } - ConfigSubsystem config = CharmInstance.GetSubsystem(); - string savePath = config.GetExportSavePath(); - string meshName = Regex.Replace(name, @"[^\u0000-\u007F]", "_").Replace(".", "_"); - string itemName = Regex.Replace(string.Join("_", item.ItemName.Split(Path.GetInvalidFileNameChars())), @"[^\u0000-\u007F]", "_").Replace(".", "_"); - savePath += $"/{meshName}"; - Directory.CreateDirectory(savePath); - - foreach (var dye in dyes) - { - dye.Value.ExportTextures($"{savePath}/Textures/DetailTextures/", config.GetOutputTextureFormat()); + AutomatedExporter.SaveBlenderApiFile(savePath, itemName, + config.GetOutputTextureFormat(), dyes.Values.ToList()); } - AutomatedExporter.SaveBlenderApiFile(savePath, itemName, - config.GetOutputTextureFormat(), dyes.Values.ToList()); - - SBoxHandler.SaveGearVMAT(savePath, itemName, - config.GetOutputTextureFormat(), dyes.Values.ToList()); } private List MakeEntityDisplayParts(Entity entity, ExportDetailLevel detailLevel) diff --git a/Charm/MapView.xaml.cs b/Charm/MapView.xaml.cs index 589bd21c..e02f4285 100644 --- a/Charm/MapView.xaml.cs +++ b/Charm/MapView.xaml.cs @@ -197,11 +197,11 @@ public static void ExportTerrainMap(Tag map) if (entry.DataResource.GetValue(data.MapDataTable.GetReader()) is SMapTerrainResource terrainArrangement) // Terrain { terrainArrangement.Terrain.Load(); - terrainArrangement.Terrain.LoadIntoExporter(scene, savePath, _config.GetUnrealInteropEnabled() || _config.GetS2ShaderExportEnabled()); + terrainArrangement.Terrain.LoadIntoExporter(scene, savePath); if (exportStatics) { ExporterScene staticScene = Exporter.Get().CreateScene($"{terrainArrangement.Terrain.Hash}_Terrain", ExportType.StaticInMap); - terrainArrangement.Terrain.LoadIntoExporter(staticScene, savePath, _config.GetUnrealInteropEnabled() || _config.GetS2ShaderExportEnabled(), true); + terrainArrangement.Terrain.LoadIntoExporter(staticScene, savePath); } } }); @@ -274,10 +274,12 @@ private static void ExportStatics(string savePath, Tag map) { if (File.Exists($"{savePath}/Statics/{part.Static.Hash}.fbx")) continue; - string staticMeshName = part.Static.Hash.ToString(); - ExporterScene staticScene = Exporter.Get().CreateScene(staticMeshName, ExportType.StaticInMap); - var staticmesh = part.Static.Load(ExportDetailLevel.MostDetailed); - staticScene.AddStatic(part.Static.Hash, staticmesh); + string staticMeshName = part.Static.Hash.ToString(); + ExporterScene staticScene = + Exporter.Get().CreateScene(staticMeshName, ExportType.StaticInMap); + var staticmesh = part.Static.Load(ExportDetailLevel.MostDetailed); + staticScene.AddStatic(part.Static.Hash, staticmesh); + } } } }); @@ -348,7 +350,7 @@ private static void ExportStatics(string savePath, Tag map) List parts = new(); foreach (var partEntry in terrain.TagData.StaticParts) { - if (partEntry.DetailLevel == 0) + if (partEntry.Lod.DetailLevel == ELodCategory.MainGeom0) { var part = terrain.MakePart(partEntry); terrain.TransformPositions(part); diff --git a/Charm/TagListView.xaml.cs b/Charm/TagListView.xaml.cs index d2b8116a..054225cb 100644 --- a/Charm/TagListView.xaml.cs +++ b/Charm/TagListView.xaml.cs @@ -102,6 +102,14 @@ public enum ETagListType WeaponAudioList, [Description("Weapon Audio [Final]")] WeaponAudio, + [Description("BKHD Group List")] + BKHDGroupList, + [Description("BKHD Group [Final]")] + BKHDGroup, + [Description("BKHD Audio List")] + BKHDAudioList, + [Description("BKHD Audio [Final]")] + BKHDAudio, [Description("Material List [Packages]")] MaterialList, [Description("Material [Final]")] @@ -286,12 +294,6 @@ public async void LoadContent(ETagListType tagListType, TigerHash contentValue = case ETagListType.Material: LoadMaterial(contentValue as FileHash); break; - case ETagListType.MaterialList: - await LoadMaterialList(); - break; - case ETagListType.Material: - LoadMaterial(contentValue as FileHash); - break; case ETagListType.BKHDGroupList: await LoadBKHDGroupList(); break; diff --git a/Tiger/Schema/Static/Terrain.cs b/Tiger/Schema/Static/Terrain.cs index d95f8994..b7030071 100644 --- a/Tiger/Schema/Static/Terrain.cs +++ b/Tiger/Schema/Static/Terrain.cs @@ -178,7 +178,7 @@ public StaticPart MakeLODPart(SMeshGroup entry, int groupIndex) return part; } - private void TransformPositions(StaticPart part) + public void TransformPositions(StaticPart part) { Debug.Assert(part.VertexPositions.Count == part.VertexNormals.Count); for (int i = 0; i < part.VertexPositions.Count; i++) @@ -241,7 +241,7 @@ private void TransformPositions(StaticPart part) } } - private void TransformTexcoords(StaticPart part) + public void TransformTexcoords(StaticPart part) { for (int i = 0; i < part.VertexTexcoords0.Count; i++) {