Added new command line option: -tbnauto

This commit is contained in:
Josh Yelon 2008-01-29 17:04:33 +00:00
parent 4e7cab3eb1
commit be97920b58
4 changed files with 12 additions and 11 deletions

View File

@ -43,6 +43,7 @@ EggBase() {
_normals_threshold = 0.0;
_got_tbnall = false;
_got_tbnauto = false;
_got_transform = false;
_transform = LMatrix4d::ident_mat();
@ -105,6 +106,11 @@ add_normals_options() {
"Compute tangent and binormal for all texture coordinate "
"sets. This is equivalent to -tbn \"*\".",
&EggBase::dispatch_none, &_got_tbnall);
add_option
("tbnauto", "", 48,
"Compute tangent and binormal for all normal maps. ",
&EggBase::dispatch_none, &_got_tbnauto);
}
////////////////////////////////////////////////////////////////////

View File

@ -68,6 +68,7 @@ protected:
double _normals_threshold;
vector_string _tbn_names;
bool _got_tbnall;
bool _got_tbnauto;
bool _got_transform;
LMatrix4d _transform;

View File

@ -166,19 +166,12 @@ post_process_egg_file() {
}
if (_got_tbnall) {
nout << "Computing tangent and binormal for all UV sets.\n";
_data->recompute_tangent_binormal(GlobPattern("*"));
needs_remove = true;
needs_remove |= _data->recompute_tangent_binormal(GlobPattern("*"));
} else {
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";
_data->recompute_tangent_binormal(uv_name);
needs_remove = true;
if (_got_tbnauto) {
needs_remove |= _data->recompute_tangent_binormal_auto();
}
needs_remove |= _data->recompute_tangent_binormal(_tbn_names);
}
if (needs_remove) {

View File

@ -147,6 +147,7 @@ MayaToEgg() :
_verbose = 0;
_polygon_tolerance = 0.01;
_transform_type = MayaToEggConverter::TT_model;
_got_tbnauto = true;
}
////////////////////////////////////////////////////////////////////