Added tangent computation and removed dead vertices

This commit is contained in:
Josh Yelon 2008-08-28 06:46:12 +00:00
parent 36517ac3b7
commit b98db4a8d8
2 changed files with 9 additions and 1 deletions

View File

@ -132,6 +132,11 @@ 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;

View File

@ -52,6 +52,7 @@ class MaxToEggConverter {
bool _any_diffuse;
bool _any_opacity;
bool _any_gloss;
bool _any_normal;
};
typedef std::map<Mtl*,PandaMaterial> MaterialMap;
MaxEggOptions *_options;