diff options
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_log.c | 28 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_log.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c index 04ad80214c2..dcfe53605a6 100644 --- a/source/blender/bmesh/intern/bmesh_log.c +++ b/source/blender/bmesh/intern/bmesh_log.c @@ -1003,3 +1003,31 @@ void bm_log_print(const BMLog *log, const char *description) } } #endif + +void BM_log_print_entry(BMesh *bm, BMLogEntry *entry) +{ + if (bm) { + printf("BM { totvert=%d totedge=%d totloop=%d totpoly=%d\n", + bm->totvert, + bm->totedge, + bm->totloop, + bm->totface); + + if (!bm->totvert) { + printf("%s: Warning: empty bmesh\n", __func__); + } + } + else { + printf("BM { totvert=unknown totedge=unknown totloop=unknown totpoly=unknown\n"); + } + + printf("v | added: %d, removed: %d, modified: %d\n", + BLI_ghash_len(entry->added_verts), + BLI_ghash_len(entry->deleted_verts), + BLI_ghash_len(entry->modified_verts)); + printf("f | added: %d, removed: %d, modified: %d\n", + BLI_ghash_len(entry->added_faces), + BLI_ghash_len(entry->deleted_faces), + BLI_ghash_len(entry->modified_faces)); + printf("}\n"); +} diff --git a/source/blender/bmesh/intern/bmesh_log.h b/source/blender/bmesh/intern/bmesh_log.h index 75ff54c7d46..8c9db9c66e7 100644 --- a/source/blender/bmesh/intern/bmesh_log.h +++ b/source/blender/bmesh/intern/bmesh_log.h @@ -206,3 +206,5 @@ void BM_log_original_vert_data(BMLog *log, BMVert *v, const float **r_co, const BMLogEntry *BM_log_current_entry(BMLog *log); /** For internal use only (unit testing) */ struct RangeTreeUInt *BM_log_unused_ids(BMLog *log); + +void BM_log_print_entry(BMesh *bm, BMLogEntry *entry); |