Jump to content

Sign in to follow this  
Smicksus

Customizing viewport navigation to axis mouse

Recommended Posts

Hi peeps,

So I have this Lexip Mouse. It's a mouse with a joystick attached to the left side of the device, and also has an axis on the mouse body it self (view attached image).  Now I thought this would be super cool if I in some way can bind this joystick to the view port navigation. Just like a space mouse would work (https://www.3dconnexion.eu/products/spacemouser.html

 

I tried going to the customize commands but these navigation controls only seem to work with multiple bound commands like 1 + LMB and then drag the mouse to pan. 

My hope is that someone tried to do this with a joystick or something and can help me achieve the same result with my mouse. Maybe with a little scripting?

 

Well thanks for reading and I hope someone has some tips!

- smicksus

lexip-pu94-gaming-mouse.jpeg

Share this post


Link to post

That is infinitely more difficult than you think. (I once wrote an alternative SpaceMouse controller for C4D - CollieMouse - and it has tens of thousands of lines...)

 

First, the signals from the mouse are sent to a window (I'm talking Windows here, but I cannot imagine it being much different in MacOS). The C4D API does not provide any control over the message queue of the main program, nor does it allow you to open a window of your own, so you have to go through the Windows API to open your own.

 

Then, reading these signals requires control of the message queue, including waiting for the proper signals as defined by the mouse driver, so you need to create a thread in C4D - otherwise waiting for signals would just freeze C4D altogether. Your thread will need to communicate with a plugin in the main thread to perform the actual camera movement.

 

Finally, the camera movement depends on camera settings, viewport settings, and pivot placement, plus there is the question whether you want to rotate or translate - perhaps even move objects, but I never bothered with that.

 

Oh, and you may want to have a GUI and Preferences settings for the whole thing.

 

Thus, "a little scripting" will not happen. (It depends on the API for the mouse driver that the manufacturer provides whether it's possible at all without a ton of debugging and reverse engineering.)

 

That said, there used to be a multifunctional plugin that was able to gather various input signals and allowed to connect them to various targets. I forgot the name and don't know whether it would still work with current versions of C4D, but I believe it could use generic joysticks. That may be an option here - I'm sure someone else will remember?

Share this post


Link to post

Do you mean griptools?

https://www.griptools.io/

Share this post


Link to post
8 minutes ago, bezo said:

Do you mean griptools?

https://www.griptools.io/

 

hm, no, wasn't thinking of this one (although it may work, the description talks about "game HID devices". It may be a wee bit overkill for the purpose though).

 

The one I had in mind was specifically advertised for use with joysticks. But it was a while ago, and I'm not sure whether it even still exists.

Share this post


Link to post
29 minutes ago, bezo said:

Kevin Barnum´s Control4D?

http://www.kvbarnum.com/control4d/

 

Yay! That's the one!

 

(Still no idea whether that'd work with this special mouse. Under Windows, joysticks have a common interface (other than the SpaceNavigator one which is all proprietary) so there is a chance that this mouse-joystick is using that.)

Share this post


Link to post
  • Topic Author
  • 1 hour ago, Cairyn said:

    That is infinitely more difficult than you think. (I once wrote an alternative SpaceMouse controller for C4D - CollieMouse - and it has tens of thousands of lines...)

     

    First, the signals from the mouse are sent to a window (I'm talking Windows here, but I cannot imagine it being much different in MacOS). The C4D API does not provide any control over the message queue of the main program, nor does it allow you to open a window of your own, so you have to go through the Windows API to open your own.

     

    Then, reading these signals requires control of the message queue, including waiting for the proper signals as defined by the mouse driver, so you need to create a thread in C4D - otherwise waiting for signals would just freeze C4D altogether. Your thread will need to communicate with a plugin in the main thread to perform the actual camera movement.

     

    Finally, the camera movement depends on camera settings, viewport settings, and pivot placement, plus there is the question whether you want to rotate or translate - perhaps even move objects, but I never bothered with that.

     

    Oh, and you may want to have a GUI and Preferences settings for the whole thing.

     

    Thus, "a little scripting" will not happen. (It depends on the API for the mouse driver that the manufacturer provides whether it's possible at all without a ton of debugging and reverse engineering.)

     

    That said, there used to be a multifunctional plugin that was able to gather various input signals and allowed to connect them to various targets. I forgot the name and don't know whether it would still work with current versions of C4D, but I believe it could use generic joysticks. That may be an option here - I'm sure someone else will remember?

    Thank you for your explanation in your experience with this. It's very help full and in some way it gives me the motivation to make this actually work. although it will be a lot of work. I will look into the control 4D plugin maybe I can get it to work with that.

     

    If anything did the trick I'll post it here in the future.

    Share this post


    Link to post

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Sign in to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...