{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/2805","repository_url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity","labels_url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/2805/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/2805/comments","events_url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/2805/events","html_url":"https://github.com/Microsoft/MixedRealityToolkit-Unity/issues/2805","id":361365151,"node_id":"MDU6SXNzdWUzNjEzNjUxNTE=","number":2805,"title":"Motion controller models not always loaded when playing in editor","user":{"login":"ivan2007","id":17752475,"node_id":"MDQ6VXNlcjE3NzUyNDc1","avatar_url":"https://avatars0.githubusercontent.com/u/17752475?v=4","gravatar_id":"","url":"https://api.github.com/users/ivan2007","html_url":"https://github.com/ivan2007","followers_url":"https://api.github.com/users/ivan2007/followers","following_url":"https://api.github.com/users/ivan2007/following{/other_user}","gists_url":"https://api.github.com/users/ivan2007/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan2007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan2007/subscriptions","organizations_url":"https://api.github.com/users/ivan2007/orgs","repos_url":"https://api.github.com/users/ivan2007/repos","events_url":"https://api.github.com/users/ivan2007/events{/privacy}","received_events_url":"https://api.github.com/users/ivan2007/received_events","type":"User","site_admin":false},"labels":[{"id":318131835,"node_id":"MDU6TGFiZWwzMTgxMzE4MzU=","url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/labels/Bug","name":"Bug","color":"b60205","default":false},{"id":937573982,"node_id":"MDU6TGFiZWw5Mzc1NzM5ODI=","url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/labels/GLTF","name":"GLTF","color":"5ecae5","default":false},{"id":859702144,"node_id":"MDU6TGFiZWw4NTk3MDIxNDQ=","url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/labels/Legacy%20(HoloToolkit)","name":"Legacy (HoloToolkit)","color":"ff7768","default":false},{"id":932820917,"node_id":"MDU6TGFiZWw5MzI4MjA5MTc=","url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/labels/Windows%20Mixed%20Reality","name":"Windows Mixed Reality","color":"c6e7ff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-18T15:36:01Z","updated_at":"2018-09-18T21:17:12Z","closed_at":null,"author_association":"NONE","body":"**Does this affect the legacy HoloToolkit (master) or the Mixed Reality Toolkit (mrtk_release)?**\r\nHoloToolkit\r\n\r\n**Describe the bug**\r\nSometimes, playing in editor, the motion controller models are not loaded.\r\nThis happens systematically after the debug with visual studio.\r\n\r\n**To Reproduce**\r\n1) Import MRTK and  InputManagerTestScene\r\n2) Press Play in Unity (the motion controller models are loaded) \r\n3) Attach the VS debug\r\n4) Detach debug\r\n5) Stop the player\r\n6) Press play in Unity (the motion controller models are not loaded) \r\n\r\n**Expected behavior**\r\nMotion controller models always loaded\r\n\r\n**Actual behavior**\r\nI made some test and these are my notes:\r\n1) The models are not loaded because there aren't detected spatial sources ( no sources from spatialInteractionManager->GetDetectedSourcesAtTimestamp(perceptionTimestamp) of EditorMotionController).\r\n2) StartTrackingController is called from Awake (if InteractionManager retrives sources) and when an interaction source is detected\r\n3) When the models are not loaded StartTrackingController is called from Awake. In this case if StartTrackingController is called when an interaction source is detected the models are loaded.\r\nTo test this I made a loop inside LoadSourceControllerModel to retry when the model is not loaded and this is the result:\r\n![image](https://user-images.githubusercontent.com/17752475/45698637-c15eab80-bb68-11e8-9a43-6a997bd40449.png)\r\n\r\nOnly after the sources are detected the models are loaded.\r\nIt seems that, sometimes, also if InteractionManager retrives source states, these are not ready until the InteractionSourceDetected event is raised.\r\n\r\n**Unity Editor Version**\r\n2017.4.11f1\r\n\r\n**Mixed Reality Toolkit Release Version**\r\n2017.4.0.0\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/comments/422558654","html_url":"https://github.com/Microsoft/MixedRealityToolkit-Unity/issues/2805#issuecomment-422558654","issue_url":"https://api.github.com/repos/Microsoft/MixedRealityToolkit-Unity/issues/2805","id":422558654,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjU1ODY1NA==","user":{"login":"ivan2007","id":17752475,"node_id":"MDQ6VXNlcjE3NzUyNDc1","avatar_url":"https://avatars0.githubusercontent.com/u/17752475?v=4","gravatar_id":"","url":"https://api.github.com/users/ivan2007","html_url":"https://github.com/ivan2007","followers_url":"https://api.github.com/users/ivan2007/followers","following_url":"https://api.github.com/users/ivan2007/following{/other_user}","gists_url":"https://api.github.com/users/ivan2007/gists{/gist_id}","starred_url":"https://api.github.com/users/ivan2007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivan2007/subscriptions","organizations_url":"https://api.github.com/users/ivan2007/orgs","repos_url":"https://api.github.com/users/ivan2007/repos","events_url":"https://api.github.com/users/ivan2007/events{/privacy}","received_events_url":"https://api.github.com/users/ivan2007/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T21:17:12Z","updated_at":"2018-09-18T21:17:12Z","author_association":"NONE","body":"Many thanks for all your hard work on this project!"}}
{"actor":{"display_login":"ivan2007"}}