Panda3D
 All Classes Functions Variables Enumerations
eggToBam.cxx
1 // Filename: eggToBam.cxx
2 // Created by: drose (28Jun00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "eggToBam.h"
16 
17 #include "config_util.h"
18 #include "bamFile.h"
19 #include "load_egg_file.h"
20 #include "config_egg2pg.h"
21 #include "config_gobj.h"
22 #include "config_chan.h"
23 #include "pandaNode.h"
24 #include "geomNode.h"
25 #include "renderState.h"
26 #include "textureAttrib.h"
27 #include "dcast.h"
28 #include "graphicsPipeSelection.h"
29 #include "graphicsEngine.h"
30 #include "graphicsBuffer.h"
31 #include "graphicsStateGuardian.h"
32 #include "load_prc_file.h"
33 #include "windowProperties.h"
34 #include "frameBufferProperties.h"
35 #include "pystub.h"
36 
37 ////////////////////////////////////////////////////////////////////
38 // Function: EggToBam::Constructor
39 // Access: Public
40 // Description:
41 ////////////////////////////////////////////////////////////////////
42 EggToBam::
43 EggToBam() :
44  EggToSomething("Bam", ".bam", true, false)
45 {
46  set_program_brief("convert .egg files to .bam files");
47  set_program_description
48  ("This program reads Egg files and outputs Bam files, the binary format "
49  "suitable for direct loading of animation and models into Panda. Bam "
50  "files are tied to a particular version of Panda, so should not be "
51  "considered replacements for egg files, but they tend to be smaller and "
52  "load much faster than the equivalent egg files.");
53 
54  // -f is always in effect for egg2bam. It doesn't make sense to
55  // provide it as an option to the user.
56  remove_option("f");
57 
58  add_path_replace_options();
59  add_path_store_options();
60 
61  add_option
62  ("flatten", "flag", 0,
63  "Specifies whether to flatten the egg hierarchy after it is loaded. "
64  "If flag is zero, the egg hierarchy will not be flattened, but will "
65  "instead be written to the bam file exactly as it is. If flag is "
66  "non-zero, the hierarchy will be flattened so that unnecessary nodes "
67  "(usually group nodes with only one child) are eliminated. The default "
68  "if this is not specified is taken from the egg-flatten Config.prc "
69  "variable.",
70  &EggToBam::dispatch_int, &_has_egg_flatten, &_egg_flatten);
71 
72  add_option
73  ("combine-geoms", "flag", 0,
74  "Specifies whether to combine sibling GeomNodes into a common GeomNode "
75  "when possible. This flag is only respected if flatten, above, is also "
76  "enabled (or implicitly true from the Config.prc file). The default if "
77  "this is not specified is taken from the egg-combine-geoms Config.prc "
78  "variable.",
79  &EggToBam::dispatch_int, &_has_egg_combine_geoms, &_egg_combine_geoms);
80 
81  add_option
82  ("suppress-hidden", "flag", 0,
83  "Specifies whether to suppress hidden geometry. If this is nonzero, "
84  "egg geometry tagged as \"hidden\" will be removed from the final "
85  "scene graph; otherwise, it will be preserved (but stashed). The "
86  "default is nonzero, to remove it.",
87  &EggToBam::dispatch_int, NULL, &_egg_suppress_hidden);
88 
89  add_option
90  ("ls", "", 0,
91  "Writes a scene graph listing to standard output after the egg "
92  "file has been loaded, showing the nodes that will be written out.",
93  &EggToBam::dispatch_none, &_ls);
94 
95  add_option
96  ("C", "quality", 0,
97  "Specify the quality level for lossy channel compression. If this "
98  "is specified, the animation channels will be compressed at this "
99  "quality level, which is normally an integer value between 0 and 100, "
100  "inclusive, where higher numbers produce larger files with greater "
101  "quality. Generally, 95 is the highest useful quality level. Use "
102  "-NC (described below) to disable channel compression. If neither "
103  "option is specified, the default comes from the Config.prc file.",
104  &EggToBam::dispatch_int, &_has_compression_quality, &_compression_quality);
105 
106  add_option
107  ("NC", "", 0,
108  "Turn off lossy compression of animation channels. Channels will be "
109  "written exactly as they are, losslessly.",
110  &EggToBam::dispatch_none, &_compression_off);
111 
112  add_option
113  ("rawtex", "", 0,
114  "Record texture data directly in the bam file, instead of storing "
115  "a reference to the texture elsewhere on disk. The textures are "
116  "stored uncompressed, unless -ctex is also specified. "
117  "A particular texture that is encoded into "
118  "multiple different bam files in this way cannot be unified into "
119  "the same part of texture memory if the different bam files are loaded "
120  "together. That being said, this can sometimes be a convenient "
121  "way to ensure the bam file is completely self-contained.",
122  &EggToBam::dispatch_none, &_tex_rawdata);
123 
124  add_option
125  ("txo", "", 0,
126  "Rather than writing texture data directly into the bam file, as in "
127  "-rawtex, create a texture object for each referenced texture. A "
128  "texture object is a kind of mini-bam file, with a .txo extension, "
129  "that contains all of the data needed to recreate a texture, including "
130  "its image contents, filter and wrap settings, and so on. 3-D textures "
131  "and cube maps can also be represented in a single .txo file. Texture "
132  "object files, like bam files, are tied to a particular version of "
133  "Panda.",
134  &EggToBam::dispatch_none, &_tex_txo);
135 
136 #ifdef HAVE_ZLIB
137  add_option
138  ("txopz", "", 0,
139  "In addition to writing texture object files as above, compress each "
140  "one using pzip to a .txo.pz file. In many cases, this will yield a "
141  "disk file size comparable to that achieved by png compression. This "
142  "is an on-disk compression only, and does not affect the amount of "
143  "RAM or texture memory consumed by the texture when it is loaded.",
144  &EggToBam::dispatch_none, &_tex_txopz);
145 #endif // HAVE_ZLIB
146 
147  add_option
148  ("ctex", "", 0,
149 #ifdef HAVE_SQUISH
150  "Pre-compress the texture images using the libsquish library, when "
151  "using -rawtex or -txo. "
152 #else
153  "Asks the graphics card to pre-compress the texture images when using "
154  "-rawtex or -txo. "
155 #endif // HAVE_SQUISH
156 #ifdef HAVE_ZLIB
157  "This is unrelated to the on-disk compression achieved "
158  "via -txopz (and it may be used in conjunction with that parameter). "
159 #endif // HAVE_ZLIB
160  "This will result in a smaller RAM and texture memory footprint for "
161  "the texture images. The same "
162  "effect can be achieved at load time by setting compressed-textures in "
163  "your Config.prc file; but -ctex pre-compresses the "
164  "textures so that they do not need to be compressed at load time. "
165 #ifndef HAVE_SQUISH
166  "Note that, since your Panda is not compiled with the libsquish "
167  "library, using -ctex will make .txo files that are only guaranteed "
168  "to load on the particular graphics card that was used to "
169  "generate them."
170 #endif // HAVE_SQUISH
171  ,
172  &EggToBam::dispatch_none, &_tex_ctex);
173 
174  add_option
175  ("mipmap", "", 0,
176  "Records the pre-generated mipmap levels in the texture object file "
177  "when using -rawtex or -txo, regardless of the texture filter mode. This "
178  "will increase the size of the texture object file by about 33%, but "
179  "it prevents the need to compute the mipmaps at runtime. The default "
180  "is to record mipmap levels only when the texture uses a mipmap "
181  "filter mode.",
182  &EggToBam::dispatch_none, &_tex_mipmap);
183 
184  add_option
185  ("ctexq", "quality", 0,
186  "Specifies the compression quality to use when performing the "
187  "texture compression requested by -ctex. This may be one of "
188  "'default', 'fastest', 'normal', or 'best'. The default is 'best'. "
189  "Set it to 'default' to use whatever is specified by the Config.prc "
190  "file. This is a global setting only; individual texture quality "
191  "settings appearing within the egg file will override this.",
192  &EggToBam::dispatch_string, NULL, &_ctex_quality);
193 
194  add_option
195  ("load-display", "display name", 0,
196  "Specifies the particular display module to load to perform the texture "
197  "compression requested by -ctex. If this is omitted, the default is "
198  "taken from the Config.prc file."
199 #ifdef HAVE_SQUISH
200  " Since your Panda has libsquish compiled in, this is not necessary; "
201  "Panda can compress textures without loading a display module."
202 #endif // HAVE_SQUISH
203  ,
204  &EggToBam::dispatch_string, NULL, &_load_display);
205 
206  redescribe_option
207  ("cs",
208  "Specify the coordinate system of the resulting " + _format_name +
209  " file. This may be "
210  "one of 'y-up', 'z-up', 'y-up-left', or 'z-up-left'. The default "
211  "is z-up.");
212 
213  _force_complete = true;
214  _egg_flatten = 0;
215  _egg_combine_geoms = 0;
216  _egg_suppress_hidden = 1;
217  _tex_txopz = false;
218  _ctex_quality = "best";
219 }
220 
221 ////////////////////////////////////////////////////////////////////
222 // Function: EggToBam::run
223 // Access: Public
224 // Description:
225 ////////////////////////////////////////////////////////////////////
226 void EggToBam::
227 run() {
228  if (_has_egg_flatten) {
229  // If the user specified some -flatten, we need to set the
230  // corresponding Config.prc variable.
231  egg_flatten = (_egg_flatten != 0);
232  }
233  if (_has_egg_combine_geoms) {
234  // Ditto with -combine_geoms.
235  egg_combine_geoms = (_egg_combine_geoms != 0);
236  }
237 
238  // We always set egg_suppress_hidden.
239  egg_suppress_hidden = _egg_suppress_hidden;
240 
241  if (_compression_off) {
242  // If the user specified -NC, turn off channel compression.
243  compress_channels = false;
244 
245  } else if (_has_compression_quality) {
246  // Otherwise, if the user specified a compression quality with -C,
247  // use that quality level.
248  compress_channels = true;
249  compress_chan_quality = _compression_quality;
250  }
251 
252  if (_ctex_quality != "default") {
253  // Override the user's config file with the command-line parameter
254  // for texture compression.
255  string prc = "texture-quality-level " + _ctex_quality;
256  load_prc_file_data("prc", prc);
257  }
258 
259  if (!_got_coordinate_system) {
260  // If the user didn't specify otherwise, ensure the coordinate
261  // system is Z-up.
262  _data->set_coordinate_system(CS_zup_right);
263  }
264 
265  PT(PandaNode) root = load_egg_data(_data);
266  if (root == (PandaNode *)NULL) {
267  nout << "Unable to build scene graph from egg file.\n";
268  exit(1);
269  }
270 
271  if (_tex_ctex) {
272 #ifndef HAVE_SQUISH
273  if (!make_buffer()) {
274  nout << "Unable to initialize graphics context; cannot compress textures.\n";
275  exit(1);
276  }
277 #endif // HAVE_SQUISH
278  }
279 
280  if (_tex_txo || _tex_txopz || (_tex_ctex && _tex_rawdata)) {
281  collect_textures(root);
282  Textures::iterator ti;
283  for (ti = _textures.begin(); ti != _textures.end(); ++ti) {
284  Texture *tex = (*ti);
285  tex->get_ram_image();
286  bool want_mipmaps = (_tex_mipmap || tex->uses_mipmaps());
287  if (want_mipmaps) {
288  // Generate mipmap levels.
290  }
291 
292  if (_tex_ctex) {
293 #ifdef HAVE_SQUISH
294  if (!tex->compress_ram_image()) {
295  nout << " couldn't compress " << tex->get_name() << "\n";
296  }
297  tex->set_compression(Texture::CM_on);
298 #else // HAVE_SQUISH
299  tex->set_keep_ram_image(true);
300  bool has_mipmap_levels = (tex->get_num_ram_mipmap_images() > 1);
301  if (!_engine->extract_texture_data(tex, _gsg)) {
302  nout << " couldn't compress " << tex->get_name() << "\n";
303  }
304  if (!has_mipmap_levels && !want_mipmaps) {
305  // Make sure we didn't accidentally introduce mipmap levels
306  // by rendezvousing through the graphics card.
308  }
309  tex->set_keep_ram_image(false);
310 #endif // HAVE_SQUISH
311  }
312 
313  if (_tex_txo || _tex_txopz) {
314  convert_txo(tex);
315  }
316  }
317  }
318 
319  if (_ls) {
320  root->ls(nout, 0);
321  }
322 
323  // This should be guaranteed because we pass false to the
324  // constructor, above.
325  nassertv(has_output_filename());
326 
327  Filename filename = get_output_filename();
328  filename.make_dir();
329  nout << "Writing " << filename << "\n";
330  BamFile bam_file;
331  if (!bam_file.open_write(filename)) {
332  nout << "Error in writing.\n";
333  exit(1);
334  }
335 
336  if (!bam_file.write_object(root)) {
337  nout << "Error in writing.\n";
338  exit(1);
339  }
340 }
341 
342 ////////////////////////////////////////////////////////////////////
343 // Function: EggToBam::handle_args
344 // Access: Protected, Virtual
345 // Description: Does something with the additional arguments on the
346 // command line (after all the -options have been
347 // parsed). Returns true if the arguments are good,
348 // false otherwise.
349 ////////////////////////////////////////////////////////////////////
350 bool EggToBam::
351 handle_args(ProgramBase::Args &args) {
352  // If the user specified a path store option, we need to set the
353  // bam-texture-mode Config.prc variable directly to support this
354  // (otherwise the bam code will do what it wants to do anyway).
355  if (_tex_rawdata) {
356  bam_texture_mode = BamFile::BTM_rawdata;
357 
358  } else if (_got_path_store) {
359  bam_texture_mode = BamFile::BTM_unchanged;
360 
361  } else {
362  // Otherwise, the default path store is absolute; then the
363  // bam-texture-mode can do the appropriate thing to it.
364  _path_replace->_path_store = PS_absolute;
365  }
366 
367  return EggToSomething::handle_args(args);
368 }
369 
370 ////////////////////////////////////////////////////////////////////
371 // Function: EggToBam::collect_textures
372 // Access: Private
373 // Description: Recursively walks the scene graph, looking for
374 // Texture references.
375 ////////////////////////////////////////////////////////////////////
376 void EggToBam::
377 collect_textures(PandaNode *node) {
378  collect_textures(node->get_state());
379  if (node->is_geom_node()) {
380  GeomNode *geom_node = DCAST(GeomNode, node);
381  int num_geoms = geom_node->get_num_geoms();
382  for (int i = 0; i < num_geoms; ++i) {
383  collect_textures(geom_node->get_geom_state(i));
384  }
385  }
386 
387  PandaNode::Children children = node->get_children();
388  int num_children = children.get_num_children();
389  for (int i = 0; i < num_children; ++i) {
390  collect_textures(children.get_child(i));
391  }
392 }
393 
394 ////////////////////////////////////////////////////////////////////
395 // Function: EggToBam::collect_textures
396 // Access: Private
397 // Description: Recursively walks the scene graph, looking for
398 // Texture references.
399 ////////////////////////////////////////////////////////////////////
400 void EggToBam::
401 collect_textures(const RenderState *state) {
402  const TextureAttrib *tex_attrib = DCAST(TextureAttrib, state->get_attrib(TextureAttrib::get_class_type()));
403  if (tex_attrib != (TextureAttrib *)NULL) {
404  int num_on_stages = tex_attrib->get_num_on_stages();
405  for (int i = 0; i < num_on_stages; ++i) {
406  _textures.insert(tex_attrib->get_on_texture(tex_attrib->get_on_stage(i)));
407  }
408  }
409 }
410 
411 ////////////////////////////////////////////////////////////////////
412 // Function: EggToBam::convert_txo
413 // Access: Private
414 // Description: If the indicated Texture was not already loaded from
415 // a txo file, writes it to a txo file and updates the
416 // Texture object to reference the new file.
417 ////////////////////////////////////////////////////////////////////
418 void EggToBam::
419 convert_txo(Texture *tex) {
420  if (!tex->get_loaded_from_txo()) {
421  Filename fullpath = tex->get_fullpath().get_filename_index(0);
422  if (_tex_txopz) {
423  fullpath.set_extension("txo.pz");
424  // We use this clumsy syntax so that the new extension appears to be
425  // two separate extensions, .txo followed by .pz, which is what
426  // Texture::write() expects to find.
427  fullpath = Filename(fullpath.get_fullpath());
428  } else {
429  fullpath.set_extension("txo");
430  }
431 
432  if (tex->write(fullpath)) {
433  nout << " Writing " << fullpath;
434  if (tex->get_ram_image_compression() != Texture::CM_off) {
435  nout << " (compressed " << tex->get_ram_image_compression() << ")";
436  }
437  nout << "\n";
438  tex->set_loaded_from_txo();
439  tex->set_fullpath(fullpath);
440  tex->clear_alpha_fullpath();
441 
442  Filename filename = tex->get_filename().get_filename_index(0);
443  if (_tex_txopz) {
444  filename.set_extension("txo.pz");
445  filename = Filename(filename.get_fullpath());
446  } else {
447  filename.set_extension("txo");
448  }
449 
450  tex->set_filename(filename);
451  tex->clear_alpha_filename();
452  }
453  }
454 }
455 
456 ////////////////////////////////////////////////////////////////////
457 // Function: EggToBam::make_buffer
458 // Access: Private
459 // Description: Creates a GraphicsBuffer for communicating with the
460 // graphics card.
461 ////////////////////////////////////////////////////////////////////
462 bool EggToBam::
463 make_buffer() {
464  if (!_load_display.empty()) {
465  // Override the user's config file with the command-line parameter.
466  string prc = "load-display " + _load_display;
467  load_prc_file_data("prc", prc);
468  }
469 
471  _pipe = selection->make_default_pipe();
472  if (_pipe == (GraphicsPipe *)NULL) {
473  nout << "Unable to create graphics pipe.\n";
474  return false;
475  }
476 
477  _engine = new GraphicsEngine;
478 
480 
481  // Some graphics drivers can only create single-buffered offscreen
482  // buffers. So request that.
483  fbprops.set_back_buffers(0);
484 
485  WindowProperties winprops;
486  winprops.set_size(1, 1);
487  winprops.set_origin(0, 0);
488  winprops.set_undecorated(true);
489  winprops.set_open(true);
490  winprops.set_z_order(WindowProperties::Z_bottom);
491 
492  // We don't care how big the buffer is; we just need it to manifest
493  // the GSG.
494  _buffer = _engine->make_output(_pipe, "buffer", 0,
495  fbprops, winprops,
496  GraphicsPipe::BF_fb_props_optional);
497  _engine->open_windows();
498  if (_buffer == (GraphicsOutput *)NULL || !_buffer->is_valid()) {
499  nout << "Unable to create graphics window.\n";
500  return false;
501  }
502  _gsg = _buffer->get_gsg();
503 
504  return true;
505 }
506 
507 
508 int main(int argc, char *argv[]) {
509  // A call to pystub() to force libpystub.so to be linked in.
510  pystub();
511 
512  EggToBam prog;
513  prog.parse_command_line(argc, argv);
514  prog.run();
515  return 0;
516 }
CPTA_uchar get_ram_image()
Returns the system-RAM image data associated with the texture.
Definition: texture.I:1608
The principle public interface to reading and writing Bam disk files.
Definition: bamFile.h:45
static const FrameBufferProperties & get_default()
Returns a FrameBufferProperties structure with all of the default values filled in according to the u...
string get_fullpath() const
Returns the entire filename: directory, basename, extension.
Definition: filename.I:398
void set_extension(const string &s)
Replaces the file extension.
Definition: filename.cxx:837
bool write_object(const TypedWritable *object)
Writes the indicated object to the Bam file.
Definition: bamFile.cxx:258
bool make_dir() const
Creates all the directories in the path to the file specified in the filename, except for the basenam...
Definition: filename.cxx:2730
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
void set_loaded_from_txo()
Sets the flag that indicates the texture has been loaded from a txo file.
Definition: texture.I:2494
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
PandaNode * get_child(int n) const
Returns the nth child of the node.
Definition: pandaNode.I:1174
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:75
void open_windows()
Fully opens (or closes) any windows that have recently been requested open or closed, without rendering any frames.
void clear_alpha_fullpath()
Removes the alpha fullpath, if it was previously set.
Definition: texture.I:2366
int get_num_on_stages() const
Returns the number of stages that are turned on by the attribute.
Definition: textureAttrib.I:91
void set_size(const LVector2i &size)
Specifies the requested size of the window, in pixels.
bool compress_ram_image(CompressionMode compression=CM_on, QualityLevel quality_level=QL_default, GraphicsStateGuardianBase *gsg=NULL)
Attempts to compress the texture&#39;s RAM image internally, to a format supported by the indicated GSG...
Definition: texture.I:1762
TextureStage * get_on_stage(int n) const
Returns the nth stage turned on by the attribute, sorted in render order.
bool uses_mipmaps() const
Returns true if the minfilter settings on this texture indicate the use of mipmapping, false otherwise.
Definition: texture.I:1319
void set_fullpath(const Filename &fullpath)
Sets the full pathname to the file that contains the image&#39;s contents, as found along the search path...
Definition: texture.I:2327
int get_num_ram_mipmap_images() const
Returns the maximum number of mipmap level images available in system memory.
Definition: texture.I:1806
Filename get_output_filename() const
If has_output_filename() returns true, this is the filename that the user specified.
bool is_valid() const
Returns true if the output is fully created and ready for rendering, false otherwise.
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
Definition: textureAttrib.h:34
bool has_output_filename() const
Returns true if the user specified an output filename, false otherwise (e.g.
void set_undecorated(bool undecorated)
Specifies whether the window should be created with a visible title and border (false, the default) or not (true).
A container for the various kinds of properties we might ask to have on a graphics window before we o...
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
int get_num_children() const
Returns the number of children of the node.
Definition: pandaNode.I:1163
void set_z_order(ZOrder z_order)
Specifies the relative ordering of the window with respect to other windows.
This maintains a list of GraphicsPipes by type that are available for creation.
CompressionMode get_ram_image_compression() const
Returns the compression mode in which the ram image is already stored pre-compressed.
Definition: texture.I:1624
bool extract_texture_data(Texture *tex, GraphicsStateGuardian *gsg)
Asks the indicated GraphicsStateGuardian to retrieve the texture memory image of the indicated textur...
void set_keep_ram_image(bool keep_ram_image)
Sets the flag that indicates whether this Texture is eligible to have its main RAM copy of the textur...
Definition: texture.I:1731
void clear_ram_mipmap_images()
Discards the current system-RAM image for all mipmap levels, except level 0 (the base image)...
Definition: texture.I:1997
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
GraphicsStateGuardian * get_gsg() const
Returns the GSG that is associated with this window.
Children get_children(Thread *current_thread=Thread::get_current_thread()) const
Returns an object that can be used to walk through the list of children of the node.
Definition: pandaNode.I:773
void set_origin(const LPoint2i &origin)
Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window s...
Texture * get_on_texture(TextureStage *stage) const
Returns the texture associated with the indicated stage, or NULL if no texture is associated...
static GraphicsPipeSelection * get_global_ptr()
Returns a pointer to the one global GraphicsPipeSelection object.
const RenderAttrib * get_attrib(TypeHandle type) const
Looks for a RenderAttrib of the indicated type in the state, and returns it if it is found...
Definition: renderState.I:134
This is a base class for the various different classes that represent the result of a frame of render...
void set_compression(CompressionMode compression)
Requests that this particular Texture be compressed when it is loaded into texture memory...
Definition: texture.I:1033
GraphicsOutput * make_output(GraphicsPipe *pipe, const string &name, int sort, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg=NULL, GraphicsOutput *host=NULL)
Creates a new window (or buffer) and returns it.
bool get_loaded_from_txo() const
Returns the flag that indicates the texture has been loaded from a txo file.
Definition: texture.I:2506
const RenderState * get_geom_state(int n) const
Returns the RenderState associated with the nth geom of the node.
Definition: geomNode.I:106
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
Definition: renderState.h:53
void clear_alpha_filename()
Removes the alpha filename, if it was previously set.
Definition: texture.I:2313
void generate_ram_mipmap_images()
Automatically fills in the n mipmap levels of the Texture, based on the texture&#39;s source image...
Definition: texture.I:2018
This is the general base class for a file-converter program that reads some model file format and gen...
Filename get_filename_index(int index) const
If the pattern flag is set for this Filename and the filename string actually includes a sequence of ...
Definition: filename.cxx:873
This class is the main interface to controlling the render process.
virtual bool is_geom_node() const
A simple downcast check.
Definition: pandaNode.cxx:2486
void ls() const
Lists the hierarchy at and below the referenced node.
Definition: nodePath.I:492
bool open_write(const Filename &bam_filename, bool report_errors=true)
Attempts to open the indicated file for writing.
Definition: bamFile.cxx:217
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
void set_open(bool open)
Specifies whether the window should be open.
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:37
int get_num_geoms() const
Returns the number of geoms in the node.
Definition: geomNode.I:46
void set_filename(const Filename &filename)
Sets the name of the file that contains the image&#39;s contents.
Definition: texture.I:2267
bool write(const Filename &fullpath)
Writes the texture to the named filename.
Definition: texture.I:305
const Filename & get_fullpath() const
Returns the fullpath that has been set.
Definition: texture.I:600
const Filename & get_filename() const
Returns the filename that has been set.
Definition: texture.I:549