Feature Request - Export Multiple mesh objects at once

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

Feature Request - Export Multiple mesh objects at once

Post by leoheck »

It would be nice to have this feature.

I can select a bunch of Objects to convert to mesh.
I would like to do the same by selecting more than one mesh object.
If the user selects more than one mesh the Export Mesh, could open a folder to dump all the objects into files. The file name could be something using the object name as it is today but removing this (Meshed) thing. It is horrible.
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Feature Request - Export Multiple mesh objects at once

Post by wmayer »

I would like to do the same by selecting more than one mesh object.
You can do that already. However, all meshes will be joined and written together to a single file. Depending on the selected file format the file may contain a single mesh or multiple meshes or a mesh with grouping information, respectively. The latter is supported by OBJ (aka Alias Mesh in the global export dialog).
leoheck
Veteran
Posts: 1222
Joined: Tue Mar 13, 2018 5:56 pm
Location: Coffee shop

Re: Feature Request - Export Multiple mesh objects at once

Post by leoheck »

wmayer wrote: Mon Nov 29, 2021 7:07 am
I would like to do the same by selecting more than one mesh object.
You can do that already.
Not with the "Mesh WB > Export Mesh". If I select multiple mesh objects, it keeps greyed out.
But I would love to see this change.
However, creating multiple files and not a single one.

Then I have another question.
How does the "Mesh WB > Export Mesh" is different than the "File > Export > STL Mesh"?
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: Feature Request - Export Multiple mesh objects at once

Post by drmacro »

FWIW, You are welcome to try this Python script which creates a mesh of the selected solid, then exports it, then deletes the mesh object.

It only does one at a time, but handles the mesh create and removes the, likely now unnecessary mesh.

It is of course best to make a copy of the file before using it since it is creating and deleting object. And I've done a limited amount of testing. The user who asked me to create this script has had no such issues...so caveat emptor. ;)
Attachments
MeshExport.py
(2.58 KiB) Downloaded 55 times
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: Feature Request - Export Multiple mesh objects at once

Post by leoheck »

Thanks, DrMacro.

It works nicely. Unfortunately, it does one at each time. But this is not hard to change, I guess.
Also, it is using the Body ID/Name or whatever it is called to make the filename. And not what the user has called it in the tree view which I believe is better (maybe it is the Label or something)

Ah. I could use your script to allow multiple meshes to be exported. I am also using the Label instead of the name too.

MeshExport-v0.1.FCMacro
(1.64 KiB) Downloaded 39 times

Thank you!! Now. How could we make such a thing land on Mesh Workbench so we don't need to have a macro for such a useful feature?
drmacro
Veteran
Posts: 8862
Joined: Sun Mar 02, 2014 4:35 pm

Re: Feature Request - Export Multiple mesh objects at once

Post by drmacro »

leoheck wrote: Tue Nov 30, 2021 3:30 pm Thanks, DrMacro.
...
You're welcome.
Thank you!! Now. How could we make such a thing land on Mesh Workbench so we don't need to have a macro for such a useful feature?
Simply go to Tools>Customize and add whatever you like to the Mesh workbench toolbar.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply