PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
171 stars 53 forks source link

After closing, plugin looses connection to mouse when open again #1

Closed codenotes closed 3 years ago

codenotes commented 10 years ago

I find that after I close the panel for the mouse, I can never get the spacemouse active again. I have to restart Unity altogether.

This an issue as I use the spacemouse for both my 3d modelling program and unity, so I think I have to shut down the the unity plugin periodically.

PatHightree commented 10 years ago

Hi there, sorry for the late reply, I was on holliday. I know that the unity driver loses the connection sometimes, this is due to the fact that I'm not using the recommended method of communicating with the 3ddconnexion driver (because that uses COM which doesn't work under unity/mono). Instead, I am polling the 3ddconnexion driver for info. I suspect that the problem has to do with the life cycle of a editor window (my code is hooked to an editor window callback). I'm planning to rewrite the driver so that it doesn't need the editor window to be open anymore, so that might fix this persistence bug as well.

codenotes commented 10 years ago

Yeah, it is absolutely tied to the editor window. When I close that, it's gone and it won't come back online.

It is always amazing to me that folks still use COM. I used to develop in that back in the day using ATL. Crazy that it's still around.

Maybe I can help; il examine the code and see if I have any thoughts. I think the 3dconnexion does everything through hwnd messages, right? So maybe a hidden window that stays open‎? Pass along the messages via pipes or something...

I've used 2 other 3d mouse for unity libraries. I think yours is the most comprehensive and best.It is just that persistence issue.

From: Patrick Hogenboom Sent: Wednesday, November 20, 2013 6:48 AM To: PatHightree/SpaceNavigator Reply To: PatHightree/SpaceNavigator Cc: Greg Brill Subject: Re: [SpaceNavigator] After closing, plugin looses connection to mouse when open again (#1)

Hi there, sorry for the late reply, I was on holliday. I know that the unity driver loses the connection sometimes, this is due to the fact that I'm not using the recommended method of communicating with the 3ddconnexion driver (because that uses COM which doesn't work under unity/mono). Instead, I am polling the 3ddconnexion driver for info. I suspect that the problem has to do with the life cycle of a editor window (my code is hooked to an editor window callback). I'm planning to rewrite the driver so that it doesn't need the editor window to be open anymore, so that might fix this persistence bug as well.

— Reply to this email directly or view it on GitHubhttps://github.com/PatHightree/SpaceNavigator/issues/1#issuecomment-28883415.


This email, along with any attachments, may be considered confidential and/or proprietary. If you have received it in error, you are on notice of its status. Please notify me immediately by reply email and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. Thank you for your cooperation.

Enteleform commented 6 years ago
Device:  SpacePilot SP1
OS:      Windows 10.0.16299.431 Pro x64
Unity:   2018.1.0f2

Similar issue here. I'm not closing the window, but am getting the same effect when working between different applications.

For example, I was just working through a tutorial on YouTube. I attempted to use the SpacePilot while YouTube was still focused, and it worked but at about 1/10th of the speed as it normally does, with an additional stuttering/glitchy quality. When I realized that YouTube was focused & switched back to Unity, the SpacePilot resumed its expected functionality. However, this behavior is intermittent. Sometimes it resumes functionality, and sometimes it ceases to work - at which point I'll have to restart both the SpacePilot driver & Unity.