Jump to content
burtoogle

New plugin - RawMouse

Recommended Posts

Posted (edited) · New plugin - RawMouse

I have created a plugin that lets Cura access HID mouse devices such as the 3Dconnexion Spacemouse. It's called RawMouse because the plugin interfaces directly to the raw device without the aid/hinderance of an operating system driver. It's not a sophisticated all-singing, all-dancing interface, it simply converts the HID mouse commands into the equivalent 2D mouse  commands.

 

It has been (vaguely) tested on Linux and Windows 10 and it should also function on MacOS (10.13 upwards).

 

For a quick install, unzip https://github.com/smartavionics/RawMouse/releases/download/1.0.4/RawMouse.zip into your plugins directory, connect your Spacemouse, disable the normal Spacemouse driver (i.e. run Windows menu -> Stop 3DxWare) and start Cura.

 

The usual weasel words apply, it's supplied with no warranty, YMMV, etc.

 

All feedback is welcome. Either comment in this thread or open an issue on the github page.

 

Edited by burtoogle
Updated link to zip
  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Just test it. Nice, a good start and it works surprisingly with active 3DxWare. Seems I like to use it. I've recognize you allow only to flip the bed on the x axis. Would be great if you can activate this for y as well 🙂

Thanks a lot.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse
18 minutes ago, DivingDuck said:

Just test it. Nice, a good start and it works surprisingly with active 3DxWare. Seems I like to use it. I've recognize you allow only to flip the bed on the x axis. Would be great if you can activate this for y as well 🙂

Thanks a lot.

 

Thanks for the feedback. I'm not sure what you mean by flipping the bed on the y axis. If you mean change the direction of movement, that can easily be accomplished by editing the config file and changing the sign of the appropriate scale value. You don't even need to restart cura, just goto the RawMouse menu and restart to read the new config file.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

You are wellcome. Maybe this makes it a bit more clear. I can't activate the second one with the red arrow. Is it rotation y? I'll try to figure out what this axis command is called in the xml config file of 3xd and how to put this in your config file.

 

It would be great if you will be some when able to read out the original xml config file (a whish for future improvements 🙂 )

cura_3dx.PNG

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Ah, I understand. The Cura 2d mouse interface only supports rotation in the yaw and pitch axes. It doesn't support roll. I can possibly add that for the HID devices and add an additional rot axis. Will look into that.

 

It's unlikely that this plugin will ever make use of any 3Dconnexion software or related configuration files. Really, the whole point of it is to support HID devices without the need for any manufacturers drivers.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Hi @DivingDuck, thinking more about what you have said above, I don't believe you are actually using my plugin if you haven't disabled the 3Dconnexion driver. If the cursor moves when using the spacemouse, you are not using the RawMouse.

Share this post


Link to post
Share on other sites
Posted (edited) · New plugin - RawMouse

Well, we had both the same thought 🙂

After that I deactivate the 3dx driver and could continue using my Space Navigator. Then I deactivated your plugin and start the 3dx driver again but can't use the Space Navigator.

So, the simple story is (as fare as I had quickly test it), that your plugin activate the usage of the Space Navigator within Cura but as your plugin is using your own "setup" I can activate/deactivate used axis but not really use the setup values from 3Dconnexion.

 

In addition, your plugin allows the 3Dconnexion software to add a dedicated Cura profile. Now I need to find out how to use those values.

The configuration files are on c:\Users\YOUR_USERNAME\AppData\Roaming\3Dconnexion\3DxWare\Cfg\

I put a copy of the configuration file to this post for reference.

Cura.zip

Edited by DivingDuck
Add more info

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Here are my thoughts/feedback to your plugin.

I used it the last couple of days and I'm quite happy having it available. I made some minor value adjustments for 3dconnexion so that it fit's best for my environment.

 

One thing I was missing, as I wrote before, is supporting rolling the y-axis and it would be a benefit if this can be implemented some when in the future for Cura as this would be a seamless behavior to all 3D applications and highly reduce way's and time to inspect things.

The other thing I recognize was that I miss the possibility to set a pointer in space or to an object where I like to move/rotate. This is really helpful as an object of interest won't move out of visibility if the point/object isn't positioned at center of the print bed.

I guess, both request are out of scope for your plugin and need to be implemented in UI first, but I like to mention this, as it have a great impact of usability if one work in a more professional environment and need to inspect objects within Cura deeply before printing. Maybe the Cura development team can take this some when in the future for an enhancement.

 

