28 "Force complete loading: load up the egg file along with all of its " 29 "external references.",
30 &EggMultiBase::dispatch_none, &_force_complete);
34 "Don't allow any of the named egg files to have absolute pathnames. " 35 "If any do, abort with an error. This option is designed to help " 36 "detect errors when populating or building a standalone model tree, " 37 "which should be self-contained and include only relative pathnames.",
38 &EggMultiBase::dispatch_none, &_noabs);
58 nout <<
"Applying transform matrix:\n";
59 _transform.write(nout, 2);
60 LVecBase3d scale, hpr, translate;
61 if (decompose_matrix(_transform, scale, hpr, translate,
62 _eggs[0]->get_coordinate_system())) {
63 nout <<
"(scale " << scale <<
", hpr " << hpr <<
", translate " 64 << translate <<
")\n";
66 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
67 (*ei)->transform(_transform);
72 nout <<
"Making points\n";
73 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
74 (*ei)->make_point_primitives();
78 switch (_normals_mode) {
80 nout <<
"Stripping normals.\n";
81 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
82 (*ei)->strip_normals();
83 (*ei)->remove_unused_vertices(
true);
88 nout <<
"Recomputing polygon normals.\n";
89 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
90 (*ei)->recompute_polygon_normals();
91 (*ei)->remove_unused_vertices(
true);
96 nout <<
"Recomputing vertex normals.\n";
97 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
98 (*ei)->recompute_vertex_normals(_normals_threshold);
99 (*ei)->remove_unused_vertices(
true);
109 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
110 if ((*ei)->recompute_tangent_binormal(
GlobPattern(
"*"))) {
111 (*ei)->remove_unused_vertices(
true);
116 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
117 if ((*ei)->recompute_tangent_binormal_auto()) {
118 (*ei)->remove_unused_vertices(
true);
123 for (vector_string::const_iterator si = _tbn_names.begin();
124 si != _tbn_names.end();
127 nout <<
"Computing tangent and binormal for \"" << uv_name <<
"\"\n";
128 for (ei = _eggs.begin(); ei != _eggs.end(); ++ei) {
129 (*ei)->recompute_tangent_binormal(uv_name);
130 (*ei)->remove_unused_vertices(
true);
146 read_egg(
const Filename &filename) {
149 if (!data->read(filename)) {
154 if (_noabs && data->original_had_absolute_pathnames()) {
156 <<
" includes absolute pathnames!\n";
169 if (_force_complete) {
170 if (!data->load_externals()) {
179 if (_got_coordinate_system) {
180 data->set_coordinate_system(_coordinate_system);
182 _coordinate_system = data->get_coordinate_system();
183 _got_coordinate_system =
true;
std::string get_dirname() const
Returns the directory part of the filename.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void append_directory(const Filename &directory)
Adds a new directory to the end of the search list.
This is the primary interface into all the egg data, and the root of the egg file structure.
static void convert_paths(EggNode *node, PathReplace *path_replace, const DSearchPath &additional_path)
Recursively walks the egg hierarchy.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::string get_basename() const
Returns the basename part of the filename.
PT(EggData) EggMultiBase
Allocates and returns a new EggData structure that represents the indicated egg file.
void post_process_egg_files()
Performs any processing of the egg file(s) that is appropriate before writing them out.
This class stores a list of directories that can be searched, in order, to locate a particular file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class can be used to test for string matches against standard Unix- shell filename globbing conv...