FreeCAD document icon

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!
Post Reply
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: FreeCAD document icon

Post by triplus »

wmayer wrote:Good point! Maybe we should write this information to the console if the off-screen rendering failed.
This could be helpful! For example first thing i tried was this, when thumbnail was not created and information in console said:
To force full OpenGL use, set the environment
variable COIN_FULL_INDIRECT_RENDERING=1 and re-run the application.
If information mentioned thumbnail creation and COIN_GLXGLUE_NO_PBUFFERS and COIN_GLXGLUE_NO_GLX13_PBUFFERS environment variables i would tried them too!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: FreeCAD document icon

Post by triplus »

I decided to write tutorial for Ubuntu 11.10 so everything in this topic would be in one place. Future FreeCAD and Ubuntu versions could change and this tutorial could not work or be relevant anymore it was tested only on Ubuntu 11.10 and current FreeCAD versions from PPA.

After installing FreeCAD from PPA create one .fcstd file. You will notice .fcstd file does not have any special icon associated with it and if you click on .fcstd file it will launch archive manager. To fix this do the following two things:

1.) FreeCAD Icon.

Download icon file created by normandc.

viewtopic.php?f=3&t=994#p7645

Right click on any .fcstd file -> Properties -> tab Basic -> Here you will see square box on top left corner. Click on it and choose the file you have downloaded.

2.) Open .fcstd file in FreeCAD and not in archive manager.

Right click on any .fcstd file -> Properties -> tab Open With -> Select FreeCAD.

If u want thumbnails to be created, here is what you have to do:

1.)

Open the terminal and copy/paste command into it:

gksudo gedit /usr/share/thumbnailers/freecad.thumbnailer

Put the following in the file and save the file:

Code: Select all

[Thumbnailer Entry]
TryExec=freecad-thumbnailer
Exec=freecad-thumbnailer -s %s %u %o
MimeType=application/x-extension-fcstd;
2.)

Open FreeCAD and enable thumbnail functionality:

Edit -> Preferences ... -> Document -> Save thumbnail into project file when saving document

Now create one NEW .fcstd file and rename it from name.fcstd to name.zip and open it with archive manager. In folder thumbnails check if thumbnail was created or not. If Thumbnail was created go to STEP 4. If it was not created probably your graphic driver does not have support for pbuffers and include STEP 3.

3.)

Close any opened instance of FreeCAD! Open the terminal and copy/paste command into it:

gksudo gedit /usr/share/applications/freecad.desktop

Find line:

Code: Select all

Exec=/usr/bin/freecad %F
And change it to:

Code: Select all

Exec=env COIN_GLXGLUE_NO_PBUFFERS=1 env COIN_GLXGLUE_NO_GLX13_PBUFFERS=1 /usr/bin/freecad %F
Save the changes and go to STEP 4.

4.)

Open the terminal and copy/paste command into it:

cd
nautilus .thumbnails/fail/gnome-thumbnail-factory/


Delete the content of this folder.

Now you should have:

-FreeCAD will open .fcstd file by default.
-Icon for .fcstd files.
-Thumbnails should work fine.
pperisin
Posts: 695
Joined: Wed Oct 20, 2010 12:29 pm

Re: FreeCAD document icon

Post by pperisin »

all of this for ubuntu - can it be executed on install? Is it possible to get thumbnails out-of-the-box?

Regards
petar

p.s. how about windows thumbnails? any chances?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: FreeCAD document icon

Post by jmaustpc »

Hi
In point 2, you do not have to change the file extension to .zip, just open the original FCstd file from within an archive manager program, or at least in KDE just right click on the original file and then either

1) click on "open with....." and select archive programme (Ark in KDE)

or

2) just select "Extract Archive to ...." from the context menu (right click menu).



Do you know what the equivalent for 4 is but for KDE? If not, if I work it out I'll post the answer here.

Jim

PS would this be a good point to suggest Gnome users type this code instead? "apt-get install KDE" :lol:
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

pperisin wrote:all of this for ubuntu - can it be executed on install? Is it possible to get thumbnails out-of-the-box?

Regards
petar

p.s. how about windows thumbnails? any chances?
Yes, for the PPA packages this should all be done automatically. At least it works for Ubuntu 10.04.

@triplus can you please add this article to our wiki because in the forum it disappears very soon in the hyperspace? I assigned already editing rights to you.
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD document icon

Post by wmayer »

p.s. how about windows thumbnails? any chances?
On Windows this works too. It's just to implement a so called shell-extension which is a COM DLL and must be registered to the system. It is even possible to add this into the MSI installer but the problem is that this DLL must be completely different dependent on what the target OS is. So, the code to make it working on Windows XP is completely different to that code of Windows Vista and Windows 7.
The code for Windows XP is here: http://free-cad.svn.sourceforge.net/vie ... ls/thumbs/ and for later Windows versions you'll find it here: http://free-cad.svn.sourceforge.net/vie ... lProvider/

The DLL then must be registered with:
regsvr32 <DLL_NAME>
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: FreeCAD document icon

Post by triplus »

Hi
In point 2, you do not have to change the file extension to .zip, just open the original FCstd file from within an archive manager program, or at least in KDE just right click on the original file and then either

1) click on "open with....." and select archive programme (Ark in KDE)

or

2) just select "Extract Archive to ...." from the context menu (right click menu).
In Ubuntu 11.10 File Roller complains about Archive type not supported if i don't change the extension.
Do you know what the equivalent for 4 is but for KDE? If not, if I work it out I'll post the answer here.
Maybe in KDE this step is not needed? If icon files and thumbnails for files that were created before you followed this tutorial are shown correctly then it is not needed!
Yes, for the PPA packages this should all be done automatically. At least it works for Ubuntu 10.04.
Probably something has changed in Gnome 3.
@triplus can you please add this article to our wiki because in the forum it disappears very soon in the hyperspace? I assigned already editing rights to you.
I tried to do this but i just never edited wiki pages before and i just am not skilled enough. Probably you meant under tutorials section but how do i create new page under tutorials?

But i must say i did find this topic easily when i searched the forum with the term thumbnail.
User avatar
yorik
Founder
Posts: 13642
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD document icon

Post by yorik »

I just made a tumbler plugin (used by thunar and marlin) that displays freecad icon in these 2 file managers...
Image
Rest of the story here: http://yorik.uncreated.net/guestblog.php?2012=37
The xfce people look interested in including it in tumbler sources, otherwise we can bundle it with freecad...
User avatar
yorik
Founder
Posts: 13642
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD document icon

Post by yorik »

And now, the KDE plugin too!

Image

Get it here: http://github.com/yorikvanhavre
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD document icon

Post by NormandC »

Well,

The freecad icon and thumbnails are still not working in Ubuntu 12.04. For the latter, I tried to do the same thing I did for Ubuntu 11.10, which was creating the file /usr/share/thumbnailers/freecad.thumbnailer.

After a reboot, I got a report from Apport (bug report app) saying that FreeCAD crashed:

Image

I could not find a way to extract the content of the crash report, so I had to type the relevant info. :roll:

Code: Select all

ExecutablePath
  /usr/bin/freecad-thumbnailer

Package
  freecad 0.13-git201206021107~precise1 [origin: LP-PPA-freecad-maintainers-freecad-daily]

ProblemType
  Crash

Title
  freecad-thumbnailer crashed with ImportError in __main__: No module named gnomevfs

Traceback
  Traceback (most recent call last):
  File "/usr/bin/freecad-thumbnailer", line 5, in <module>
   import gnomevfs
  ImportError: No module named gnomevfs

ApportVersion
  2.0.1-0ubuntu8

Architecture
  amd64

CrashCounter
  1

Date
  Sun Jun 3 18:49:10 2012

ProcCmdline
  /usr/bin/python /usr/bin/freecad-thumbnailer -s 128 file:///home/username/Bureau/washer.fcstd /tmp/.gnome_desktop_thumbnail.V2R2EW
The problem is with gnomevfs. I found out from a short search that gnomevfs was deprecated a long time ago with gnome 2.22 and replaced with GVFS.

https://en.wikipedia.org/wiki/GnomeVFS

I'm guessing that until now there were still bits and traces of gnome2 in Ubuntu 11.10, and that there was a more complete clean up in 12.04. Or maybe the gnome project simply pulled the plug on gnomevfs in GNOME 3.2.

I'm afraid that I cannot go further than that. Should I open a bug report on Mantis?
Post Reply