Freecad Mesh WB - Export issues

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!
leoheck
Veteran
Posts: 1222
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Freecad Mesh WB - Export issues

Post by leoheck »

Is it possible to have the extension .stl added to the file name when exporting meshes?

This never came with the file name.
I always have to put it. Why? because other dumb software does not like it if it does not have it.
It is just a 4-characters string.

It would be awesome if Freecad could append this automatically, seriously.

Also, I cannot change it this time because when I click on the Input field, Freecad bugs to the death and does not export anything.
Screenshot-20211125213938-748x172.png
Screenshot-20211125213938-748x172.png (27.63 KiB) Viewed 1765 times

OS: Ubuntu 21.10 (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 8fceac17628778bd0b2ba4c60bafd6494348ac08
Python version: 3.9.5
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Freecad Mesh WB - Export issues

Post by chrisb »

It adds the extension on macOS, so this may be system deoendent, and out of the reach of FreeCAD?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Freecad Mesh WB - Export issues

Post by chennes »

It is supposed to add the extension, there is something going wrong there. I messed around with that code last year, but haven’t changed it since. I will give it a go on my 21.10 system, it’s working fine on Windows.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Freecad Mesh WB - Export issues

Post by chennes »

Actually, are you certain it's not adding the extension when you save the file? I just tested on Ubuntu 21.10 and while the extension doesn't show in the field, if there is no extension it's appending the correct one on export:

Code: Select all

 Mesh.export(__objs__,u"/home/chennes/Desktop/Unnamed-Cube (Meshed).stl")
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Freecad Mesh WB - Export issues

Post by wmayer »

That's a problem with your native file dialog. AFAIR it also depends on which DE you use. While under KDE things work as expected it doesn't do so under Gnome. Many years ago it also worked there until the devs decided to hide file extensions from the user and I guess that was the time where an extension wasn't added any more to the file name.

I strongly recommend you to switch to the Qt file dialog. Therefore open the parameter editor and go to Preferences > Dialog and create the key DontUseNativeDialog setting its value to true. That probably fixes the issue you reported in the other thread, too.
leoheck
Veteran
Posts: 1222
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Freecad Mesh WB - Export issues

Post by leoheck »

chennes wrote: Fri Nov 26, 2021 1:27 am Actually, are you certain it's not adding the extension when you save the file? I just tested on Ubuntu 21.10 and while the extension doesn't show in the field, if there is no extension it's appending the correct one on export:

Code: Select all

 Mesh.export(__objs__,u"/home/chennes/Desktop/Unnamed-Cube (Meshed).stl")
Yes, I am sure. It does not show in the file dialog. And it does not add when saved if I don't add it. And I always have trouble opening it on Cura right after, since its dialog ignores files that it is not expecting including the ones with missing extensions.
chennes wrote: Fri Nov 26, 2021 1:20 am It is supposed to add the extension, there is something going wrong there. I messed around with that code last year, but haven’t changed it since. I
It is behaving like this since a long time ago. Maybe there is an issue here. Do you have any other requests for me to give you a better view of what is going on? Because the way it is the export mesh is not good at all.

Also, on File > Export I cannot see any extensions. There is a clear issue with this dialog. You can see this in the following image. It feels like it delegates to the user to guess the extension that is going to be used like what Gimp does. Gimp, allows users to select the type of file being by reading the extension user has set. But if he changes the format using any option in the Format menu, it changes the extension accordingly.
Screenshot-20211128014214-671x1004.png
Screenshot-20211128014214-671x1004.png (76.21 KiB) Viewed 1548 times
Here, in the menu shown above, I expect something like this in the list. You can see the extensions written there to make it easier for the user to select something known.

Code: Select all

Addictive Manufacturing Format (.amf)
FreeCAD File (.FCStsd)
Step File (.stp)
Mesh File (.stl)
But the problem here is that, even if you click one format to export, it does not change the file name. You can see this here:
Screenshot-20211128014354-941x629.png
Screenshot-20211128014354-941x629.png (47.12 KiB) Viewed 1548 times
wmayer wrote: Fri Nov 26, 2021 9:53 am That's a problem with your native file dialog.
Yeah, agree. I use GNOME, and I always used it.
wmayer wrote: Fri Nov 26, 2021 9:53 am devs decided to hide file extensions from the user
Oh, this is soooo bad! This is the worst improvement ever.
wmayer wrote: Fri Nov 26, 2021 9:53 am I strongly recommend you to switch to the Qt file dialog.
Thanks for the suggestion, I did not know that this was possible.

This week something has changed that removed all the toolbars. I hate when this happens. Sometimes, all of the sudden, the whole interface gets messed up. I have no idea what happens and why. Then it may have caused this issue.

The big thing is that I haven't changed my settings this month. I never change anything on preferences since I prefer to use it "as it is" otherwise I have to change every computer that I have to use.
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Freecad Mesh WB - Export issues

Post by wmayer »

Gimp, allows users to select the type of file being by reading the extension user has set. But if he changes the format using any option in the Format menu, it changes the extension accordingly.
It seems Gimp uses its own file dialog. When I compare it with the native dialog then it looks completely different and furthermore shows many extra options. With our Qt-based file dialog we are also able to automatically add or replace the file extension when you select another format from the drop-down list.
Oh, this is soooo bad! This is the worst improvement ever.
In the past it was possible to add one entry to the file dialog e.g. Mesh formats followed by all file formats it supports, i.e. stl, ply, off, obj,...
Because of the behaviour not to show the extensions any more we had to add each format as an own entry to give the user a chance to see what formats are supported. And this make the drop-down list extremely long so that you have to scroll like crazy to find the requested format.
Thanks for the suggestion, I did not know that this was possible.
Have you tried it and does it solve your problems?
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: Freecad Mesh WB - Export issues

Post by drmacro »

I have noticed the "resulting output file has no extension" seems to be inconsistent. (I.e. File>Export behaves differently than export dxf in TechDraw, etc.)

There is a parameter that defines whether FC uses native file dialog or not. My experiments have shown it changes the inconsistency.

In many cases, in the dialog, you can select the desired output from the combo box, but if you don't type the extension in the filename text box, no extension is used, even though the correct format is. (i.e. select dxf, but the file name entered is myfile, the file name on disk is myfile not myfile.dxf.) It was most notable when the selected type had multiple extensions listed, which is reasonable, since FC has a multiple choice question.

In detailed this here on the forum back before 0.20 began.

I have not experimented with it for a while.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
leoheck
Veteran
Posts: 1222
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Freecad Mesh WB - Export issues

Post by leoheck »

The QT-based was working fine for a long time, but the issue I see is that something has changed it, all of the sudden. I did not do this change myself. My philosophy is to adapt-me around the software because I use any computer available. So I prefer to use the software as it is. Otherwise, I will have to configure it everywhere.

Alright, the QT-based exporter is working better.

1. Using the Mesh WB > Mesh Export" It adds the extension automatically to the saved file but it does not add it to the "File name field"

2. Also, using the shortcut Ctrl+E, to use the global exporter so to speak. The extension is being appended in the "File name" field, automatically, which is good. But if I remove it there, it adds it in the file saved.

The second time is working better. But both ways are not working correctly as I expect:

1. The "File Type" selector should append the extension inf the "File Name" field (ONLY)
2. If the user changes the "File Name" it has to be used "as it is". If the user removes or changes the extension manually. It has to be used as the user wants. What we see in this field is what we get.
3. If the user changes the File Type again, it should add the extension related.
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Freecad Mesh WB - Export issues

Post by wmayer »

2. If the user changes the "File Name" it has to be used "as it is". If the user removes or changes the extension manually. It has to be used as the user wants. What we see in this field is what we get.
And what should this be good for? Most of the export functions of the various modules decide by the file extension in what format to write the content. If no file extension is given they will fail to write anything.
Post Reply