microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

MotionController scene documented, but unfound #1110

Closed erichfrazer closed 6 years ago

erichfrazer commented 6 years ago

Right on the main page, there is a blurb about the MotionController scene, but I don't see it in the code. Can you guys fix that, or point me to it?

Mainly, what I want to do is drop a Crystal Keys Motion Controller into my app and have it render itself. Is this possible? Where is the main place a dev in the outside world would find this code/prefab/documentation and use it? So far, it's been really hard to find a solid reference to this probably very common request.

HattMarris1 commented 6 years ago

Looks like it's here: https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/Dev_Unity_2017.2.0/Assets/HoloToolkit-Examples/Input/Scenes/MotionControllerTest.unity

erichfrazer commented 6 years ago

A. I don't see anything in the readme that points me to where this scene went. B. I've run MotionControllerTest.unity, and don't see the model for the crystal keys show up on the screen, nor do I see it anywhere in the projects. But I do get a cryptic message that glTF cannot render the model in editor mode, which baffles me.

I do get a screen that shows a bunch of details about the controller and a small blurry cursor sphere.

StephenHodgson commented 6 years ago

The libraries that render the controllers are not available in the editor at this time. You'd need to build and deploy your app to see the controllers.

erichfrazer commented 6 years ago

For other people that are in the dark as well as me, can you explain what the difference is? Why would I not see it in the editor, but would see it during build & run? What component in the system knows how to replace one model w/ another at runtime? I'm just starting out w/ the motion controllers, and don't know what's going on here.

thanks

erichfrazer commented 6 years ago

let's back up a second... can one of you helpful guys just explain how I get the crystal keys model to show up and render in my unity app, if I'm starting from scratch? Where does one start? I was looking at this demo to figure it out, but ... uh.. isn't there a "how to" somewhere official that explains how to do this, or is this all too new for that?

erichfrazer commented 6 years ago

I built and ran it, sure enough the model does show up. that just blew my mind. Now I have to go figure out why that works...

erichfrazer commented 6 years ago

Oh, I get it, at runtime, it tries to load the model from ... somewhere, based on my model's type, and then uses that. But there is no model available for the editor yet, as in: Microsoft has not released it yet? Can I find a reasonable approximation somewhere? that's pretty cool that this works, though, makes it simple (in theory) to have the controllers provide their own model.

StephenHodgson commented 6 years ago

Part of the reason why we can't see the controllers in the editor, is because unity has not exposed the windows namespaces we need to load the controller's model from the driver at runtime in the editor.

As for implementing the controller visualizer in your own scene, the MixedRealityCameraParent prefab is all you need. The main readme does indeed state the classes pertaining to the controller visualization.

StephenHodgson commented 6 years ago

The controller model is being loaded from it's driver.

erichfrazer commented 6 years ago

I'm sure Microsoft has left a model laying around somewhere that we can use? :-) I should know, I work there, but currently, it escapes me.

StephenHodgson commented 6 years ago

I believe you'd need two models, left and right.

If I remember correctly, it was decided that always loading the controller from the driver was the best implementation, and that Unity might expose the windows uwp APIs a bit more if people wanted to see them in the editor. Who knows, maybe you can ask around and see?

erichfrazer commented 6 years ago

I went down this path of reasoning because it looks like the Vive provides models and a prefab that seem pretty plug & play... but getting the model from the dll seems wise too.