Export only selected objects & export as .blend

Export Selected
This is a small addon that adds an option to export only selected objects for every registered exporter. It also gives you an option to export the objects to a separate .blend file.
By default children of the selected objects are exported too (the “Include Children” option).
Besides the selected, you can also choose to export visible or all objects in the scene, and/or to limit export only to certain types of objects.
For PLY format, all the selected objects would be exported as a single mesh.

Wiki: http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Export_Selected
Download link: https://raw.github.com/dairin0d/export-selected/master/io_export_selected.py

When installed, it will add a submenu “Selected” to the Export menu, where the available formats would be listed.

moth3r made me do it, and rking helped to generalize and publish it. Thanks go to them :stuck_out_tongue:

3 Likes

It’s good ! Since I expect this feature. A little suggestion, it’s possible to add after “save as” a “save selected” for the .blend format ??

Pictures to illustrated.


No, I don’t believe it’s possible. Menu items can be either appended or prepended, but not inserted somewhere in the middle. Anyway, I think it’s more logical to think of it as an “exporting” rather that “saving” function.

Great thanks for this option add-on!
I love too:
“By default children of the selected objects are exported”
because I make a big details object and this option save me a lot of time to export.
Congratulations from France:eyebrowlift:
Spirou4D

Really thank you! I was waiting for this option from a long time! (some months) It works good for me. 2.62

I am glad you all like it! Dairin0d was kind enough to implement it and rking gave some really good suggestions along the way. Personally, I would want to see this as default feature because I have best intentions to use it for quick hack Assets system. A better and much more advanced is on the way but I suppose that would also work until Elubie is done. If you are interested there is a description under Quick hacks. I welcome any feedback as I don’t expect developers to spend their time on the only one person to use it.

In my opinion - trunk feature. I was begging for it for some time, thank you!

An update: I’ve added an option to export visible / all objects, and an option to limit export only to the specified types of objects.

When you do save selected to .blend format
it would be nice to have an option to save the textures or not…
(and way to clean the .blend file and also remove junk unused stuff)

(X) Save selected with materials & Textures
(X) Save with World Texture(HDRI) (this one makes blend files large so it would usually be unchecked
(X) Remove Orphans

etc…

Thanks for the ideas :slight_smile: It would be also nice if you listed the other options you summed up as “etc.” – I don’t really use this addon myself, so I don’t know what frequent use-cases might arise. Sadly, I’m not sure when I’ll get to add these options to the script.

BTW, what did you mean by “Remove Orphans”? Remove orphaned vertices/edges?

Hi dairin0d,

Thanks for this addon, I was looking for such a useful function since a long time.

However, I did several tests and there are some strange behaviors.
I selected one single object but some extra objects (not selected and without any relation with the selected one) are saved with it, I unchecked the save children option and limited to mesh types but have the same issue. The additional objects come from a link library.
Also, the resulting file is huge compared to the simple object I saved, the file size is more or less the same as the file from which I’m exporting … If I open the file and save it, the size decrease, duno if this has to do with orphans …

I’m using the 2.62 32 bits version

Hi, enricoceric,

It seems I can’t easily reproduce the “linked objects exported too” behavior. Could you explain how to get this result from scratch, or maybe send me the files you’re working on?

Yes, currently orphans aren’t removed… I’ll try to add that function.

useful! thank you!

I’ve added an option to remove orphans (enabled by default), you can check it out.

Added options to keep/remove materials, textures and world textures.

I get this attribute error in 2.77 last nightly build:


Traceback (most recent call last):
  File "C:\Users\___\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\io_export_selected.py", line 459, in execute
    self.clear_world(context)
  File "C:\Users\___\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\io_export_selected.py", line 447, in clear_world
    datablocks = getattr(bpy.data, datablocks_name)
AttributeError: 'BlendData' object has no attribute 'scripts'

location: <unknown location>:-1

It seems you have an old version of the script. Please download the latest version :wink:

Thanks dairin0d!
It works perfect again.

When exporting in blend format, in addition to the selected objects it seems that it also export all the libraries referenced in the blender file. I can’t find any option to avoid that.

Excellent! Thank you!