From b98db4a8d8f94db77b7cc890f11ff1d905584501 Mon Sep 17 00:00:00 2001 From: Josh Yelon Date: Thu, 28 Aug 2008 06:46:12 +0000 Subject: [PATCH] Added tangent computation and removed dead vertices --- pandatool/src/maxegg/maxToEggConverter.cxx | 9 ++++++++- pandatool/src/maxegg/maxToEggConverter.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandatool/src/maxegg/maxToEggConverter.cxx b/pandatool/src/maxegg/maxToEggConverter.cxx index b9219b8e56..2a4a2e52de 100755 --- a/pandatool/src/maxegg/maxToEggConverter.cxx +++ b/pandatool/src/maxegg/maxToEggConverter.cxx @@ -131,7 +131,12 @@ bool MaxToEggConverter::convert(MaxEggOptions *options) { reparent_decals(_egg_data); } - + + if (all_ok) { + _egg_data->recompute_tangent_binormal_auto(); + _egg_data->remove_unused_vertices(true); + } + if (all_ok) { Filename fn = Filename::from_os_specific(_options->_file_name); return _egg_data->write_egg(fn); @@ -869,6 +874,7 @@ get_panda_material(Mtl *mtl, MtlID matID) { pandaMat._any_diffuse = false; pandaMat._any_opacity = false; pandaMat._any_gloss = false; + pandaMat._any_normal = false; // If it's a multi-material, dig down. @@ -1120,6 +1126,7 @@ void MaxToEggConverter::analyze_normal_maps(PandaMaterial &pandaMat, Texmap *mat if (mat == 0) return; if (mat->ClassID() == Class_ID(BMTEX_CLASS_ID, 0)) { + pandaMat._any_normal = true; BitmapTex *ntex = (BitmapTex *)mat; Filename fullpath, outpath; diff --git a/pandatool/src/maxegg/maxToEggConverter.h b/pandatool/src/maxegg/maxToEggConverter.h index e1f586ef7e..e24f7ec89f 100755 --- a/pandatool/src/maxegg/maxToEggConverter.h +++ b/pandatool/src/maxegg/maxToEggConverter.h @@ -52,6 +52,7 @@ class MaxToEggConverter { bool _any_diffuse; bool _any_opacity; bool _any_gloss; + bool _any_normal; }; typedef std::map MaterialMap; MaxEggOptions *_options;