Specific selected object won't export to STL while others will 10-year Blender user here (currently 2.79b, Win 10), facing a strange problem. I'm trying to export a selected object to STL, a routine action for me. I've boiled the problem down to a simple file containing one tetrahedron. When I select this tetrahedron and do Export --> STL with Export Selected checked, the resulting STL file is empty and will not open in another viewer (NetFabb).

Simple tetrahedron file here. (Google Drive, export-broken.blend, 622 kB)

Here are some cases that should help narrow down the behavior.

If I copy (shift-D) the tetrahedron, the copy also fails to export when selected. If I move the original tetrahedron to another layer, it properly exports to STL. If I make a copy, move the copy to another layer, and select both for export, the resulting STL contains only the copied+moved tetrahedron.




Exporting all (not just selected) works normally, even with just the original problematic tetrahedron.

Additional background: of course, I'm not trying to export tetrahedrons; I encountered this bug in the context of a much more complex file. I am preparing objects for 3D printing -- again, routine for me -- and exporting all is not an option. Anecdotally, it appears that this is not limited to STL export but also affects export to other formats. Moving an object to another layer in my more-complex file does not fix the export problem. The onset of the issue was not accompanied by any major change or issue I was aware of.

SOLVED (see answer below). The reason the object that is moved becomes exportable is that it was moved to a layer that happened to be set as visible in the second, minimized viewport.
I've figured out the issue. My file -- and example file -- has two 3D-view panels open. Each of these permits layers to be selected as visible or not in the usual way. The main viewport has layers visible for my object (the example tetrahedron). However, a second split window, also set to 3D View, has only other layers selected to be visible -- the layer containing the tetrahedron is NOT set to visible in this other, minimized window.

It turns out that setting the tetrahedron's layer to visible in this second window suffices to make the object export properly. So it appears that the Export code is reading the layer visibility from one viewport (the most-recently-created one?), even if this is not the main viewport.

Here is a clearer example of a situation in which the selected object will not export. Note that the lower window (now not minimized) has a layer not containing the target object selected for visibility.



A hint about this came from an answer to another question (STL empty on export (Python API), answer by Azukikuru) which refers to visibility. Visibility turned out to be the key here.