diff options
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index fe52a3fc198..0f1f8c6078a 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -3025,7 +3025,7 @@ void write_vrml(char *str) /* FIRST: write all the datablocks */ - fprintf(fp, "#VRML V1.0 ascii\n\n# Blender V2.0\n\n# 'Switch' is used as a hack, to ensure it is not part of the drawing\n\n"); + fprintf(fp, "#VRML V1.0 ascii\n\n# Blender V%d\n\n# 'Switch' is used as a hack, to ensure it is not part of the drawing\n\n", G.version); fprintf(fp, "Separator {\n"); fprintf(fp, "Switch {\n"); @@ -3037,9 +3037,16 @@ void write_vrml(char *str) ma= ma->id.next; } + /* only write meshes we're using in this scene */ + flag_listbase_ids(&G.main->mesh, LIB_DOIT, 0); + + for(base= G.scene->base.first; base; base= base->next) + if(base->object->type== OB_MESH) + ((ID *)base->object->data)->flag |= LIB_DOIT; + me= G.main->mesh.first; while(me) { - if(me->id.us) { + if(me->id.flag & LIB_DOIT) { /* is the mesh used in this scene ? */ write_mesh_vrml(fp, me); } me= me->id.next; @@ -3342,10 +3349,18 @@ void write_dxf(char *str) write_group(0, "SECTION"); write_group(2, "BLOCKS"); + + /* only write meshes we're using in this scene */ + flag_listbase_ids(&G.main->mesh, LIB_DOIT, 0); + + for(base= G.scene->base.first; base; base= base->next) + if(base->object->type== OB_MESH) + ((ID *)base->object->data)->flag |= LIB_DOIT; + /* Write all the meshes */ me= G.main->mesh.first; while(me) { - if(me->id.us) { + if(me->id.flag & LIB_DOIT) { /* is the mesh used in this scene ? */ write_mesh_dxf(fp, me); } me= me->id.next; |