Revision: 48645
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48645
Author:   mont29
Date:     2012-07-05 13:02:42 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
Cosmetic updates to mesh validate messages.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/mesh_validate.c

Modified: trunk/blender/source/blender/blenkernel/intern/mesh_validate.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mesh_validate.c      
2012-07-05 12:50:50 UTC (rev 48644)
+++ trunk/blender/source/blender/blenkernel/intern/mesh_validate.c      
2012-07-05 13:02:42 UTC (rev 48645)
@@ -223,7 +223,7 @@
              __func__, totvert, totedge, totloop, totpoly);
 
        if (totedge == 0 && totpoly != 0) {
-               PRINT("    logical error, %u polygons and 0 edges\n", totpoly);
+               PRINT("\tLogical error, %u polygons and 0 edges\n", totpoly);
                do_edge_recalc = do_fixes;
        }
 
@@ -233,7 +233,7 @@
 
                for (j = 0; j < 3; j++) {
                        if (!finite(mv->co[j])) {
-                               PRINT("    vertex %u: has invalid 
coordinate\n", i);
+                               PRINT("\tVertex %u: has invalid coordinate\n", 
i);
 
                                if (do_fixes) {
                                        zero_v3(mv->co);
@@ -247,7 +247,7 @@
                }
 
                if (fix_normal) {
-                       PRINT("    vertex %u: has zero normal, assuming Z-up 
normal\n", i);
+                       PRINT("\tVertex %u: has zero normal, assuming Z-up 
normal\n", i);
                        if (do_fixes) {
                                mv->no[2] = SHRT_MAX;
                                verts_fixed = TRUE;
@@ -258,20 +258,20 @@
        for (i = 0, me = medges; i < totedge; i++, me++) {
                int remove = FALSE;
                if (me->v1 == me->v2) {
-                       PRINT("    edge %u: has matching verts, both %u\n", i, 
me->v1);
+                       PRINT("\tEdge %u: has matching verts, both %u\n", i, 
me->v1);
                        remove = do_fixes;
                }
                if (me->v1 >= totvert) {
-                       PRINT("    edge %u: v1 index out of range, %u\n", i, 
me->v1);
+                       PRINT("\tEdge %u: v1 index out of range, %u\n", i, 
me->v1);
                        remove = do_fixes;
                }
                if (me->v2 >= totvert) {
-                       PRINT("    edge %u: v2 index out of range, %u\n", i, 
me->v2);
+                       PRINT("\tEdge %u: v2 index out of range, %u\n", i, 
me->v2);
                        remove = do_fixes;
                }
 
                if (BLI_edgehash_haskey(edge_hash, me->v1, me->v2)) {
-                       PRINT("    edge %u: is a duplicate of %d\n", i,
+                       PRINT("\tEdge %u: is a duplicate of %d\n", i,
                              
GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, me->v1, me->v2)));
                        remove = do_fixes;
                }
@@ -296,7 +296,7 @@
                                                PRINT("    face %u: edge " 
STRINGIFY(a) "/" STRINGIFY(b) \
                                                      " (%u,%u) is missing egde 
data\n", i, mf->a, mf->b); \
                                                do_edge_recalc = TRUE; \
-                                       }
+                                       } (void)0
 
                MFace *mf;
                MFace *mf_prev;
@@ -306,6 +306,8 @@
                SortFace *sf_prev;
                unsigned int totsortface = 0;
 
+               PRINT("No Polys, only tesselated Faces\n");
+
                for (i = 0, mf = mfaces, sf = sort_faces; i < totface; i++, 
mf++) {
                        int remove = FALSE;
                        int fidx;
@@ -315,7 +317,7 @@
                        do {
                                fv[fidx] = *(&(mf->v1) + fidx);
                                if (fv[fidx] >= totvert) {
-                                       PRINT("    face %u: 'v%d' index out of 
range, %u\n", i, fidx + 1, fv[fidx]);
+                                       PRINT("\tFace %u: 'v%d' index out of 
range, %u\n", i, fidx + 1, fv[fidx]);
                                        remove = do_fixes;
                                }
                        } while (fidx--);
@@ -392,12 +394,12 @@
                                        mf_prev = mfaces + sf_prev->index;
 
                                        if (mf->v4) {
-                                               PRINT("    face %u & %u: are 
duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n",
+                                               PRINT("\tFace %u & %u: are 
duplicates (%u,%u,%u,%u) (%u,%u,%u,%u)\n",
                                                      sf->index, 
sf_prev->index, mf->v1, mf->v2, mf->v3, mf->v4,
                                                      mf_prev->v1, mf_prev->v2, 
mf_prev->v3, mf_prev->v4);
                                        }
                                        else {
-                                               PRINT("    face %u & %u: are 
duplicates (%u,%u,%u) (%u,%u,%u)\n",
+                                               PRINT("\tFace %u & %u: are 
duplicates (%u,%u,%u) (%u,%u,%u)\n",
                                                      sf->index, 
sf_prev->index, mf->v1, mf->v2, mf->v3,
                                                      mf_prev->v1, mf_prev->v2, 
mf_prev->v3);
                                        }
@@ -433,7 +435,7 @@
         *
         * Also, loops not used by polys can be discarded.
         * And "intersecting" loops (i.e. loops used by more than one poly) are 
invalid,
-        * so be sure to leave at most one poly/loop!
+        * so be sure to leave at most one poly per loop!
         */
        {
                SortPoly *sort_polys = MEM_callocN(sizeof(SortPoly) * totpoly, 
"mesh validate's sort_polys");
@@ -444,12 +446,12 @@
 
                        if (mp->loopstart < 0 || mp->totloop < 3) {
                                /* Invalid loop data. */
-                               PRINT("    poly %u is invalid (loopstart: %u, 
totloop: %u)\n", sp->index, mp->loopstart, mp->totloop);
+                               PRINT("\tPoly %u is invalid (loopstart: %u, 
totloop: %u)\n", sp->index, mp->loopstart, mp->totloop);
                                sp->invalid = TRUE;
                        }
                        else if (mp->loopstart + mp->totloop > totloop) {
                                /* Invalid loop data. */
-                               PRINT("    poly %u uses loops out of range 
(loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
+                               PRINT("\tPoly %u uses loops out of range 
(loopstart: %u, loopend: %u, max nbr of loops: %u)\n",
                                      sp->index, mp->loopstart, mp->loopstart + 
mp->totloop - 1, totloop - 1);
                                sp->invalid = TRUE;
                        }
@@ -465,7 +467,7 @@
                                for (j = 0, ml = &mloops[sp->loopstart]; j < 
mp->totloop; j++, ml++, v++) {
                                        if (ml->v >= totvert) {
                                                /* Invalid vert idx. */
-                                               PRINT("    loop %u has invalid 
vert reference (%u)\n", sp->loopstart + j, ml->v);
+                                               PRINT("\tLoop %u has invalid 
vert reference (%u)\n", sp->loopstart + j, ml->v);
                                                sp->invalid = TRUE;
                                        }
 
@@ -478,7 +480,7 @@
                                        v = sp->verts;
                                        for (j = 0; j < mp->totloop; j++, v++) {
                                                if ((mverts[*v].flag & 
ME_VERT_TMP_TAG) == 0) {
-                                                       PRINT("    poly %u has 
duplicate vert reference at corner (%u)\n", i, j);
+                                                       PRINT("\tPoly %u has 
duplicate vert reference at corner (%u)\n", i, j);
                                                        sp->invalid = TRUE;
                                                }
                                                mverts[*v].flag &= 
~ME_VERT_TMP_TAG;
@@ -494,7 +496,7 @@
                                        v2 = mloops[sp->loopstart + (j + 1) % 
mp->totloop].v;
                                        if (!BLI_edgehash_haskey(edge_hash, v1, 
v2)) {
                                                /* Edge not existing. */
-                                               PRINT("    poly %u needs 
missing edge (%u, %u)\n", sp->index, v1, v2);
+                                               PRINT("\tPoly %u needs missing 
edge (%u, %u)\n", sp->index, v1, v2);
                                                if (do_fixes)
                                                        do_edge_recalc = TRUE;
                                                else
@@ -506,11 +508,11 @@
                                                if (do_fixes) {
                                                        int prev_e = ml->e;
                                                        ml->e = 
GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
-                                                       PRINT("    loop %u has 
invalid edge reference (%u), fixed using edge %u\n",
+                                                       PRINT("\tLoop %u has 
invalid edge reference (%u), fixed using edge %u\n",
                                                              sp->loopstart + 
j, prev_e, ml->e);
                                                }
                                                else {
-                                                       PRINT("    loop %u has 
invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
+                                                       PRINT("\tLoop %u has 
invalid edge reference (%u)\n", sp->loopstart + j, ml->e);
                                                        sp->invalid = TRUE;
                                                }
                                        }
@@ -522,11 +524,11 @@
                                                        if (do_fixes) {
                                                                int prev_e = 
ml->e;
                                                                ml->e = 
GET_INT_FROM_POINTER(BLI_edgehash_lookup(edge_hash, v1, v2));
-                                                               PRINT("    poly 
%u has invalid edge reference (%u), fixed using edge %u\n",
+                                                               PRINT("\tPoly 
%u has invalid edge reference (%u), fixed using edge %u\n",
                                                                      
sp->index, prev_e, ml->e);
                                                        }
                                                        else {
-                                                               PRINT("    poly 
%u has invalid edge reference (%u)\n", sp->index, ml->e);
+                                                               PRINT("\tPoly 
%u has invalid edge reference (%u)\n", sp->index, ml->e);
                                                                sp->invalid = 
TRUE;
                                                        }
                                                }
@@ -544,7 +546,7 @@
                                                if (*v != *prev_v) {
                                                        int dlt = v - prev_v;
                                                        if (dlt > 1) {
-                                                               PRINT("    poly 
%u is invalid, it multi-uses vertex %u (%u times)\n",
+                                                               PRINT("\tPoly 
%u is invalid, it multi-uses vertex %u (%u times)\n",
                                                                      
sp->index, *prev_v, dlt);
                                                                sp->invalid = 
TRUE;
                                                        }
@@ -552,7 +554,7 @@
                                                }
                                        }
                                        if (v - prev_v > 1) { /* Don't forget 
final verts! */
-                                               PRINT("    poly %u is invalid, 
it multi-uses vertex %u (%u times)\n",
+                                               PRINT("\tPoly %u is invalid, it 
multi-uses vertex %u (%u times)\n",
                                                      sp->index, *prev_v, 
(int)(v - prev_v));
                                                sp->invalid = TRUE;
                                        }
@@ -610,17 +612,17 @@
                                p2_sub = FALSE;
 
                        if (p1_sub && p2_sub) {
-                               PRINT("    polys %u and %u use same vertices, 
considering poly %u as invalid.\n",
+                               PRINT("\tPolys %u and %u use same vertices, 
considering poly %u as invalid.\n",
                                      prev_sp->index, sp->index, sp->index);
                                sp->invalid = TRUE;
                        }
                        /* XXX In fact, these might be valid? :/ */
                        else if (p1_sub) {
-                               PRINT("    %u is a sub-poly of %u, considering 
it as invalid.\n", sp->index, prev_sp->index);
+                               PRINT("\t%u is a sub-poly of %u, considering it 
as invalid.\n", sp->index, prev_sp->index);
                                sp->invalid = TRUE;
                        }
                        else if (p2_sub) {
-                               PRINT("    %u is a sub-poly of %u, considering 
it as invalid.\n", prev_sp->index, sp->index);
+                               PRINT("\t%u is a sub-poly of %u, considering it 
as invalid.\n", prev_sp->index, sp->index);
                                prev_sp->invalid = TRUE;
                                prev_sp = sp; /* sp is new reference poly. */
                        }
@@ -631,7 +633,7 @@
                        }
                        if ((p1_nv == p2_nv) && (memcmp(p1_v, p2_v, p1_nv * 
sizeof(*p1_v)) == 0)) {
                                if (do_verbose) {
-                                       PRINT("    polys %u and %u use same 
vertices (%u",
+                                       PRINT("\tPolys %u and %u use same 
vertices (%u",
                                              prev_sp->index, sp->index, *p1_v);
                                        for (j = 1; j < p1_nv; j++)
                                                PRINT(", %u", p1_v[j]);
@@ -671,7 +673,7 @@
                                /* Unused loops. */
                                if (prev_end < sp->loopstart) {
                                        for (j = prev_end, ml = 
&mloops[prev_end]; j < sp->loopstart; j++, ml++) {
-                                               PRINT("    loop %u is 
unused.\n", j);
+                                               PRINT("\tLoop %u is unused.\n", 
j);
                                                if (do_fixes)
                                                        REMOVE_LOOP_TAG(ml);
                                        }
@@ -680,7 +682,7 @@
                                }
                                /* Multi-used loops. */
                                else if (prev_end > sp->loopstart) {
-                                       PRINT("    polys %u and %u share loops 
from %u to %u, considering poly %u as invalid.\n",
+                                       PRINT("\tPolys %u and %u share loops 
from %u to %u, considering poly %u as invalid.\n",
                                              prev_sp->index, sp->index, 
sp->loopstart, prev_end, sp->index);
                                        if (do_fixes) {
                                                
REMOVE_POLY_TAG((&mpolys[sp->index]));
@@ -699,7 +701,7 @@
                /* We may have some remaining unused loops to get rid of! */
                if (prev_end < totloop) {
                        for (j = prev_end, ml = &mloops[prev_end]; j < totloop; 
j++, ml++) {
-                               PRINT("    loop %u is unused.\n", j);
+                               PRINT("\tLoop %u is unused.\n", j);
                                if (do_fixes)
                                        REMOVE_LOOP_TAG(ml);
                        }
@@ -720,14 +722,14 @@
                        for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
                                /* note, greater then max defgroups is 
accounted for in our code, but not < 0 */
                                if (!finite(dw->weight)) {
-                                       PRINT("    vertex deform %u, group %d 
has weight: %f\n", i, dw->def_nr, dw->weight);
+                                       PRINT("\tVertex deform %u, group %d has 
weight: %f\n", i, dw->def_nr, dw->weight);
                                        if (do_fixes) {
                                                dw->weight = 0.0f;
                                                vert_weights_fixed = TRUE;
                                        }
                                }

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to