diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/collada/MaterialExporter.cpp | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/collada/MaterialExporter.cpp')
-rw-r--r-- | source/blender/collada/MaterialExporter.cpp | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/source/blender/collada/MaterialExporter.cpp b/source/blender/collada/MaterialExporter.cpp index 0c2a7a09b21..e071712b20d 100644 --- a/source/blender/collada/MaterialExporter.cpp +++ b/source/blender/collada/MaterialExporter.cpp @@ -22,49 +22,53 @@ #include "COLLADABUUtils.h" #include "collada_internal.h" -MaterialsExporter::MaterialsExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings) : COLLADASW::LibraryMaterials(sw), export_settings(export_settings) +MaterialsExporter::MaterialsExporter(COLLADASW::StreamWriter *sw, + const ExportSettings *export_settings) + : COLLADASW::LibraryMaterials(sw), export_settings(export_settings) { - /* pass */ + /* pass */ } void MaterialsExporter::exportMaterials(Scene *sce) { - if (hasMaterials(sce)) { - openLibrary(); + if (hasMaterials(sce)) { + openLibrary(); - MaterialFunctor mf; - mf.forEachMaterialInExportSet<MaterialsExporter>(sce, *this, this->export_settings->export_set); + MaterialFunctor mf; + mf.forEachMaterialInExportSet<MaterialsExporter>( + sce, *this, this->export_settings->export_set); - closeLibrary(); - } + closeLibrary(); + } } bool MaterialsExporter::hasMaterials(Scene *sce) { - 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); + 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); - // no material, but check all of the slots - if (!ma) continue; + // no material, but check all of the slots + if (!ma) + continue; - return true; - } - } - return false; + return true; + } + } + return false; } void MaterialsExporter::operator()(Material *ma, Object *ob) { - std::string mat_name = encode_xml(id_name(ma)); - std::string mat_id = get_material_id(ma); - std::string eff_id = get_effect_id(ma); + std::string mat_name = encode_xml(id_name(ma)); + std::string mat_id = get_material_id(ma); + std::string eff_id = get_effect_id(ma); - openMaterial(mat_id, mat_name); - addInstanceEffect(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, eff_id)); + openMaterial(mat_id, mat_name); + addInstanceEffect(COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, eff_id)); - closeMaterial(); + closeMaterial(); } |