mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -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;
|
_normals_threshold = 0.0;
|
||||||
|
|
||||||
_got_tbnall = false;
|
_got_tbnall = false;
|
||||||
|
_got_tbnauto = false;
|
||||||
|
|
||||||
_got_transform = false;
|
_got_transform = false;
|
||||||
_transform = LMatrix4d::ident_mat();
|
_transform = LMatrix4d::ident_mat();
|
||||||
@ -105,6 +106,11 @@ add_normals_options() {
|
|||||||
"Compute tangent and binormal for all texture coordinate "
|
"Compute tangent and binormal for all texture coordinate "
|
||||||
"sets. This is equivalent to -tbn \"*\".",
|
"sets. This is equivalent to -tbn \"*\".",
|
||||||
&EggBase::dispatch_none, &_got_tbnall);
|
&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;
|
double _normals_threshold;
|
||||||
vector_string _tbn_names;
|
vector_string _tbn_names;
|
||||||
bool _got_tbnall;
|
bool _got_tbnall;
|
||||||
|
bool _got_tbnauto;
|
||||||
|
|
||||||
bool _got_transform;
|
bool _got_transform;
|
||||||
LMatrix4d _transform;
|
LMatrix4d _transform;
|
||||||
|
@ -166,19 +166,12 @@ post_process_egg_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_got_tbnall) {
|
if (_got_tbnall) {
|
||||||
nout << "Computing tangent and binormal for all UV sets.\n";
|
needs_remove |= _data->recompute_tangent_binormal(GlobPattern("*"));
|
||||||
_data->recompute_tangent_binormal(GlobPattern("*"));
|
|
||||||
needs_remove = true;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (vector_string::const_iterator si = _tbn_names.begin();
|
if (_got_tbnauto) {
|
||||||
si != _tbn_names.end();
|
needs_remove |= _data->recompute_tangent_binormal_auto();
|
||||||
++si) {
|
|
||||||
GlobPattern uv_name(*si);
|
|
||||||
nout << "Computing tangent and binormal for \"" << uv_name << "\"\n";
|
|
||||||
_data->recompute_tangent_binormal(uv_name);
|
|
||||||
needs_remove = true;
|
|
||||||
}
|
}
|
||||||
|
needs_remove |= _data->recompute_tangent_binormal(_tbn_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needs_remove) {
|
if (needs_remove) {
|
||||||
|
@ -147,6 +147,7 @@ MayaToEgg() :
|
|||||||
_verbose = 0;
|
_verbose = 0;
|
||||||
_polygon_tolerance = 0.01;
|
_polygon_tolerance = 0.01;
|
||||||
_transform_type = MayaToEggConverter::TT_model;
|
_transform_type = MayaToEggConverter::TT_model;
|
||||||
|
_got_tbnauto = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user