Blender and the Space Navigator under Gentoo

May 22nd, 2010

I have used Blender for some years now and I recently began to think about buying a 3dconnexion Space Navigator.

I read that Blender and the Space Navigator worked under Linux and managed to borrow a Space Navigator from work over this long weekend.

I downloaded the 32bit drivers (3DxWare for Linux (i386)) from http://www.3dconnexion.com/service/drivers.html as well as the “Blender plug-in for Linux i386 (beta)

Installing the Space Navigator driver

I extracted the 3dxware-linux-v1-4-3.i386.tar.gz file to /tmp/3d/

tar -xvzf 3dxware-linux-v1-4-3.i386.tar.gz -C /tmp/3d/
cd /tmp/3d/
sudo ./install-3dxunix.sh

I then recieved an error saying libXm.so.3 was missing.

/etc/3DxWare/daemon/3dxsrv: error while loading shared libraries: libXm.so.3: cannot open shared object file: No such file or directory

I pressed CTRL-C to abort the script.

After a little checking I found that I have libXm.so.4 but not 3, so I created a symbolic link from libXm 4 to 3.

sudo ln -s /usr/lib/libXm.so /usr/lib/libXm.so.3

I then re-ran the install script again.

This time it all worked.  I did not configure it to auto start though.

Now I simply started the driver via

sudo /etc/3DxWare/daemon/3dxsrv -d usb

and was greeted by the blue lights on the Space Navigator and the messages

3DxWareUNIX = V1.4.3
Device      = SpaceNavigator
Firmware    = V3.17

there was also a minimised window called 3DxWare 1.4.3, which appears the be the settings dialog (like the Windows Control Panel control)

I then ran the xcube example from /tmp/3d/ and the space navigator worked great.  I changed a few settings as I prefer pressing and pulling to be zoom in and out.

Installing the Blender plugin

I was a little surprised by this, as the forums said I should have a ~/.blender/ directory and I didnt.

I decided that creating the directory couldn’t cause any problems so I created a directory

mkdir -p ~/.blender/plugins/

and copied the 3DxNdofBlender.plug file into it.  The new NDOF icons appeared at the bottom of the viewport.  See http://www.blender.org/development/release-logs/blender-246/ndof-support/

Deviant Art Portfolio

April 9th, 2010

I have been using DeviantArt for some years now. 

See http://neilwightman.deviantart.com/

Recently they added new portfolio section which I really like.  I have only added a few photos to my portfolio @ http://neilwightman.daportfolio.com/

Ubuntu Alt-Right click to resize

April 9th, 2010

I recently moved my laptop from a Gentoo Linux distribution to Ubuntu. This was mainly that the rebuild time was very slow and updating my laptop, with gentoo, would take hours if not days. I decided to move to a binary distribution and chose Ubuntu. There was no real reason I chose Ubuntu over any other though.

Most of the setup was easy, the only issue I found was that Ubuntu uses Alt-Middle Mouse to resize the windows. I have used xfce for years and I just couldn’t get used to this change in Ubuntu.

I did alot of searching and could not find out how to change it.

…. some hours later …

Well I finally managed to get Ubuntu to resize with Alt-Right Click (button3).

By default Ubuntu resizes with Alt-Middle Mouse Button, my laptop mouse has a very small middle mouse button. I use xfce on my other linux boxes and I wanted all the Window Managers to function the same.

I tried installing the CompizConfig Settings Manager. I then disabled the Window Menu which was using Alt-Button 3 and went to the resize window setting and made that Alt-Button3. This seemed to be ok, until I tested it. The Alt-Button 3 was still showing the Window Menu.

I tried disabling the Window Menu totally, but the settings simply wouldnt stay.

After a bit of searching I found this.
https://bugs.launchpad.net/ubuntu/+source/compizconfig-settings-manager/+bug/146736
where it says:

open ccsm, go to Preferences, and if gconf is selected as a back-end, then make sure that the checkbox “Enable integration into the desktop environment” is unchecked.
Now you change change the bindings.

I’m not 100% what the “Enable integration into the desktop environment” checkbox provides, but everything seems to work ok with this checkbox disabled.

Also see http://wiki.compiz.org/CCSM#Backends_and_Integration

This workaround only works when you have the visual affects no though.  If you turn off the visual affect then compiz isnt controlling the right click any more and it goes straight back to opening the Window Menu.

I’m still trying to get the window manager to resize on right click without the visual effects being enabled. If anyone know, please let me know.

Lech 2010

April 2nd, 2010

Steve and I had a great time in Lech. The weather was really nice and sunny, good enough to snowboard in a T-shirt.

I took lots of photographs which are in the Lech 2010 gallery.

Like this

I also created some new panoramic images. These are here

We didnt take much video, that may be a good thing as I still have hours of videos from other trips which I have not processed yet.

Indent/Format the whole buffer in Emacs

February 8th, 2010

I have had an indent-buffer command like this for some time, which formats the whole current buffer. I used it for java, c++, css, html, xml and lisp.

(defun indent-buffer ()
    "Indent the current buffer"
    (interactive)
    (save-excursion (indent-region (point-min) (point-max) nil))
)

I found the above function at http://www.emacswiki.org/cgi-bin/wiki/ReformatBuffer

Recently I noticed that it was leaving tabs in (which I hate) and trailing spaces.  It was simply just indenting the buffer.

After some more searching today I found the untabify command and I created the following commands.  Mainly because I expected the command to be called something like tab-???

(defun untabify-buffer ()
    "Untabify current buffer"
    (interactive)
    (save-excursion (untabify (point-min) (point-max)))
)
 
(defun tab-to-spaces ()
    "Convert tab to spaces"
    (interactive)
    (save-excursion (untabify (point-min) (point-max)))
)

I then found this page, http://emacsblog.org/2007/01/17/indent-whole-buffer/ which has the best indent/format buffer function.

(defun indent-buffer-2 ()
    "Indent the buffer 2"
    (interactive)
    (save-excursion
        (delete-trailing-whitespace)
        (indent-region (point-min) (point-max) nil)
        (untabify (point-min) (point-max))
    )
)