Skip to content

Commit 391e956

Browse files
committed
Added internalization define and fixed spelling mistakes
1 parent f2b2d8c commit 391e956

File tree

7 files changed

+65
-42
lines changed

7 files changed

+65
-42
lines changed

Assets/com.8bitgoose.asciifbxexporter/CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
Version 2.0.2
2+
-------------------------
3+
4+
1. Fixed spelling mistakes
5+
6+
2. Added a define to handle internationalization when commas are used as decimal instead of periods
7+
8+
3. Fixed incorrect version message when writing to the ASCII file
9+
10+
111
Version 2.0.1
212
-------------------------
313

414
1. Changed the runtime exporter example to take in an absolute path instead of relative
515

6-
2. Fixed ASMDEF problems when building projuect
16+
2. Fixed ASMDEF problems when building project
717

818

919
Version 2.0.0

Assets/com.8bitgoose.asciifbxexporter/Editor/8BitGoose.AsciiFBXExporter.Editor.asmdef

+3-20
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,10 @@
44
"references": [
55
"GUID:e7803306176545b449f23372db778e78"
66
],
7-
"includePlatforms": [],
8-
"excludePlatforms": [
9-
"Android",
10-
"GameCoreScarlett",
11-
"GameCoreXboxOne",
12-
"iOS",
13-
"LinuxStandalone64",
14-
"CloudRendering",
15-
"Lumin",
16-
"macOSStandalone",
17-
"PS4",
18-
"PS5",
19-
"Stadia",
20-
"Switch",
21-
"tvOS",
22-
"WSA",
23-
"WebGL",
24-
"WindowsStandalone32",
25-
"WindowsStandalone64",
26-
"XboxOne"
7+
"includePlatforms": [
8+
"Editor"
279
],
10+
"excludePlatforms": [],
2811
"allowUnsafeCode": false,
2912
"overrideReferences": false,
3013
"precompiledReferences": [],

Assets/com.8bitgoose.asciifbxexporter/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ASCII FBX Exporter for Unity (2.0.1)
1+
ASCII FBX Exporter for Unity (2.0.2)
22
-------------------------
33

44
GitHub: https://github.com/KellanHiggins/AsciiFBXExporterForUnity
@@ -43,6 +43,12 @@ Features
4343
13. All shader texture materials are successfully extracted and written regardless of the shader (thank you @andysdds on GitHub)
4444

4545

46+
Internationalization
47+
-------------------------
48+
49+
IMPORTANT: If you use commas to denote decimals in your country, you must uncomment `#define International` in FBXExporter.cs. This will make sure objects are exported correctly for your computer.
50+
51+
4652
Editor Known Limitations
4753
-------------------------
4854

@@ -72,6 +78,8 @@ Runtime Known Limitations
7278

7379
2. Runtime needs read/write texture's enabled in the editor.
7480

81+
3. Can not export static meshes since they have been written to a big group and are readonly.
82+
7583

7684
Blender Known Limitations
7785
------------------------

Assets/com.8bitgoose.asciifbxexporter/Runtime/FBXExporter.cs

+21-17
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
//
2727
// ===============================================================================================
2828

29+
//#define International // Uncomment if provides internationalization for countries that use commas instead of decimals to denote the break point
30+
2931
using UnityEngine;
3032
using System.Text;
3133
using System.Collections.Generic;
@@ -41,7 +43,7 @@ public class FBXExporter
4143
{
4244
public static string VersionInformation
4345
{
44-
get { return "FBX Unity Export version 1.4.0 (Originally created for the Unity Asset, Building Crafter)"; }
46+
get { return "Ascii FBX Exporter version 2.0.2 (Originally created for the Unity Asset, Building Crafter)"; }
4547
}
4648

4749
public static bool ExportGameObjToFBX(GameObject gameObj, string newPath, bool copyMaterials = false, bool copyTextures = false)
@@ -73,10 +75,10 @@ public static bool ExportGameObjToFBX(GameObject gameObj,
7375

7476
string buildMesh = MeshToString(gameObj, newFileNameWithFullPath, copyMaterials, copyTextures, relativeMaterialFolderName, relativeTextureFolderName);
7577

76-
if(System.IO.File.Exists(newFileNameWithFullPath))
77-
System.IO.File.Delete(newFileNameWithFullPath);
78+
if(File.Exists(newFileNameWithFullPath))
79+
File.Delete(newFileNameWithFullPath);
7880

79-
System.IO.File.WriteAllText(newFileNameWithFullPath, buildMesh);
81+
File.WriteAllText(newFileNameWithFullPath, buildMesh);
8082

8183
#if UNITY_EDITOR
8284
// Import the model properly so it looks for the material instead of by the texture name
@@ -719,22 +721,33 @@ public static Object CopyAndRenameAssetReturnObject(Object obj, string newName,
719721
}
720722

721723
/// <summary>
722-
/// Provides internationalization for countries that use commas instead of decimals to denote the break point
724+
/// Gets the root path of the Unity folder
725+
/// </summary>
726+
/// <returns>Application.dataPath without Assets on the end</returns>
727+
public static string GetApplicationRoot()
728+
{
729+
return Application.dataPath.Remove(Application.dataPath.LastIndexOf("Assets"), 6);
730+
}
731+
732+
/// <summary>
733+
/// Provides internationalization for countries that use commas instead of decimals to denote the break point
723734
/// </summary>
724735
/// <param name="val">the float value you wish to convert</param>
725736
/// <returns>a string that is formated always to be 1.0 and never 1,0</returns>
726737
public static string FBXFormat(float val)
727738
{
728-
if(false) // SET TO TRUE IF YOU USE PERIODS FOR DECIMALS IN YOUR COUNTRY AND ONLY IF (to get a slight reduction in process time)
729-
return val.ToString();
730-
739+
#if !International
740+
return val.ToString();
741+
#else
731742
string stringValue = val.ToString();
732743

733744
int index = CheckForCommaInsteadOfDecimal(ref stringValue);
745+
734746
if(index > -1)
735747
stringValue = ReplaceCommasWithDecimals(stringValue, index);
736748

737749
return stringValue;
750+
#endif
738751
}
739752

740753
/// <summary>
@@ -757,14 +770,5 @@ private static string ReplaceCommasWithDecimals(string vert, int breakIndex)
757770
{
758771
return vert.Remove(breakIndex, vert.Length - breakIndex) + "." + vert.Remove(0, breakIndex + 1);
759772
}
760-
761-
/// <summary>
762-
/// Gets the root path of the Unity folder
763-
/// </summary>
764-
/// <returns>Application.dataPath without Assets on the end</returns>
765-
public static string GetApplicationRoot()
766-
{
767-
return Application.dataPath.Remove(Application.dataPath.LastIndexOf("Assets"), 6);
768-
}
769773
}
770774
}

Assets/com.8bitgoose.asciifbxexporter/Runtime/RuntimeExporterMono.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void OnGUI()
2828

2929
if(exportedFileName == null && AbsolutePath.Contains("kellan"))
3030
{
31-
GUI.Label(new Rect(10, 60, 400, 50), "You have not changed the absolte file name from the default absolute path");
31+
GUI.Label(new Rect(10, 60, 400, 50), "You have not changed the absolte file name from the default absolute path. Please change.");
3232
}
3333

3434
if(exportedFileName != null)

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
Version 2.0.2
2+
-------------------------
3+
4+
1. Fixed spelling mistakes
5+
6+
2. Added a define to handle internationalization when commas are used as decimal instead of periods
7+
8+
3. Fixed incorrect version message when writing to the ASCII file
9+
10+
111
Version 2.0.1
212
-------------------------
313

414
1. Changed the runtime exporter example to take in an absolute path instead of relative
515

6-
2. Fixed ASMDEF problems when building projuect
16+
2. Fixed ASMDEF problems when building project
717

818

919
Version 2.0.0

readme.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ASCII FBX Exporter for Unity (2.0.1)
1+
ASCII FBX Exporter for Unity (2.0.2)
22
-------------------------
33

44
GitHub: https://github.com/KellanHiggins/AsciiFBXExporterForUnity
@@ -43,6 +43,12 @@ Features
4343
13. All shader texture materials are successfully extracted and written regardless of the shader (thank you @andysdds on GitHub)
4444

4545

46+
Internationalization
47+
-------------------------
48+
49+
IMPORTANT: If you use commas to denote decimals in your country, you must uncomment `#define International` in FBXExporter.cs. This will make sure objects are exported correctly for your computer.
50+
51+
4652
Editor Known Limitations
4753
-------------------------
4854

@@ -72,6 +78,8 @@ Runtime Known Limitations
7278

7379
2. Runtime needs read/write texture's enabled in the editor.
7480

81+
3. Can not export static meshes since they have been written to a big group and are readonly.
82+
7583

7684
Blender Known Limitations
7785
------------------------

0 commit comments

Comments
 (0)