From aa74caacbe92ff987691c99adeaaf18659673b90 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 27 Sep 2016 21:35:38 +0200 Subject: [PATCH] Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar --- doc/ReleaseNotes | 1 + pandatool/src/eggbase/eggMultiBase.cxx | 27 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 1da0320973..ce390136fc 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -37,6 +37,7 @@ This issue fixes several bugs that were still found in 1.9.2. * Fix asyncFlattenStrong called on nodes without parent * Fix is_playing() check when playing an animation backwards * Windows installer no longer clears %PATH% if longer than 1024 chars +* Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar ------------------------ RELEASE 1.9.2 ------------------------ diff --git a/pandatool/src/eggbase/eggMultiBase.cxx b/pandatool/src/eggbase/eggMultiBase.cxx index 27513e6dfe..1f1a0e3bea 100644 --- a/pandatool/src/eggbase/eggMultiBase.cxx +++ b/pandatool/src/eggbase/eggMultiBase.cxx @@ -111,6 +111,33 @@ post_process_egg_files() { // Do nothing. break; } + + if (_got_tbnall) { + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + if ((*ei)->recompute_tangent_binormal(GlobPattern("*"))) { + (*ei)->remove_unused_vertices(true); + } + } + } else { + if (_got_tbnauto) { + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + if ((*ei)->recompute_tangent_binormal_auto()) { + (*ei)->remove_unused_vertices(true); + } + } + } + + for (vector_string::const_iterator si = _tbn_names.begin(); + si != _tbn_names.end(); + ++si) { + GlobPattern uv_name(*si); + nout << "Computing tangent and binormal for \"" << uv_name << "\"\n"; + for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) { + (*ei)->recompute_tangent_binormal(uv_name); + (*ei)->remove_unused_vertices(true); + } + } + } }