Wine


 Installation of SketchUp

  1. Install the Microsoft Windows Compatibility Layer "Wine":

    Go to the software center (or the equivalent of your distribution), search for Wine and click on install. The official stable version is wine1.2. However, it is recommended to use the latest (unstable) version 1.3.X which has many significant improvements. You can get the latest versions here http://www.winehq.org/download (or for Ubuntu add this to your software sources http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu). You can't expect that SketchUp works well with older Wine versions < 1.2.

    In your profile folder you will find a folder ~/.wine/drive_c (show hidden files with ctrl+H). That is the equivalent to C:\ on Windows, and there will be the program files and the SketchUp and Plugins folder like you are used to it on Windows.

  2. Download and install SketchUp by right clicking ⇒ "Open with Windows Application Loader Wine".
    The installation should work without problems, if not, see in the tricks below.

  3. Use the program Winetricks to install some extras (original windows files, that are not rebuilt by the Wine team) to make the installation work and to make webdialogs work. If Winetricks didn't come with your version of Wine, you can get it here: http://wiki.winehq.org/winetricks).

    1. Go to ~/.wine/drive_c/Program Files and rename the folder 'Internet Explorer' into 'Internet Explorer backup' or something.
    2. Start Winetricks either from the menu or by typing winetricks in a terminal. Choose the default Wine prefix and choose to install additional Windows DLLs.
    3. Then select the checkboxes for 'vcrun2005' (needed for the installation), 'gecko', 'ie8(needed for webdialogs) and 'flash'  (for streetview imagery).
    4. After installation of IE, delete the newly created folder 'Internet Explorer' and rename the backup into 'Internet Explorer'.
    5. Open Applications ⇒ Wine ⇒ Configure Wine. On the "library" tab, add an overwrite for wininet (this makes uploading work) and for ctl3d32 (this can be helpful for the component options/attributes window). Those two should be listed as "(native, built-in)".
  4. If you open SketchUp from the Application menu (under Wine ⇒ Programs), you will see the error message "SketchUp was unable to initialize OpenGL!" and a bugsplat. Now we need to change a setting in the Windows registry so that SketchUp will use hardware acceleration. This setting is available in the Preferences of SketchUp, but as we could not open SU, we will change this setting in the Wine registry.

    In the Application menu, click on wine ⇒ Browse C:\   and open windows/regedit.exe

    In the tree structure, go to the key HKEY_CURRENT_USER\Software\Google\SketchUp7\GLConfig\Display, and change HW_OK to 1.

    Additionally, go to the key HKEY_CURRENT_USER\Software\Google\SketchUp6\SnappyInstructor and change "Show" to 0.

  5. That's it.

    The success largely depends on the version of Wine and your Linux distribution. If you still encounter problems, try some of the following tricks that formerly had been necessary:

  • If you encounter problems with webdialogs, check that you never installed anything that has to do with .Net framework and that you don't use a msstyles window theme in Wine configuration. Eventually try from an empty wine prefix (see here for more instructions).
  • SketchUp 7.1 crashed before the install dialog appeared: SketchUp tried to connect to the internet. Disconnect from the internet, start the installer and connect to the internet later.
  • If it crashes in the "Welcome to SketchUp" dialog when you click "Start Using SketchUp", uncheck the box "show at startup". The corresponding registry setting is HKEY_CURRENT_USER\Software\Google\SketchUp7\WelcomeDialog "ShowOnStartup"="0"
  • In SketchUp 6, these registry changes can be necessary:
    [HKEY_CURRENT_USER\Software\Google\SketchUp6\GLConfig\Display]
    "FIRST_TIME"=dword:00000000
    "HW_OK"=dword:00000001
     
    [HKEY_CURRENT_USER\Software\Google\SketchUp6\Google SketchUp TOTD]
    "HelpPage"="0"
    "ShowOnStartUp"="false"
  • Older versions of SketchUp, Wine and Linux had problems with Intel chipsets. This made it necessary to disable "DRI" in the configuration of your X server, the graphical user interface of Linux. Open a terminal and type (example: Ubuntu)

    gksudo gedit /etc/X11/xorg.conf

    Search for the "Device" section and add the option to disable DRI.

    before:
    Section "Device"
        Identifier "Videocard0"
        Driver     "intel"
    EndSection
    after:
    Section "Device"
        Identifier "Videocard0"
        Driver     "intel"
        Option     "NoDRI"
    EndSection
    Then save it and restart your X server by pressing the key combination Ctrl+Alt+Backspace.

Use SketchUp with an external 2d graphics editor

  1. Copy this script into a text editor and save it in /usr/bin (or download it from here). You can replace gimp by any other program you like. Make sure it is executable by right clicking ⇒ properties ⇒ permissions.

    #!/bin/sh
    IMG=$(winepath -u "$*") /usr/bin/gimp "$IMG" exit 0

  2. Now open window  preferences in SketchUp. In the application section, you choose this script (from "Z:\usr\bin"). 

