File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ private static List<GameObject> OnConvertInPlace (GameObject [] unityActiveGOs)
76
76
string dirPath = Path . Combine ( Application . dataPath , "Objects" ) ;
77
77
78
78
for ( int n = 0 ; n < gosToExport . Length ; n ++ ) {
79
- filePaths [ n ] = Path . Combine ( dirPath , gosToExport [ n ] . name + ".fbx" ) ;
79
+ string filename = ConvertToValidFilename ( gosToExport [ n ] . name + ".fbx" ) ;
80
+ filePaths [ n ] = Path . Combine ( dirPath , filename ) ;
80
81
}
81
82
82
83
string [ ] fbxFileNames = new string [ filePaths . Length ] ;
@@ -136,6 +137,11 @@ private static List<GameObject> OnConvertInPlace (GameObject [] unityActiveGOs)
136
137
return result ;
137
138
}
138
139
140
+ private static string ConvertToValidFilename ( string filename )
141
+ {
142
+ return System . Text . RegularExpressions . Regex . Replace ( filename , "[" + new string ( Path . GetInvalidFileNameChars ( ) ) + "]" , "_" ) ;
143
+ }
144
+
139
145
private static void SetupImportedGameObject ( GameObject orig , GameObject imported )
140
146
{
141
147
Transform importedTransform = imported . transform ;
You can’t perform that action at this time.
0 commit comments