diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-09-12 22:26:01 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-09-12 22:26:01 +0400 |
commit | 0a0074f9c65255dfa7b5bca67abe149b7d74e797 (patch) | |
tree | 434066cabca0f06b8a2f06ead6a65055f92a14ac | |
parent | 272700728f411fa8099883e4866dc65d837d23ce (diff) |
Collada: do not call polylist export for objects with no polygons (avoid a missleading warning message)
-rw-r--r-- | source/blender/collada/DocumentExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/GeometryExporter.cpp | 19 |
2 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp index baaa6dbeed2..7683ec1e9cd 100644 --- a/source/blender/collada/DocumentExporter.cpp +++ b/source/blender/collada/DocumentExporter.cpp @@ -163,6 +163,8 @@ void DocumentExporter::exportCurrentScene(Scene *sce) COLLADABU::NativeString(std::string(this->export_settings->filepath)); COLLADASW::StreamWriter sw(native_filename); + fprintf(stdout, "Collada export: %s\n", this->export_settings->filepath); + // open <collada> sw.startDocument(); diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index c7ad2ff3975..27700444ba9 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -132,14 +132,17 @@ void GeometryExporter::operator()(Object *ob) createLooseEdgeList(ob, me, geom_id, norind); - // XXX slow - if (ob->totcol) { - for (int a = 0; a < ob->totcol; a++) { - createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind); + // Only create Polylists if number of faces > 0 + if (me->totface > 0) { + // XXX slow + if (ob->totcol) { + for (int a = 0; a < ob->totcol; a++) { + createPolylist(a, has_uvs, has_color, ob, me, geom_id, norind); + } + } + else { + createPolylist(0, has_uvs, has_color, ob, me, geom_id, norind); } - } - else { - createPolylist(0, has_uvs, has_color, ob, me, geom_id, norind); } closeMesh(); @@ -248,7 +251,7 @@ void GeometryExporter::createPolylist(short material_index, // no faces using this material if (faces_in_polylist == 0) { - fprintf(stderr, "%s: no faces use material %d\n", id_name(ob).c_str(), material_index); + fprintf(stderr, "%s: material with index %d is not used.\n", id_name(ob).c_str(), material_index); return; } |