Using SpaceNavigator with GIMP

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
ettore
Moderator
Moderator
Posts: 127
Joined: Wed Mar 14, 2007 5:55 pm
Location: SF Bay Area, CA

Using SpaceNavigator with GIMP

Post by ettore »

GIMP on Linux has a nice input controller module that can be configured to use our devices. Let's see how we can enable it and work around a few problems we'll encounter. I'll keep this post as short as possible and post more explanations later.

1. Download the ndof_input.sh script from here, copy it inside /lib/udev/ and make sure it has execution rights:

Code: Select all

chmod a+x /lib/udev/ndof_input.sh 
You will need root priviledges for this.

2. Add (as root) the following line to /etc/udev/rules.d/10-local.rules or create file if it doesn't exist:

Code: Select all

KERNEL=="event*", IMPORT{program}="ndof_input.sh %p", NAME="input/%k", GROUP="ndofusers", MODE="0644"
3. Terminate the 3Dconnexion driver if you have it running. Unfortunately GIMP is not compatible with our driver and the two interfere with each other.

4. Disconnect and reconnect our device if you had it plugged in.

5. Open GIMP --> Prefs --> Input Controllers. Add the "Linux Input" entry to the panel on the right. Double-click on it to configure it.

6. Open the "Device" drop-down list, you should see your 3Dconnexion device. (If you don't, repeat step 4.) Select the device. The "State" label should update to something like "Reading from /dev/input/eventN"

7. Now we can map the actions to the events. This is kind of up to you, but anyway these are my favorites:
Event "Button 0" Action: "tools-paintbrush"
Event "Button 1" Action: "tools-airbrush"
Event "X Move Left" Action: "view-scroll-left"
Event "X Move Right" Action: "view-scroll-right"
Event "Y Move Forward" Action: "view-scroll-up"
Event "Y Move Back" Action: "view-scroll-down"
Event "Z Axis Turn Left" Action: "tools-paint-brush-scale-decrease"
Event "Z Axis Turn Right" Action: "tools-paint-brush-scale-increase"

8. Click OK and close all panels.

You now should be able to pan the image L/R/U/D if it's zoomed in, select your favorite tools with the SpaceNavigator buttons, and increase/decrease the brush sizes by twisting the knob left/right. A cool thing is that you can change the brush size and paint at the same time. Feel free to play around with the other actions, GIMP is fully configurable.

One problem with this solution is that the sensitivity and speed is not adjustable. I hope it's helpful anyway. Feel free to report any issues or improvements.
Last edited by ettore on Thu May 15, 2008 6:55 pm, edited 6 times in total.
ettore pasquini
software engineer
3Dconnexion, inc.
ettore
Moderator
Moderator
Posts: 127
Joined: Wed Mar 14, 2007 5:55 pm
Location: SF Bay Area, CA

Post by ettore »

A few in-depth notes on the above post.

- Regarding point 1 : the intent of the script is to detect NDOF devices only. This should include our devices and analog joysticks, but it should leave out keyboards, 2D mice, and other devices. To verify how devices are added, type

$ ls -la /dev/input/event*
crw-r--r-- 1 root ndofusers 13, 65 2008-02-29 11:06 /dev/input/event1

You should see lines like the above only for your joysticks and 3D mice.

- Regarding point 2 : As it's written in the previous post, the rule adds the device with "read" permissions for everybody. This is fine for most users. However, if you're concerned about security in a multi-user workstation, the group "ndofusers" is something you could use to restrict access to NDOF devices to only users belonging to that group. Of course you'll need to add the users to the group if you want to do that:

Code: Select all

# groupadd ndofusers
# adduser ettore ndofusers
Change the local-rules entry to a more restrictive:

Code: Select all

KERNEL=="event*", IMPORT{program}="ndof_input.sh %p", NAME="input/%k", GROUP="ndofusers", MODE="0640"
Now only users who belong to the "ndofusers" group will be able to use NDOF deviceswith GIMP.
ettore pasquini
software engineer
3Dconnexion, inc.
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

awesome :D
Absum
Posts: 53
Joined: Tue Apr 24, 2007 4:00 am
Location: Sweden
Contact:

Post by Absum »

typo in the url btw

should be:
http://cubelogic.org/downloads/ndof_input.sh
ettore
Moderator
Moderator
Posts: 127
Joined: Wed Mar 14, 2007 5:55 pm
Location: SF Bay Area, CA

Post by ettore »

Absum wrote:typo in the url btw
thanks -- fixed!
ettore pasquini
software engineer
3Dconnexion, inc.
abeowitz
Posts: 2
Joined: Thu May 15, 2008 6:33 pm
Contact:

Post by abeowitz »

Thanks! This is useful!

Can't adjust sensitivity as mentioned, but it works!
abeowitz
Posts: 2
Joined: Thu May 15, 2008 6:33 pm
Contact:

Gimp

Post by abeowitz »

OK, question.

Is 'sensitivity' controlled by the number of events? in other words, this script is called with EACH event then?
simoncion
Posts: 1
Joined: Sat Jul 26, 2008 1:12 pm

Post by simoncion »

Is 'sensitivity' controlled by the number of events? in other words, this script is called with EACH event then?
As I read it, no.

The linked script has nothing to do with processing events generated by the SpaceNavigator. The script is run by udev, the Linux device manager. The line that you add to 10-local.rules says "for each 'event' device, run this helper script. If it returns A-OK, then make this device owned by 'ndofusers'".

Anyway, It seems to me as if GIMP is not taking into account the *magnitude* of the axis movement, so you seem to only get one speed of adjustment... *WAY* too fast for small images and *WAY* too slow for huge images. *sigh* I wonder what it would take to make GIMP consider the magnitude...
GPD
Posts: 5
Joined: Fri Feb 06, 2009 7:32 pm
Location: greece

Post by GPD »

found it more useful to
put scroll up/down left/right to both translation and rotation to this direction, so I have a choice of two "speeds" because it receives two events.

Also, put scroll in/out to the buttons.

Helps, but still it is not what it should.

We should be able:
- to zoom in and out with the controller (not working usefully)
- translate page left right with speed control
-
ideas_arte
Posts: 3
Joined: Mon Nov 03, 2008 2:22 pm

Post by ideas_arte »

I have GIMP 2.6.7 running on Mac OSX 10.6.1, any idea how to apply this?
:wink:
I have a SpaceNavigator SE, and this is the version of drivers:
Image

if a solution will be very happy and grateful.

Greetings from Central America :D
ideas_arte
Posts: 3
Joined: Mon Nov 03, 2008 2:22 pm

Post by ideas_arte »

sorry for talking about mac on linux, but need help

:oops:
bmeagle
Posts: 1
Joined: Sat Sep 11, 2010 12:13 pm

Post by bmeagle »

Hi all

Got a space navigator and I'm trying to get beyond the paper weight spinning cube stage.
When running ndof_input.sh I get the following error:

Code: Select all

./ndof_input.sh: line 23: 0x03: command not found
./ndof_input.sh: line 24: 0x04: command not found
./ndof_input.sh: line 25: 0x00: command not found
./ndof_input.sh: line 33: 0x16: command not found
./ndof_input.sh: line 41: /syscapabilities/ev: No such file or directory
./ndof_input.sh: line 42: /syscapabilities/rel: No such file or directory
I am running gentoo linux, any ideas?

Regards
arkanoid
Posts: 4
Joined: Mon Aug 27, 2012 7:44 am

Re: Using SpaceNavigator with GIMP

Post by arkanoid »

What about serial Spaceballs?
Post Reply