diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-08-20 12:40:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-08-20 12:40:14 +0400 |
commit | 196a3e410458182105b0356d1f9c9230637b216f (patch) | |
tree | 5a2f6b35c02a4fc6df9ce0ae869c7070b9da5f9f /source/blender/blenkernel/intern | |
parent | bb10ba94491b593598545eb103becc05621d89fa (diff) |
VRML and DXF were saving all meshes that had at least one user - so all meshes in other scenes, and meshes without object users like textmesh.
used the flag LIB_DOIT to tag meshes used in the current scene and only write those.
Diffstat (limited to 'source/blender/blenkernel/intern')
-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; |