Jump to content
Ultimaker Community of 3D Printing Experts

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 the latest RawMouse.zip from  https://github.com/smartavionics/RawMouse/releases into your plugins directory, connect your Spacemouse,  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 releases
  • Like 6
  • Thanks 2
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.

  • 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.

  • 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

  • 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.

  • 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.

  • 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
  • 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.

  • 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
    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.

  • 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.

  • 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.

  • 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.

  • 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?

  • 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.

  • 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°.

  • 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.

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

    Will the step "disable the normal Spacemouse driver" still be needed in the final version?

    Will a later version be available in the Cura Marketplace?

    Moving from CAD to Cura and then back to CAD for incremental improvements, this will be cumbersome.

  • Link to post
    Share on other sites
    Posted (edited) · New plugin - RawMouse
    1 hour ago, MarcusWolschon said:

    Will the step "disable the normal Spacemouse driver" still be needed in the final version?

     

    I'm not sure it's required now, Windows users have reported that you don't have to do that and that Cura and other apps can share the mouse.

     

    1 hour ago, MarcusWolschon said:

    Will a later version be available in the Cura Marketplace?

     

    Probably not.

     

     

    Edited by burtoogle
  • Link to post
    Share on other sites
    Posted (edited) · New plugin - RawMouse
    12 minutes ago, burtoogle said:

     

    I'm not sure it's required now, Windows users have reported that you don't have to do that and that Cura and other apps can share the mouse.

     

     

    Probably not.

     

     

     

    Why not? All other feature-plugins are there, the compatibility with different cura versions are taken care of,

    there are update notifications and aparently the "plugins" directory is managed by Cura and not supposed to have user content.

     

    So you have to repeat that with every single Cura update. Sometimes multiple times a week.

    With Windows making it difficult to navigate to your own user directory,

    hiding the "\AppData" directory,

    having 3 different profile directories,

    2 of them having "cura" subdirectories ("Roaming" and "local")

    while it should of cause be named "Ultimaker" with a "Cura" subdirectory, so you don't find it when searching for the manufacturer name.

    😕

     

    Is there a global "plugin" directory for all Cura versions, so the installation needs to be done only once?

     

     

    (Damn, why does this forum software give me a notification about a mention after having just replied to that mention?)

     

    Edited by MarcusWolschon
  • Link to post
    Share on other sites
    Posted · New plugin - RawMouse
    3 hours ago, MarcusWolschon said:

    With Windows making it difficult to navigate to your own user directory

     

    See `"`Help -> Show configuration folder" in Cura.

     

    I do second your "why not?" though. @burtoogle, if I can be of help maintaining the package in the Marketplace, let me know.

  • Link to post
    Share on other sites
    Posted · New plugin - RawMouse
    8 minutes ago, ahoeben said:

     

    See `"`Help -> Show configuration folder" in Cura.

     

    I do second your "why not?" though. @burtoogle, if I can be of help maintaining the package in the Marketplace, let me know.

     

    Well, you have to install it before starting Cura.

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

    And starting Cura one extra time kills you?

  • Link to post
    Share on other sites
    Posted · New plugin - RawMouse
    2 minutes ago, ahoeben said:

    And starting Cura one extra time kills you?

    Oh yes, absolutely. 😉

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

    I have a SpaceMouse for years but always worked from my notebook and was too lazy to have it permanently connected. Now I got an iMac and have now everything on my desk. After configuring the devices for Fusion360, I remembered that you made a plugin for Cura too, which was always terrible to operated, because it is completely different than all other 3D applications.

     

    What should I say, it is perfect and beside that I can now move, tilt, zoom also in Cura, and I love the function for the layer slider, it is amazing!

     

    Many thanks @burtoogle for your work, I love this plugin!

  • 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...