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