goat3d
diff src/goat3d_writexml.cc @ 17:1d85d7dd0038
goatprim done
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 27 Sep 2013 02:29:52 +0300 |
parents | f1b4c27382ce |
children | bdfc8dd14965 |
line diff
1.1 --- a/src/goat3d_writexml.cc Thu Sep 26 14:16:09 2013 +0300 1.2 +++ b/src/goat3d_writexml.cc Fri Sep 27 02:29:52 2013 +0300 1.3 @@ -1,6 +1,6 @@ 1.4 #include <stdarg.h> 1.5 #include "goat3d_impl.h" 1.6 -#include "chunk.h" 1.7 +#include "log.h" 1.8 #include "openctm.h" 1.9 1.10 static bool write_material(const Scene *scn, goat3d_io *io, const Material *mat, int level); 1.11 @@ -76,7 +76,9 @@ 1.12 // then refer to that filename in the XML tags 1.13 xmlout(io, level, "<mesh>\n"); 1.14 xmlout(io, level + 1, "<name string=\"%s\"/>\n", mesh->name.c_str()); 1.15 - xmlout(io, level + 1, "<material string=\"%s\"/>\n", mesh->material->name.c_str()); 1.16 + if(mesh->material) { 1.17 + xmlout(io, level + 1, "<material string=\"%s\"/>\n", mesh->material->name.c_str()); 1.18 + } 1.19 xmlout(io, level + 1, "<file string=\"%s\"/>\n", mesh_filename); 1.20 xmlout(io, level, "</mesh>\n"); 1.21 return true; 1.22 @@ -145,6 +147,7 @@ 1.23 * probably in the comment field? 1.24 */ 1.25 1.26 + logmsg(LOG_INFO, "saving CTM mesh file: %s\n", fname); 1.27 ctmSave(ctm, fname); 1.28 1.29 ctmFreeContext(ctm);