Skip to content

Commit 5d44ef7

Browse files
authored
Merge pull request #526 from Unity-Technologies/1242332-focus-grab-on-convert
bug #1242332 - [Mac] Editor focus lockup when exporting an FBX using …
2 parents d6450e6 + 9da47af commit 5d44ef7

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)