Set SketchUp files to be opened in SketchUp

The newest version of Wine is supposed to do the correct file format assignments automatically. If this is not the case, you can save the following in a text file and rename it as skp.sh. Make sure that the path matches to the location of your SketchUp.exe file. Then move it into ~/.wine .

#!/bin/sh
QUICKPARLOCATION="c:\\Programme\\Google\\Google SketchUp 7.1\\SketchUp.exe"
PARAM=`winepath -w "$*"`
wine "$QUICKPARLOCATION" "$PARAM"
exit 0

Right click on any SketchUp file, ⇒ properties, go to the "open with" tab and select the sh script (as custom command)

Make SketchUp beautiful

  1. Add an icon for SketchUp files: Save this image in the folder ~/.local/share/icons and rename it as

    application-x-wine-extension-skp.svg 

  2. Wine applications look very minimalist and old like Windows 2000. But you can change the colors or use a windows theme to make it look more like your other GTK applications. 

    Open Applications ⇒ Wine ⇒ Configure Wine. On the "Desktop Integration" tab, you can either modify the colors of the user interface by selecting an element and then a color or font. Or you choose a windows theme file (*.msstyles, *.theme, that you can find from www.deviantart.com). Note that this can cause conflicts with webdialogs.

    For having smooth, antialiased text in Wine, there exists a script that can enable this setting. Run these two commands in the terminal and choose the smoothing mode 3:
    wget http://files.polosatus.ru/winefontssmoothing_en.sh
    bash winefontssmoothing_en.sh

Enable thumbnails (in Gnome)

With a little python script, we can extract the thumbnail image that is stored inside a SketchUp file and add it to the system's thumbnails. Unfortunately SketchUp in Wine is not yet capable to create thumbnails (or export png images), so this works only for files that already contain a thumbnail (for example from Windows, or from 3D warehouse).
  1. Download this python script and save it in /usr/bin . Make sure it is executable by right-clicking ⇒ properties ⇒ permissions.

  2. Now you need to register it as a thumbnailer in the Gnome.
    In Gnome 3, save this file in /usr/share/thumbnailers.

    If you have Gnome 2, paste these two commands in the terminal:
  3. gconftool-2 -s /desktop/gnome/thumbnailers/application@x-wine-extension-skp/enable --type=bool true

    gconftool-2 -s /desktop/gnome/thumbnailers/application@x-wine-extension-skp/command --type=string "python /usr/bin/skp-thumbnailer.py %i %o"

If you want to create lots of thumbnails for already existing files (or nested directories) at once, you can do this manually with this bash script. It will create thumbnails for all files in the current directory or in a directory that you can pass as an argument.

Use SketchUp < 8.0 with Google Earth

