mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
add -tbnall
This commit is contained in:
parent
ff51585276
commit
2362924423
@ -91,14 +91,18 @@ add_normals_options() {
|
|||||||
add_option
|
add_option
|
||||||
("tbn", "name", 48,
|
("tbn", "name", 48,
|
||||||
"Compute tangent and binormal for the named texture coordinate "
|
"Compute tangent and binormal for the named texture coordinate "
|
||||||
"set(s). The name may include wildcard characters such as * and ?; "
|
"set(s). The name may include wildcard characters such as * and ?. "
|
||||||
"use \"*\" to recompute tangent and binormal for all texture coordinate "
|
|
||||||
"sets. "
|
|
||||||
"The normal must already exist or have been computed via one of the "
|
"The normal must already exist or have been computed via one of the "
|
||||||
"above options. The tangent and binormal are used to implement "
|
"above options. The tangent and binormal are used to implement "
|
||||||
"bump mapping and related texture-based lighting effects. This option "
|
"bump mapping and related texture-based lighting effects. This option "
|
||||||
"may be repeated as necessary to name multiple texture coordinate sets.",
|
"may be repeated as necessary to name multiple texture coordinate sets.",
|
||||||
&EggBase::dispatch_vector_string, NULL, &_tbn_names);
|
&EggBase::dispatch_vector_string, NULL, &_tbn_names);
|
||||||
|
|
||||||
|
add_option
|
||||||
|
("tbnall", "", 48,
|
||||||
|
"Compute tangent and binormal for all texture coordinate "
|
||||||
|
"set(s). This is equivalent to -tbn \"*\".",
|
||||||
|
&EggBase::dispatch_none, &_got_tbnall);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -67,6 +67,7 @@ protected:
|
|||||||
NormalsMode _normals_mode;
|
NormalsMode _normals_mode;
|
||||||
double _normals_threshold;
|
double _normals_threshold;
|
||||||
vector_string _tbn_names;
|
vector_string _tbn_names;
|
||||||
|
bool _got_tbnall;
|
||||||
|
|
||||||
bool _got_transform;
|
bool _got_transform;
|
||||||
LMatrix4d _transform;
|
LMatrix4d _transform;
|
||||||
|
@ -163,6 +163,11 @@ post_process_egg_file() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_got_tbnall) {
|
||||||
|
nout << "Computing tangent and binormal for all UV sets.\n";
|
||||||
|
_data->recompute_tangent_binormal(GlobPattern("*"));
|
||||||
|
|
||||||
|
} else {
|
||||||
for (vector_string::const_iterator si = _tbn_names.begin();
|
for (vector_string::const_iterator si = _tbn_names.begin();
|
||||||
si != _tbn_names.end();
|
si != _tbn_names.end();
|
||||||
++si) {
|
++si) {
|
||||||
@ -170,6 +175,7 @@ post_process_egg_file() {
|
|||||||
nout << "Computing tangent and binormal for \"" << uv_name << "\"\n";
|
nout << "Computing tangent and binormal for \"" << uv_name << "\"\n";
|
||||||
_data->recompute_tangent_binormal(uv_name);
|
_data->recompute_tangent_binormal(uv_name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user