Index: export_stl.c =================================================================== --- export_stl.c (revision 35985) +++ export_stl.c (revision 35986) @@ -354,10 +354,14 @@ #include "exp_fmt_stl.c" #include "exp_fmt_amf.c" + +static const stl_fmt_t *fmt_all[] = {&fmt_amf, &fmt_stl, NULL}; + #include "stl_models.c" #include "model_load_stl.c" #include "model_load_amf.c" + static const rnd_export_opt_t *stl_get_export_options(rnd_hid_t *hid, int *n) { return stl_get_export_options_(hid, n, &fmt_stl); Index: stl_models.c =================================================================== --- stl_models.c (revision 35985) +++ stl_models.c (revision 35986) @@ -242,7 +242,23 @@ htsp_init(&models, strhash, strkeyeq); PCB_SUBC_LOOP(PCB->Data); { - stl_model_print(pcb, outf, maxy, z0, z1, &models, subc, &first, fmt, fmt); + int good = 0; + + if (stl_model_print(pcb, outf, maxy, z0, z1, &models, subc, &first, fmt, fmt) != 0) { + const stl_fmt_t **n; /* fallback: try all other formats */ + for(n = fmt_all; *n != NULL; n++) { + if (*n == fmt) continue; /* already tried */ + if (stl_model_print(pcb, outf, maxy, z0, z1, &models, subc, &first, *n, fmt) == 0) { + good = 1; + break; + } + } + } + else + good = 1; + + if (!good) + pcb_io_incompat_save(pcb->Data, (pcb_any_obj_t *)subc, "subc-place", "Missing 3d model", "Could not load 3d surface model - component missing from the output"); } PCB_END_LOOP; for (e = htsp_first(&models); e; e = htsp_next(&models, e)) {