Importing terrain from Google Earth can work in SU6-SU7.1 if you use the Windows version in Wine instead of the native Linux version.
Install Google Earth in Wine (make sure you have not the GoogleUpdater, but a complete installer >10 MB, go to the download page and choosing "advanced setup".
  • importing terrain from Google Earth works, but it might look like GE freezes for a minute.
  • exporting a model to Google Earth does not work, because Sketchup in Wine ( <1.3.7) can't create Collada files.

Make Plugins work in Wine versions < 1.2

Ruby plugins are written in a Windows text format instead of UNIX format (the difference is that windows uses 2 symbols for a line ending and displays them as one). So you will need to convert the Ruby scripts into UNIX format using the program tofrodos (unfortunately only available for the terminal, but that should not be too difficult). You can find and install tofrodos either in the software center or on the terminal:

  1. Open the terminal and copy this line

    sudo apt-get install tofrodos

    and press enter to install that program.

  2. If you have downloaded a Ruby script and want to convert it, open the terminal and go to that folder (example: your Desktop) by typing

    cd ~/Desktop

  3. To convert all Ruby scripts (that have the extension .rb) in that folder, copy this line into the terminal and hit enter

    fromdos *.rb

  4. Now you can move the scripts into ~/.wine/drive_c/Program Files/Google/Google SketchUp 7/Plugins

What does not work

Thanks to many efforts from both the Wine developers and the Sketchup team, Sketchup has become very stable. Nevertheless there are some negligible annoyances and only few functions that do not yet work.
  • in some installations, the integrated IE browser ("Get models from 3D warehouse" etc.) displays a blank page.
    workaround: Installing 'ie8' and 'gecko' via Winetricks as described above should fix that.
  • When uploading to 3D Warehouse, the upload button didn't have an effect.
    workaround: Installing 'ie8' and 'gecko' via Winetricks as described above and disabling msstyles themes should make uploading work, however in Wine <1.5.4 thumbnails of uploaded models are black.
    - because of the black thumbnails issue, you would probably prefer to export as kmz and upload it on the 3D Warehouse website (upper right corner).
    - or you use a SketchUp plugin that uses a work-around to upload models with thumbnail: [Plugin] Upload model with custom thumbnail
  • When hovering the border of the 3d view (especially after having moved an inspector window), the view pans up/down/sidewards without stopping. This is caused by both a bug in SketchUp and an issue with mouse input in Wine.
  • "Make unique texture" can log you out from your user session (eventually depends on the graphics card)
  • fixed in Wine 1.3.3: the Ruby Console didn't not recognize the enter key.
  • fixed in Wine 1.3.7: kmz/collada xml exporter and importer didn't work (⇒ you could use VirtualBox instead).
  • fixed in Wine 1.4-rc3: the inspector windows (materials browser, entity info etc.) can randomly stick to the cursor and move over the screen.
  • fixed in Wine 1.5.4: black images resulted from 2d Export, file thumbnails, component/scene/style thumbnails and the print preview (see this bug report of Wine).
  • fixed in Wine 1.5.4: Sketchy styles didn't show edges.
  • fixed in Wine 1.5.4: in exported 3d models, distorted textures and color shifts were not correctly baked into the textures.
    (...)

References

SketchUp 8.0
http://appdb.winehq.org/objectManager.php?sClass=version&iId=21290

SketchUp 7.1
http://appdb.winehq.org/objectManager.php?sClass=version&iId=18506

SketchUp 7.0
http://appdb.winehq.org/objectManager.php?sClass=version&iId=14562

Sketchup 6
http://appdb.winehq.org/objectManager.php?sClass=version&iId=6842

more sources:
http://robsworldoftech.blogspot.com/search/label/Sketchup 
http://www.indragunawan.com/2008/08/google-sketchup-6-on-linux.html
http://www.aksels.de/software.php#sketch


If you create models on Linux and upload them to 3D warehouse (ie. via VirtualBox), please let me know for adding them to our collection.

 

SketchUp in Wine survey

Please help us to get an overview about usage of SketchUp in Wine by filling out this form:
 

 

 

Oracle VirtualBox


VirtualBox (previously Sun VirtualBox) is a virtual machine that allows to use different operating systems within your running system. Thus it can demand much resources depending on the requirements of the guest operating system (recommendation: Windows XP). 

A virtual machine is the tool of choice to have a reliably working SketchUp or if Wine doesn't satisfy you.

Installation

VirtualBox comes in two versions: an opensource edition (OSE) and a commercial version which is free for personal use (PUEL) and contains some additional features like USB support.

  • for installing the OSE version, go to the software center (or the equivalent of your distribution) and search for 
    virtualbox-ose
  • for the PUEL version, you can download a debian installer from http://www.virtualbox.org/wiki/Linux_Downloads
After installation, VirtualBox offers a comfortable wizard for creating a virtual harddisk and machine. You'll need either a Windows install CD or an iso image.

Setting up a shared folder

Select the virtual machine and click on the "change" button (yellow gear), on the bottom of the list you can add a shared folder, to which both the Linux and the virtual machine will have access. It might be useful to create a symbolic link to the shared folder on your desktop. Then you can simply drop SketchUp files onto that folder.

[optionally] Optimizing the virtual system

As even Windows XP costs you around 2GB disk space and 300MB RAM, it could be useful to remove Windows components that you wouldn't use either. That way it can be possible to reduce the requirements of XP to 300MB disk space and 50MB RAM.
The program nLite (for XP) or vLite (for Vista) offer a "minimal" preset and lots of expert options (which could result in a not working disk image). The program creates a disk image which you can use instead of the original Windows install CD.


Building Maker


Building Maker is a web application that allows creating 3d buildings by placing the outlines of boxes on 2d photos. Unlike to other web applications, it officially requires the Google Earth Plugin and otherwise redirects you to an error message. Effectively the Google Earth Plugin is not essential (it only adds a 3d preview), all the rest works with standardized web technology that is available on Linux like on other systems. So we need to fool the Google website and make them believe the plugin is installed.
  1. First you install the Windows version of Firefox. It is a free browser that runs perfectly in Wine (in contrast to Internet Explorer).
  2. Then you need to install the Windows version of the Google Earth Plugin. In order to get the Windows version, it's best to access the download page from the just installed Firefox. As far as I know, Google only offers the Plugin bundled with Google Updater which doesn't work in Wine. So it's best to download the full installer for Google Earth by going to the download page and choosing "advanced setup" (the full installer is > 10MB).

  3. Finally you can install it and open the Windows version of Firefox and go to the Building Maker site. Now it should give you access to the tool without redirect. It is recommended to avoid the 3d preview because the Google Earth Plugin doesn't really run well in Wine, it works just enough to make the website believe it is installed.

    (For the 3d view, it would be necessary to set this registry key (~/.wine/drive_c/windows/regedit.exe):
    HKEY_LOCAL_MACHINE\Software\Google\GoogleEarthPlugin\Render\RenderingApi=1 )