spacenav on windows

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Zeropoint
Posts: 10
Joined: Wed Sep 23, 2020 1:03 pm

spacenav on windows

Postby Zeropoint » Sat Oct 10, 2020 2:00 pm

Hi,
I wasnt sure if this should go in help or developers.
I am using freecad .19 on windows 7
I have a spacenav 6dof device. It works with freecad. I would like to remap the axis. I have done this with inventor by editing /users/xxx/appdata/3dconnexion/3dware/cfg/inventor.xml

There is a .cfg file generated for freecad and I am able to change settings with the 3dconnexion interface, any of these changes does not result in changes in freecad.

The only changes that freecad recognizes is the changes on tools-->customize-->spacemouse, I do not see a config file for these settings anywhere or the ability to remap the axis.

The 3dconnexion softerware offers an up-down motion for zoom. This is what I am trying to acheive. I was able to remap axis on linux by adjusting the driver. The same does not seem to work on windows. It appears freecad is using the raw input and not the output of the 3dconnexion driver.

Thanks
wmayer
Site Admin
Posts: 17321
Joined: Thu Feb 19, 2009 10:32 am

Re: spacenav on windows

Postby wmayer » Sat Oct 10, 2020 7:48 pm

I have a spacenav 6dof device
I guess you mean SpaceMouse Navigator. You have to be careful with the naming because on Linux there is a package called spacenav and that offers an alternative driver for most space mouse models.
I have done this with inventor by editing /users/xxx/appdata/3dconnexion/3dware/cfg/inventor.xml
We don't use the 3dconnexion driver for FreeCAD -- neither on Windows nor on Linux or macOS. On Windows we use an implementation based on the so called raw events which are forwarded to the Qt event loop and they are processed in a special event handler.
So, any changes you make on configuration files of the official driver doesn't affect FreeCAD.

Some months ago somebody extended our 3dconnexion support by adding the file 3Dconnexion.xml that you should find in the FreeCAD installation. You might be able to extend this XML files by further models. User changes are not saved to this file, they all go to the global config file (user.cfg)
The only changes that freecad recognizes is the changes on tools-->customize-->spacemouse, I do not see a config file for these settings anywhere or the ability to remap the axis.
We don't have a separate config file for space mouses. All user settings are saved in user.cfg.
The 3dconnexion softerware offers an up-down motion for zoom. This is what I am trying to acheive. I was able to remap axis on linux by adjusting the driver. The same does not seem to work on windows. It appears freecad is using the raw input and not the output of the 3dconnexion driver.
Yes.
User avatar
Kunda1
Posts: 10537
Joined: Thu Jan 05, 2017 9:03 pm

Re: spacenav on windows

Postby Kunda1 » Sat Oct 10, 2020 8:25 pm

We should probably add that to 3Dconnexion_input_devices
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Zeropoint
Posts: 10
Joined: Wed Sep 23, 2020 1:03 pm

Re: spacenav on windows

Postby Zeropoint » Sat Oct 10, 2020 9:52 pm

I will take a look for the 3Dconnexion.xml file in freecad.

I did some searches and kept coming back to the wiki https://wiki.freecadweb.org/3Dconnexion_input_devices that had me believing that fc used the 3dconnexion driver.

Code: Select all

Windows

As of version 0.13, 3D mouse is supported under Windows. You need to have 3Dconnexion drivers installed. 
Thank you for a bit of direction.
Zeropoint
Posts: 10
Joined: Wed Sep 23, 2020 1:03 pm

Re: spacenav on windows

Postby Zeropoint » Sun Oct 11, 2020 12:31 am

It looks like the 3dconnexion.xml file contains the default settings adjustable via the ui. It is then copied to c:\user\xxx\appdata\roaming\freecad\user.cfg for recall.

I understand now that the 3dconnexion driver is only to get the hid device registered with windows, the inputs then become available to fc.

It looks like I can edit FreeCAD/src/Gui/GuiApplicationNativeEventAware.cpp and rearrange the motionDataArray, it would be nice to have a setting where you just specify the input axis array order, something like default motionDataArrayOrder[0,1,2,3,4,5] and reorder the input axis like motionDataArrayOrder[2,1,0,3,4,5], even if this was only editable in the user.cfg file. c:\user\xxx\AppData\Roaming\FreeCAD\user.cfg
I see that flipxy does some rearranging in the code from
FreeCAD/src/Gui/GuiApplicationNativeEventAware.cpp

Code: Select all

        i = motionDataArray[1];
        motionDataArray[1] = motionDataArray[2];
        motionDataArray[2] = - i;

        i = motionDataArray[4];
        motionDataArray[4] = motionDataArray[5];
        motionDataArray[5] = - i;
        
wmayer
Site Admin
Posts: 17321
Joined: Thu Feb 19, 2009 10:32 am

Re: spacenav on windows

Postby wmayer » Mon Oct 12, 2020 12:16 pm

git commit e3c30e748

Create the Remapping key of type Integer and set its value to a number built of the digits 0, 1, 2, 3, 4 and 5. If the first digit is 0 it can be omitted.
Zeropoint
Posts: 10
Joined: Wed Sep 23, 2020 1:03 pm

Re: spacenav on windows

Postby Zeropoint » Tue Oct 13, 2020 1:38 am

:shock: That is awesome! will give the edits a shot.
User avatar
Kunda1
Posts: 10537
Joined: Thu Jan 05, 2017 9:03 pm

Re: spacenav on windows

Postby Kunda1 » Wed Oct 14, 2020 1:05 pm

issue #4455 was opened in conjunction with this thread.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Zeropoint
Posts: 10
Joined: Wed Sep 23, 2020 1:03 pm

Re: spacenav on windows

Postby Zeropoint » Thu Oct 15, 2020 12:00 am

Thanks @Kunda1 & @wmayer . I was able to compile and test. Works well with edit of the user.cfg file.

also is there a method to pull the compiled copy from travis-ci without generating a release?
This if the first time I compiled freecad and used cmake, getting all the folders selected correct and folder privileges correct too a few tries .
User avatar
sgrogan
Posts: 6357
Joined: Wed Oct 22, 2014 5:02 pm

Re: spacenav on windows

Postby sgrogan » Thu Oct 15, 2020 11:27 am

Zeropoint wrote: Thu Oct 15, 2020 12:00 am also is there a method to pull the compiled copy from travis-ci without generating a release?
Unfortunately no.
"fight the good fight"