Commit: a47937454c995c54edce8a11c65ae24272198eaa
Author: Gaia Clary
Date:   Tue Jun 14 13:08:42 2016 +0200
Branches: master
https://developer.blender.org/rBa47937454c995c54edce8a11c65ae24272198eaa

fix T48602: Changed The Collada validator to treat faces with < 3 verts as 
Warning and let the Mesh Validator take care of the cleanup

===================================================================

M       source/blender/collada/MeshImporter.cpp

===================================================================

diff --git a/source/blender/collada/MeshImporter.cpp 
b/source/blender/collada/MeshImporter.cpp
index 3addddd..6085b66 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -271,38 +271,41 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)  
// checks if mesh has su
        COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives();
 
        const std::string &name = bc_get_dae_name(mesh);
-       int hole_count = 0;
 
        for (unsigned i = 0; i < prim_arr.getCount(); i++) {
-               
+
                COLLADAFW::MeshPrimitive *mp = prim_arr[i];
                COLLADAFW::MeshPrimitive::PrimitiveType type = 
mp->getPrimitiveType();
 
                const char *type_str = bc_primTypeToStr(type);
-               
+
                // OpenCollada passes POLYGONS type for <polylist>
                if (type == COLLADAFW::MeshPrimitive::POLYLIST || type == 
COLLADAFW::MeshPrimitive::POLYGONS) {
 
                        COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
                        COLLADAFW::Polygons::VertexCountArray& vca = 
mpvc->getGroupedVerticesVertexCountArray();
-                       
+
+                       int hole_count = 0;
+                       int nonface_count = 0;
+
                        for (unsigned int j = 0; j < vca.getCount(); j++) {
                                int count = vca[j];
                                if (abs(count) < 3) {
-                                       fprintf(stderr, "ERROR: Primitive %s in 
%s has at least one face with vertex count < 3\n",
-                                               type_str, name.c_str());
-                                       return false;
+                                       nonface_count++;
                                }
-                               if (count < 0)
-                               {
+
+                               if (count < 0) {
                                        hole_count ++;
                                }
                        }
 
-                       if (hole_count > 0)
-                       {
+                       if (hole_count > 0) {
                                fprintf(stderr, "WARNING: Primitive %s in %s: 
%d holes not imported (unsupported)\n", type_str, name.c_str(), hole_count);
                        }
+
+                       if (nonface_count > 0) {
+                               fprintf(stderr, "WARNING: Primitive %s in %s: 
%d faces with vertex count < 3 (rejected)\n", type_str, name.c_str(), 
nonface_count);
+                       }
                }
 
                else if (type == COLLADAFW::MeshPrimitive::LINES) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to