mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Added new command line option: -tbnauto
This commit is contained in:
parent
4e7cab3eb1
commit
be97920b58
@ -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);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -68,6 +68,7 @@ protected:
|
||||
double _normals_threshold;
|
||||
vector_string _tbn_names;
|
||||
bool _got_tbnall;
|
||||
bool _got_tbnauto;
|
||||
|
||||
bool _got_transform;
|
||||
LMatrix4d _transform;
|
||||
|
@ -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) {
|
||||
|
@ -147,6 +147,7 @@ MayaToEgg() :
|
||||
_verbose = 0;
|
||||
_polygon_tolerance = 0.01;
|
||||
_transform_type = MayaToEggConverter::TT_model;
|
||||
_got_tbnauto = true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user