Skip to content

Commit 9da47af

Browse files
author
benoithudson
committed
bug #1242332 - [Mac] Editor focus lockup when exporting an FBX using FBX Exporter
AKA UT-3571. This is a quick-fix that fixes grabbing the focus of the hiearchy view. This doesn't really improve the time, but it allows the user to surf the web while waiting.
1 parent f378069 commit 9da47af

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

com.unity.formats.fbx/Editor/ConvertToNestedPrefab.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,17 @@ private static object GetPropertyReflection(object instance, string propertyName
281281
internal static List<GameObject> GetSceneReferencesToObject(Object obj)
282282
{
283283
var sceneHierarchyWindowType = typeof(UnityEditor.SearchableEditorWindow).Assembly.GetType("UnityEditor.SceneHierarchyWindow");
284-
var sceneHierarchyWindow = EditorWindow.GetWindow(sceneHierarchyWindowType);
284+
285+
// bug 1242332: don't grab the focus!
286+
// The arguments aren't actually optional so they must all be named.
287+
//
288+
// todo: We should cache all the window-getting and reflection so it
289+
// happens not once per object but once per convert.
290+
var sceneHierarchyWindow = EditorWindow.GetWindow(
291+
t: sceneHierarchyWindowType,
292+
utility: false,
293+
title: null,
294+
focus: false);
285295
var instanceID = obj.GetInstanceID();
286296
var idFormat = "ref:{0}:";
287297

@@ -994,4 +1004,4 @@ internal static void CopyComponents(GameObject to, GameObject from, GameObject r
9941004
}
9951005
}
9961006
}
997-
}
1007+
}

0 commit comments

Comments
 (0)