Index: trunk/src_plugins/export_stl/model_load_amf.c =================================================================== --- trunk/src_plugins/export_stl/model_load_amf.c (nonexistent) +++ trunk/src_plugins/export_stl/model_load_amf.c (revision 35962) @@ -0,0 +1,39 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2020 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#include + +#ifdef PCB_HAVE_LIBXML2 +stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f) +{ + return NULL; +} +#else +stl_facet_t *amf_solid_fload(rnd_hidlib_t *hl, FILE *f) +{ + return &stl_format_not_supported; +} +#endif Index: trunk/src_plugins/export_stl/stl_models.c =================================================================== --- trunk/src_plugins/export_stl/stl_models.c (revision 35961) +++ trunk/src_plugins/export_stl/stl_models.c (revision 35962) @@ -175,7 +175,10 @@ memcpy(dst, tmp, sizeof(tmp)); } +static stl_facet_t stl_format_not_supported; + #include "model_load_stl.c" +#include "model_load_amf.c" static void stl_model_place(rnd_hidlib_t *hl, FILE *outf, htsp_t *models, const char *name, rnd_coord_t ox, rnd_coord_t oy, double rotdeg, int on_bottom, const char *user_xlate, const char *user_rot, double maxy, rnd_coord_t z0, rnd_coord_t z1) { @@ -189,6 +192,8 @@ head = stl_solid_fload(hl, f); if (head == NULL) rnd_message(RND_MSG_ERROR, "STL model failed to load: %s\n", full_path); + else if (head == &stl_format_not_supported) + head = NULL; } else rnd_message(RND_MSG_ERROR, "STL model not found: %s\n", name);