If someone like to check the plugin for 3dconnexion's space mouse, here are my slightly different values as a starting point:

"spacemouse" : {
      "axes" : [
        { "offset": 0.0, "scale": 0.1, "threshold": 0.01, "target": "movx" },
        { "offset": 0.0, "scale": 50.0, "threshold": 1.0, "target": "zoom" },
        { "offset": 0.0, "scale": 0.1, "threshold": 0.01, "target": "movy" },
        { "offset": 0.0, "scale": 0.2, "threshold": 0.01, "target": "roty" },
        { "offset": 0.0, "scale": 0.05, "threshold": 0.01, "target": "none" },
        { "offset": 0.0, "scale": -0.3, "threshold": 0.01, "target": "rotx" }
      ],
      "buttons" : {
        "1": { "value": [ "3d" ], "target": "resetview" },
        "2": { "value": 1,        "target": "toggleview" }
      }
    }, 

I'm using the plugin with active 3DxWare, as I'm using my space mouse all the time in different applications and usually in combination with a normal mouse.

 

Please, make this plugin an official one 🙂 

 

I wonder, if other user using your plugin already and can give a feedback too.

Share this post


Link to post
Share on other sites
Posted (edited) · New plugin - RawMouse

Hi @DivingDuck, thanks for the feedback.

 

28 minutes ago, DivingDuck said:

One thing I was missing, as I wrote before, is supporting rolling the y-axis and it would be a benefit if this can be implemented some when in the future for Cura as this would be a seamless behavior to all 3D applications and highly reduce way's and time to inspect things.

The other thing I recognize was that I miss the possibility to set a pointer in space or to an object where I like to move/rotate. This is really helpful as an object of interest won't move out of visibility if the point/object isn't positioned at center of the print bed.

 

I can understand your wishes. As you know, at the moment, RawMouse simply emulates the normal 2D mouse so as that can't roll then neither does RawMouse.  I have started toying with support for other targets that would manipulate the view differently. So I have tried using a 3 axis tumble so you can roll, pitch and yaw the camera view but, to be honest, I found it difficult to use. Also, if you then use the 2D mouse, the view will snap back to zero roll  which is a bit disconcerting. I will do more work on this when I get the time.

 

I like the idea of using the 2d mouse to select a point to be rotated around and I will look into how that could be achieved.

Edited by burtoogle
s/yaw/roll/
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Hi @DivingDuck, I have added support for the roll axis and made a new release (1.0.3). Your config file will need to be altered. Change targets rotx to rotyaw, roty to rotpitch and none to rotroll.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Wow, that's cool. I need to play with it more to find better settings for roll and pitch. The new device information window is nice too  🙂

 

Zooming seems to be a bit flimsy and have  little jumps in and out while zooming.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Do you even have jumpy motion when looking at the prepare view? For me all motion is smooth there. When looking at the preview (sliced), it can be jumpy depending on how big/complex the model is. Obviously depends on  GPU performance.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

It happen in all views when rolling on x-axis and there seems to be an interference with zoom involved. Need to check if this can be solved with other settings. I maybe need to find a better balance between velocity and response time

 

GPU performance can be an issue. On the other side, this computer have a RX 580 8GB.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

I think, I know what happen. While rotation isn't limited to 360° it seems that there is an limit for rolling on x and y. Is this correct?

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

There is some discontinuity in the pitch movement and also I have noticed the new rolling movement can cause the view to go blank when near the inverted position. I am still using what is essentially the same rotation code for yaw and pitch as the mouse uses. I am not getting glitches or blanks for "normal" moves/rots/zooms, i.e. no extreme angles or positions.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse

Adjusting maxhz to 50hz is solving the rolling/zoom flicker issue on my system. Now it is much smoother

I see the blank issue too near to the "end" when rolling. That's what I meant in my previous post. Maybe it is possible some when to make a continuous movement and correct the position to 1° or 359° when it is moving and will come to the value 0° or 360°.

Share this post


Link to post
Share on other sites
Posted · New plugin - RawMouse
23 minutes ago, DivingDuck said:

Maybe it is possible some when to make a continuous movement and correct the position to 1° or 359° when it is moving and will come to the value 0° or 360°.

 

Yes, maybe it's something like that. I will investigate and try and fix that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!