Collada: fixed a few loops to only loop over the list of exported objects, instead...
authorGaia Clary <gaia.clary@machinimatrix.org>
Tue, 12 Jun 2012 23:19:34 +0000 (23:19 +0000)
committerGaia Clary <gaia.clary@machinimatrix.org>
Tue, 12 Jun 2012 23:19:34 +0000 (23:19 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/MaterialExporter.cpp

index cb675618ea54cf1a4feb392a5e4d38a6f36ed66e..9582da4fe5c96a584ce48b909981149d85522265 100644 (file)
@@ -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;
 }
index 105b895cf370af93b523c6e81fadb98907fceab5..c777a7d1fabe32128822fd8cd7979502f42a56cb 100644 (file)
@@ -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;
 }
index 106861c1916b5a2521b230138f194583608363b6..ef22a76d28e939e141f468c2bfcb8d2746a2331f 100644 (file)
@@ -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;
 }