Skip to content

Commit

Permalink
Don't allow periods in exports, prevents texture exports
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDesigns committed Mar 15, 2024
1 parent 3bf1b7d commit 4a3d832
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Charm/EntityView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private bool LoadUI(FbxHandler fbxHandler)
public static void Export(List<Entity> entities, string name, ExportTypeFlag exportType, EntitySkeleton overrideSkeleton = null, ExporterScene scene = null)
{
ConfigSubsystem config = ConfigSubsystem.Get();
name = Regex.Replace(name, @"[^\u0000-\u007F]", "_");
name = Regex.Replace(name, @"[^\u0000-\u007F]", "_").Replace(".", "_");
string savePath = config.GetExportSavePath() + $"/{name}";

if (scene == null)
Expand Down Expand Up @@ -103,7 +103,7 @@ public static void ExportInventoryItem(ApiItem item)
{
string name = string.Join("_", $"{item.ItemName}"
.Split(Path.GetInvalidFileNameChars()));
name = Regex.Replace(name, @"[^\u0000-\u007F]", "_");
name = Regex.Replace(name, @"[^\u0000-\u007F]", "_").Replace(".", "_");
// Export the model
// todo bad, should be replaced
EntitySkeleton overrideSkeleton = null;
Expand Down Expand Up @@ -140,8 +140,8 @@ public static void ExportInventoryItem(ApiItem item)

ConfigSubsystem config = CharmInstance.GetSubsystem<ConfigSubsystem>();
string savePath = config.GetExportSavePath();
string meshName = Regex.Replace(name, @"[^\u0000-\u007F]", "_");
string itemName = Regex.Replace(string.Join("_", item.ItemName.Split(Path.GetInvalidFileNameChars())), @"[^\u0000-\u007F]", "_");
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);

Expand Down

0 comments on commit 4a3d832

Please sign in to comment.