PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
170 stars 55 forks source link

No response after updating mac project to beta1 #25

Open PatHightree opened 3 years ago

PatHightree commented 3 years ago

Hello @PatHightree Thank You very much for this.

I'm on unity 2020.1.17f1 on Mac Big Sur

I created a new unity project.

I downloaded and installed the new input manager via package manager and enabled it in player settings.

I downloaded your space navigator package from the develop section and installed it from disk via package manager (SpaceNavigator Driver 2.0.0.beta.1).

I've got the SpaceNavigator Inspector in the Windows menu in Unity and I connected the Space Navigator hardware.

I restarted Unity Editor - but I get no reaction from the Space Navigator - either in EDITOR or PLAY mode.

Am I doing something wrong?

Kind Regards

Originally posted by @makaruk in https://github.com/PatHightree/SpaceNavigator/issues/24#issuecomment-798894988

PatHightree commented 3 years ago

Did you follow the Upgrade from 1.x steps in the readme ?

Might be that you haven't switched your project to the new input system yet. If you have, Project Settings/Player/Active Input Handling should look like this : image

PatHightree commented 3 years ago

I added an error message in version 2.0.0-beta.2 to indicate when the new input system in not active. The readme also has more info regarding switching between input systems (you can have both active at the same time). Please check and see if this helps.

klvnptr commented 3 years ago

I just tested beta3, and it doesn't do a thing :( Followed readme word by word. New input system is in place (i was already using that). I'm on x86 based Mac, with 2020.3.0f1 Is there any way I can help you debug this? Thanks

makaruk commented 3 years ago

Hi @PatHightree - I have the same non responsive situation as @klvnptr describes.

The new Input system is most definitely installed and active in my editor. I am not switching from the old version of the driver - I made a fresh Unity project with the SpaceNavigator Driver 2.0.0.beta.3 driver installed from my hard drive.

I downloaded the sample scenes from the package manager - and no response at any stage - eeither EDIT or PLAY mode. And no errors in the console too...

Kind Regards

PatHightree commented 3 years ago

Just checking, you both are using SpaceNavigator devices ?

Please open Window/Analysis/Input Debugger and check if the SpaceNavigatorHID device is present. Please click open the highlighted entries and post a screenshot. image

klvnptr commented 3 years ago

Yes, I'm using Space Navigator. image

PatHightree commented 3 years ago

Ok good, the SpaceNavigatorHID device is detected on Mac, that's a big step forward. Can you double click the top SpaceNavigatorHID entry and post a screenshot of that. Should look like this : image

Please move the puck and tell me if both translation and rotation data changes, or only one of the them. If both are changing, please try to move only one axis for translation and see if the values correspond with the movement you made. Then do the same for rotation.

makaruk commented 3 years ago

Hi @PatHightree

Yes, I also confirm I'm running the Space Navigator - please see the attached Analysis/Input Debugger screenshot.

And when I double click it the popup window appears with the details - however none of the sensors receive any input.

When I move the SpaceNavigator the values do not change.

When I disconnect the SPaceNavigator from the USB port it dissapears from the Input Debugger entirely and reappears after reconnecting - so there's no USB malfunction and anyway it works OK with other software.

Screenshot 2021-03-15 at 13 40 08 Screenshot 2021-03-15 at 13 39 29 Screenshot 2021-03-15 at 13 38 36 Screenshot 2021-03-15 at 13 44 11
PatHightree commented 3 years ago

Well, those Input Debugger screenshots look identical to mine.

I don't have a mac and organizing one and setting it up for development is not really doable at the moment. I can instrument the driver with debug logs, that might tell me where the initialization flow breaks.

PatHightree commented 3 years ago

I just pushed 2.0.0-beta.4 which contains the debug logs. Enable logging by adding SPACENAVIGATOR_DEBUG to Project Settings/Player/Scripting Define Symbols and click Apply.

makaruk commented 3 years ago

Hi @PatHightree I removed the SpaceNavigator Driver from the system and it started responding!

However it is quite jittery. I'm using 2.0.0-beta.4 with debugging enabled.

The first thing I noticed is that it RANDOMLY moves the MOUSE cursor and moves the focus away from Unity Editor - most often when i PUSH THE NAVIGATOR DOWN - please see the attached movie to better understand it.

https://drive.google.com/file/d/1BDeVGIJxRVjai8ZAwowz3WELPHM4Nzf2/view?usp=sharing

Also it randomly moves the mouse cursor around the whole screen (most often the cursor goes into screen corners) - hence the dock and mac notification centre appearing randomly - no mouse is physically moved during the test.

Also when using the "Follow Curve" sample scene it works OK in the EDITOR mode but goes completely jittery in PLAY MODE.

Also the whole editor slows down in the first launch of the EDITOR mode in Unity in the "Fly Around" example - but when I switch to PLAY MODE it works normally.

Please see the DEBUG LOG from Unity in the link below:

https://drive.google.com/file/d/1R5I66Hm66l2J5wR1Ad0BcMZ-a5frhXCt/view?usp=sharing

Kind Regards

klvnptr commented 3 years ago

Values don't change for me as well :( image I have the latest driver installed. image

