diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
commit | cf43e48fc781611c0850e09dae6f6fa1c95cc28b (patch) | |
tree | d6a786c92891eae9482da7b80724b15ca2fa831c /source/blender/collada/LightExporter.cpp | |
parent | aa1668c6f8a70e41b97b67f31647dbec382e19f7 (diff) |
Apply patch 4636051. COLLADA: Export selection.
Original patch by Jan Diederich, adapted by Pelle Johnsen. Review assistance by Daniel Tavares.
This patch adds an option to export only the selection.
Diffstat (limited to 'source/blender/collada/LightExporter.cpp')
-rw-r--r-- | source/blender/collada/LightExporter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp index 13eb62ca969..c2cc0c1e157 100644 --- a/source/blender/collada/LightExporter.cpp +++ b/source/blender/collada/LightExporter.cpp @@ -38,13 +38,14 @@ #include "collada_internal.h" template<class Functor> -void forEachLampObjectInScene(Scene *sce, Functor &f) +void forEachLampObjectInScene(Scene *sce, Functor &f, bool export_selected) { Base *base= (Base*) sce->base.first; while(base) { Object *ob = base->object; - if (ob->type == OB_LAMP && ob->data) { + if (ob->type == OB_LAMP && ob->data + && !(export_selected && !(ob->flag & SELECT))) { f(ob); } base= base->next; @@ -53,11 +54,11 @@ void forEachLampObjectInScene(Scene *sce, Functor &f) LightsExporter::LightsExporter(COLLADASW::StreamWriter *sw): COLLADASW::LibraryLights(sw){} -void LightsExporter::exportLights(Scene *sce) +void LightsExporter::exportLights(Scene *sce, bool export_selected) { openLibrary(); - forEachLampObjectInScene(sce, *this); + forEachLampObjectInScene(sce, *this, export_selected); closeLibrary(); } |