Page 1 of 2

Freecad Mesh WB - Export issues

Posted: Fri Nov 26, 2021 12:43 am
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 1786 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)

Re: Freecad Mesh WB - Export issues

Posted: Fri Nov 26, 2021 1:07 am
by chrisb
It adds the extension on macOS, so this may be system deoendent, and out of the reach of FreeCAD?

Re: Freecad Mesh WB - Export issues

Posted: Fri Nov 26, 2021 1:20 am
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.

Re: Freecad Mesh WB - Export issues

Posted: Fri Nov 26, 2021 1:27 am
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")

Re: Freecad Mesh WB - Export issues

Posted: Fri Nov 26, 2021 9:53 am
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.

Re: Freecad Mesh WB - Export issues

Posted: Sun Nov 28, 2021 4:55 am
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 1569 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 1569 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.

Re: Freecad Mesh WB - Export issues

Posted: Sun Nov 28, 2021 9:30 am
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?

Re: Freecad Mesh WB - Export issues

Posted: Sun Nov 28, 2021 11:43 am
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.

Re: Freecad Mesh WB - Export issues

Posted: Mon Nov 29, 2021 3:32 am
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.

Re: Freecad Mesh WB - Export issues

Posted: Mon Nov 29, 2021 6:53 am
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.