PatHightree commented 3 years ago

It's alive !

If the debug logging is on, then then it's normal that it's jittery. Turn off logging by removing the SPACENAVIGATOR_DEBUG symbol. Does that help ?

Looking at your log, there is much more going on than just my logs. The input system's InputManager is very unhappy about something.

This is logged over and over again:

InvalidCastException: Specified cast is not valid.
  at UnityEngine.InputSystem.InputManager.OnBeforeUpdate (UnityEngine.InputSystem.LowLevel.InputUpdateType updateType) [0x00046] in /Users/r2d2/Desktop/newinputsystem/Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/InputManager.cs:2198 
  at UnityEngine.InputSystem.LowLevel.NativeInputRuntime+<>c__DisplayClass10_0.<set_onBeforeUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType updateType) [0x00000] in /Users/r2d2/Desktop/newinputsystem/Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/NativeInputRuntime.cs:101 
  at UnityEngineInternal.Input.NativeInputSystem.NotifyBeforeUpdate (UnityEngineInternal.Input.NativeInputUpdateType updateType) [0x0000f] in /Users/bokken/buildslave/unity/build/Modules/Input/Private/Input.cs:105 

The strange thing is that my code is nowhere in the call stack, very strange.

The mouse moving by itself sounds like something I've seen here on windows : pitching the SN scrolls lists up/down On windows 3dconnexion installs a keyboard/mouse emulator, maybe something simmilar is installed on mac ?

makaruk commented 3 years ago

On windows 3dconnexion installs a keyboard/mouse emulator, maybe something simmilar is installed on mac ?

I don't think there is a mouse emulator on mac - and anyway thee driver is now removed from my system and OSX trie to be kind of thorough when removing stuff - but this is something I am unable to check in detail unfortunately...

And I am not really sure why the input manager would have a problem... this is a project with thee new input manager and space navigator driver imported - nothing else was done on the project...

klvnptr commented 3 years ago

Installed beta4. No luck :( Numbers are still not moving. image

PatHightree commented 3 years ago

@klvnptr have you tried uninstalling the 3DConnexion driver ?

klvnptr commented 3 years ago

No. I didn't touch the driver. If I uninstall that, how can I use SpaceMouse with Cinema4D and Blender using my settings?

PatHightree commented 3 years ago

Right, I'm affraid that is the only way to get data into the Unity driver at the moment. And even then it's not working smoothly yet.

Until I get access to a mac, I won't be able to make much progress in debugging the mac side of the driver. Kinda figures... Unity didn't work out of the box with SN on windows either :\

PatHightree commented 3 years ago

I have a mac now, so I can finally look into this issue. However, I am unable to reproduce the issue on my machine, editor and runtime navigation are working as expected. The latest 3Dconnexion software version 10.6.7 is installed. Oddly enough that is a lower version number than was reported earlier in this thread (10.7.0). Maybe 3Dconnexion pulled 10.7.0 for some reason, or maybe it is because of my mac mini, which is running an older version of macos. Can you try again with 10.6.7 please ?

chargedneuron commented 2 years ago

Im a bit late to the party here. I have tried to get the new Space Navigator package to work without luck also, (on a Mac), but haven't put much effort in to it yet.

The reason you are seeing a different Driver version is because 3dconnection released a beta driver to address the significant changes to macOS Extensions. The beta driver was a little bit difficult to find. See this link; https://3dconnexion.com/us/support/faq/beta-driver-for-macos-11-big-sur/

the discussion for the beta driver can be found here; https://forum.3dconnexion.com/viewtopic.php?f=23&t=39825

Also it is recommended to update the Space Mouse Firmware to match the 'newer' driver.

My issues seem to match those above, where the Space Mouse is usable in other programs but not Unity. I will install the latest repo later today and test it again.

chargedneuron commented 2 years ago

I can confirm that uninstalling the 3DConnexion Driver does allow input to arrive into the Unity Input System. However at this time I can not rotate the camera in the editor, (tested on SN 2.0.0.beta-7 vs 2021.2.1.f1, 2021.1.28f LTS, 2020.3.22f1 LTS, and 2019.4.32f1 LTS). I see that missing Rotation input is mentioned on other threads.

The 3DConnexion driver is needed to get the macOS to recognize the left hand buttons as Keyboard Keystrokes. In other words, the new(er) macOS will not directly recognize the ESC, Shift, CTRL, ALT buttons as keystrokes without the driver, (as I understand it). I can confirm this because without the driver installed Blender does not 'see' these keys. And even with the driver macOS still ignores some of these buttons in Blender using the beta driver 10.7.0 (known issue for this driver vs macOS).

I am using a SpaceMouse Pro Wireless, and a SpaceMouse Wireless. Both wired and wireless modes.

h-a-n-n-e-s commented 1 year ago

Hi! Is there any news about using the SpaceMouse in Unity on a Mac?

Same as above, I can confirm that for the SpaceNavigator Driver (2.0.0-pre.9), the HID is detected but the numbers don't change if I move the SpaceMouse.

I haven't uninstalled the 3DConnexion Driver since I need it for all my other programs to work with the SpaceMouse, so this is not an option for me.