@@ -104,7 +104,7 @@ public static GameObject Convert (
104
104
string fbxFullPath = null ,
105
105
string prefabDirectoryFullPath = null ,
106
106
string prefabFullPath = null ,
107
- EditorTools . IExportOptions exportOptions = null
107
+ EditorTools . ConvertToPrefabSettingsSerialize exportOptions = null
108
108
)
109
109
{
110
110
// Only create the prefab (no FBX export) if we have selected the root of a model prefab instance.
@@ -135,12 +135,6 @@ public static GameObject Convert (
135
135
}
136
136
var projectRelativePath = EditorTools . ExportSettings . GetProjectRelativePath ( fbxFullPath ) ;
137
137
138
- // Make sure that the object names in the hierarchy are unique.
139
- // The import back in to Unity would do this automatically but
140
- // we prefer to control it so that the Maya artist can see the
141
- // same names as exist in Unity.
142
- EnforceUniqueNames ( new GameObject [ ] { toConvert } ) ;
143
-
144
138
// Export to FBX. It refreshes the database.
145
139
{
146
140
var fbxActualPath = ModelExporter . ExportObject (
@@ -274,35 +268,6 @@ public static string IncrementFileName(string path, string filename)
274
268
return file ;
275
269
}
276
270
277
- /// <summary>
278
- /// Enforces that all object names be unique before exporting.
279
- /// If an object with a duplicate name is found, then it is incremented.
280
- /// e.g. Sphere becomes Sphere 1
281
- /// </summary>
282
- /// <param name="exportSet">Export set.</param>
283
- public static void EnforceUniqueNames ( IEnumerable < GameObject > exportSet )
284
- {
285
- Dictionary < string , int > NameToIndexMap = new Dictionary < string , int > ( ) ;
286
- string format = "{0} {1}" ;
287
-
288
- Queue < GameObject > queue = new Queue < GameObject > ( exportSet ) ;
289
-
290
- while ( queue . Count > 0 ) {
291
- var go = queue . Dequeue ( ) ;
292
- var name = go . name ;
293
- if ( NameToIndexMap . ContainsKey ( name ) ) {
294
- go . name = string . Format ( format , name , NameToIndexMap [ name ] ) ;
295
- NameToIndexMap [ name ] ++ ;
296
- } else {
297
- NameToIndexMap [ name ] = 1 ;
298
- }
299
-
300
- foreach ( Transform child in go . transform ) {
301
- queue . Enqueue ( child . gameObject ) ;
302
- }
303
- }
304
- }
305
-
306
271
/// <summary>
307
272
/// Updates the meshes and materials of the exported GameObjects
308
273
/// to link to those imported from the FBX.
0 commit comments