From b82c104fddd692f82baeb370a3b8e6d058fe3d2b Mon Sep 17 00:00:00 2001 From: rodri Date: Sat, 28 Sep 2024 11:53:19 +0000 Subject: marshal: don't die if textures can't be written. show a warning and move on. --- marshal.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'marshal.c') diff --git a/marshal.c b/marshal.c index 7bc23c6..924206d 100644 --- a/marshal.c +++ b/marshal.c @@ -789,7 +789,6 @@ Bprintprim(Biobuf *b, Wireprim *p) return n; } -/* TODO how do we deal with textures? embedded? keep a path? */ static int Bprintmtl(Biobuf *b, Material *m) { @@ -968,7 +967,7 @@ exportmodel(char *path, Model *m) sysfatal(Esmallbuf); if(exporttexture(buf, mtl->diffusemap) < 0) - return -1; + fprint(2, "warning: %r\n"); // if(mtl->diffusemap->file == nil) mtl->diffusemap->file = estrdup(strrchr(buf, '/')+1); @@ -979,7 +978,7 @@ exportmodel(char *path, Model *m) sysfatal(Esmallbuf); if(exporttexture(buf, mtl->specularmap) < 0) - return -1; + fprint(2, "warning: %r\n"); // if(mtl->specularmap->file == nil) mtl->specularmap->file = estrdup(strrchr(buf, '/')+1); @@ -990,7 +989,7 @@ exportmodel(char *path, Model *m) sysfatal(Esmallbuf); if(exporttexture(buf, mtl->normalmap) < 0) - return -1; + fprint(2, "warning: %r\n"); // if(mtl->normalmap->file == nil) mtl->normalmap->file = estrdup(strrchr(buf, '/')+1); -- cgit v1.2.3