From b0038ae4996993f1dd808babe402e2e390933330 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Tue, 12 Jun 2012 23:19:34 +0000 Subject: Collada: fixed a few loops to only loop over the list of exported objects, instead of the current scene. --- source/blender/collada/AnimationExporter.cpp | 8 +++----- source/blender/collada/ImageExporter.cpp | 8 +++----- source/blender/collada/MaterialExporter.cpp | 9 +++------ 3 files changed, 9 insertions(+), 16 deletions(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index cb675618ea5..9582da4fe5c 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -1110,13 +1110,12 @@ void AnimationExporter::enable_fcurves(bAction *act, char *bone_name) } } -/* TODO - only check NodeLink objects that are exported */ bool AnimationExporter::hasAnimations(Scene *sce) { - Base *base = (Base *) sce->base.first; + LinkNode *node; - while (base) { - Object *ob = base->object; + for(node=this->export_settings->export_set; node; node=node->next) { + Object *ob = (Object *)node->link; FCurve *fcu = 0; //Check for object transform animations @@ -1140,7 +1139,6 @@ bool AnimationExporter::hasAnimations(Scene *sce) if (fcu) return true; - base = base->next; } return false; } diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index 105b895cf37..c777a7d1fab 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -45,13 +45,12 @@ ImagesExporter::ImagesExporter(COLLADASW::StreamWriter *sw, const ExportSettings { } -/* TODO - shouldn't this use the objects LinkNode's ? */ bool ImagesExporter::hasImages(Scene *sce) { - Base *base = (Base *)sce->base.first; + LinkNode *node; - while (base) { - Object *ob = base->object; + for (node=this->export_settings->export_set; node; node=node->next) { + Object *ob = (Object *)node->link; int a; for (a = 0; a < ob->totcol; a++) { Material *ma = give_current_material(ob, a + 1); @@ -65,7 +64,6 @@ bool ImagesExporter::hasImages(Scene *sce) } } - base = base->next; } return false; } diff --git a/source/blender/collada/MaterialExporter.cpp b/source/blender/collada/MaterialExporter.cpp index 106861c1916..ef22a76d28e 100644 --- a/source/blender/collada/MaterialExporter.cpp +++ b/source/blender/collada/MaterialExporter.cpp @@ -46,13 +46,11 @@ void MaterialsExporter::exportMaterials(Scene *sce) } } -/* TODO - shouldn't this use the scenes object LinkNode's ? */ bool MaterialsExporter::hasMaterials(Scene *sce) { - Base *base = (Base *)sce->base.first; - - while (base) { - Object *ob = base->object; + LinkNode *node; + for(node=this->export_settings->export_set; node; node = node->next) { + Object *ob = (Object *)node->link; int a; for (a = 0; a < ob->totcol; a++) { Material *ma = give_current_material(ob, a + 1); @@ -62,7 +60,6 @@ bool MaterialsExporter::hasMaterials(Scene *sce) return true; } - base = base->next; } return false; } -- cgit v1.2.3