EggData
from panda3d.egg import EggData
- class EggData
Bases:
EggGroupNode
This is the primary interface into all the egg data, and the root of the egg file structure. An EggData structure corresponds exactly with an egg file on the disk.
The EggData class inherits from EggGroupNode its collection of children, which are accessed by using the EggData itself as an STL container with begin() and end() calls. The children of the EggData class are the toplevel nodes in the egg file.
Inheritance diagram
- __init__(*args, **kwargs)
- auto_resolve_externals
- collapseEquivalentMaterials()
C++ Interface: collapse_equivalent_materials(const EggData self)
- /**
Removes duplicate references to the same material with the same properties.
Considers two material references with identical properties, but different
mref names, to be equivalent, and collapses them, choosing one mref name to
keep arbitrarily. Returns the number of materials removed.
*/
- collapseEquivalentTextures()
C++ Interface: collapse_equivalent_textures(const EggData self)
- /**
Removes duplicate references to the same texture image with the same
properties. Considers two texture references with identical properties,
but different tref names, to be equivalent, and collapses them, choosing
one tref name to keep arbitrarily. Returns the number of textures removed.
*/
- collapse_equivalent_materials()
C++ Interface: collapse_equivalent_materials(const EggData self)
- /**
Removes duplicate references to the same material with the same properties.
Considers two material references with identical properties, but different
mref names, to be equivalent, and collapses them, choosing one mref name to
keep arbitrarily. Returns the number of materials removed.
*/
- collapse_equivalent_textures()
C++ Interface: collapse_equivalent_textures(const EggData self)
- /**
Removes duplicate references to the same texture image with the same
properties. Considers two texture references with identical properties,
but different tref names, to be equivalent, and collapses them, choosing
one tref name to keep arbitrarily. Returns the number of textures removed.
*/
- coordinate_system
- egg_filename
- egg_timestamp
- getAutoResolveExternals()
C++ Interface: get_auto_resolve_externals(EggData self)
- /**
Indicates whether the EggData object will automatically resolve any
external references when read() is called. The default is false.
*/
- getClassType()
C++ Interface: get_class_type()
- getCoordinateSystem()
C++ Interface: get_coordinate_system(EggData self)
- /**
Returns the coordinate system in which the egg file is defined.
*/
- getEggFilename()
C++ Interface: get_egg_filename(EggData self)
- /**
Returns the directory in which the egg file is considered to reside.
*/
- getEggTimestamp()
C++ Interface: get_egg_timestamp(EggData self)
- /**
Returns the timestamp of the egg file on disk, at the time it was opened
for reading, or 0 if this information is not available.
*/
- get_auto_resolve_externals()
C++ Interface: get_auto_resolve_externals(EggData self)
- /**
Indicates whether the EggData object will automatically resolve any
external references when read() is called. The default is false.
*/
- get_class_type()
C++ Interface: get_class_type()
- get_coordinate_system()
C++ Interface: get_coordinate_system(EggData self)
- /**
Returns the coordinate system in which the egg file is defined.
*/
- get_egg_filename()
C++ Interface: get_egg_filename(EggData self)
- /**
Returns the directory in which the egg file is considered to reside.
*/
- get_egg_timestamp()
C++ Interface: get_egg_timestamp(EggData self)
- /**
Returns the timestamp of the egg file on disk, at the time it was opened
for reading, or 0 if this information is not available.
*/
- loadExternals()
C++ Interface: load_externals(const EggData self) load_externals(const EggData self, const DSearchPath searchpath) load_externals(const EggData self, const DSearchPath searchpath, BamCacheRecord record)
- /**
Loads up all the egg files referenced by <File> entries within the egg
structure, and inserts their contents in place of the <File> entries.
Searches for files in the searchpath, if not found directly, and writes
error messages to the indicated output stream. Returns true if all
externals were loaded successfully, false otherwise.
*/
- /**
Loads up all the egg files referenced by <File> entries within the egg
structure, and inserts their contents in place of the <File> entries.
Searches for files in the searchpath, if not found directly, and writes
error messages to the indicated output stream. Returns true if all
externals were loaded successfully, false otherwise.
*/
- load_externals()
C++ Interface: load_externals(const EggData self) load_externals(const EggData self, const DSearchPath searchpath) load_externals(const EggData self, const DSearchPath searchpath, BamCacheRecord record)
- /**
Loads up all the egg files referenced by <File> entries within the egg
structure, and inserts their contents in place of the <File> entries.
Searches for files in the searchpath, if not found directly, and writes
error messages to the indicated output stream. Returns true if all
externals were loaded successfully, false otherwise.
*/
- /**
Loads up all the egg files referenced by <File> entries within the egg
structure, and inserts their contents in place of the <File> entries.
Searches for files in the searchpath, if not found directly, and writes
error messages to the indicated output stream. Returns true if all
externals were loaded successfully, false otherwise.
*/
- merge()
C++ Interface: merge(const EggData self, EggData other)
- /**
Appends the other egg structure to the end of this one. The other egg
structure is invalidated.
*/
- originalHadAbsolutePathnames()
C++ Interface: original_had_absolute_pathnames(EggData self)
- /**
Returns true if the data processed in the last call to read() contained
absolute pathnames, or false if those pathnames were all relative.
This method is necessary because if auto_resolve_externals() is in effect,
it may modify the pathnames to be absolute whether or not they were as
loaded from disk. This method can be used to query the state of the
original egg file from disk.
*/
- original_had_absolute_pathnames()
C++ Interface: original_had_absolute_pathnames(EggData self)
- /**
Returns true if the data processed in the last call to read() contained
absolute pathnames, or false if those pathnames were all relative.
This method is necessary because if auto_resolve_externals() is in effect,
it may modify the pathnames to be absolute whether or not they were as
loaded from disk. This method can be used to query the state of the
original egg file from disk.
*/
- read()
C++ Interface: read(const EggData self, Filename filename, str display_name) read(const EggData self, istream in)
- /**
Opens the indicated filename and reads the egg data contents from it.
Returns true if the file was successfully opened and read, false if there
were some errors, in which case the data may be partially read.
error is the output stream to which to write error messages.
*/
- /**
Parses the egg syntax contained in the indicated input stream. Returns
true if the stream was a completely valid egg file, false if there were
some errors, in which case the data may be partially read.
Before you call this routine, you should probably call set_egg_filename()
to set the name of the egg file we’re processing, if at all possible. If
there is no such filename, you may set it to the empty string.
*/
- recomputePolygonNormals()
C++ Interface: recompute_polygon_normals(const EggData self)
- /**
Recomputes all the polygon normals for polygon geometry at this group node
and below so that they accurately reflect the vertex positions. Normals
are removed from the vertices and defined only on polygons, giving the
geometry a faceted appearance.
This function also removes degenerate polygons that do not have enough
vertices to define a normal. It does not affect normals for other kinds of
primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the normals removed. Thus, it is a good idea
to call remove_unused_vertices() after calling this.
*/
- recomputeVertexNormals()
C++ Interface: recompute_vertex_normals(const EggData self, double threshold)
- /**
Recomputes all the vertex normals for polygon geometry at this group node
and below so that they accurately reflect the vertex positions. A shared
edge between two polygons (even in different groups) is considered smooth
if the angle between the two edges is less than threshold degrees.
This function also removes degenerate polygons that do not have enough
vertices to define a normal. It does not affect normals for other kinds of
primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the correct normals. Thus, it is a good idea
to call remove_unused_vertices() after calling this.
*/
- recompute_polygon_normals()
C++ Interface: recompute_polygon_normals(const EggData self)
- /**
Recomputes all the polygon normals for polygon geometry at this group node
and below so that they accurately reflect the vertex positions. Normals
are removed from the vertices and defined only on polygons, giving the
geometry a faceted appearance.
This function also removes degenerate polygons that do not have enough
vertices to define a normal. It does not affect normals for other kinds of
primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the normals removed. Thus, it is a good idea
to call remove_unused_vertices() after calling this.
*/
- recompute_vertex_normals()
C++ Interface: recompute_vertex_normals(const EggData self, double threshold)
- /**
Recomputes all the vertex normals for polygon geometry at this group node
and below so that they accurately reflect the vertex positions. A shared
edge between two polygons (even in different groups) is considered smooth
if the angle between the two edges is less than threshold degrees.
This function also removes degenerate polygons that do not have enough
vertices to define a normal. It does not affect normals for other kinds of
primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the correct normals. Thus, it is a good idea
to call remove_unused_vertices() after calling this.
*/
- resolveEggFilename()
C++ Interface: resolve_egg_filename(Filename egg_filename, const DSearchPath searchpath)
- /**
Looks for the indicated filename, first along the indicated searchpath, and
then along the model_path. If found, updates the filename to the full path
and returns true; otherwise, returns false.
*/
- resolve_egg_filename()
C++ Interface: resolve_egg_filename(Filename egg_filename, const DSearchPath searchpath)
- /**
Looks for the indicated filename, first along the indicated searchpath, and
then along the model_path. If found, updates the filename to the full path
and returns true; otherwise, returns false.
*/
- setAutoResolveExternals()
C++ Interface: set_auto_resolve_externals(const EggData self, bool resolve)
- /**
Indicates whether the EggData object will automatically resolve any
external references when read() is called. The default is false.
*/
- setCoordinateSystem()
C++ Interface: set_coordinate_system(const EggData self, int coordsys)
- /**
Changes the coordinate system of the EggData. If the coordinate system was
previously different, this may result in a conversion of the data.
*/
- setEggFilename()
C++ Interface: set_egg_filename(const EggData self, const Filename egg_filename)
- /**
Sets the filename–especially the directory part–in which the egg file is
considered to reside. This is also implicitly set by read().
*/
- setEggTimestamp()
C++ Interface: set_egg_timestamp(const EggData self, int egg_timestamp)
- /**
Sets the timestamp of the egg file on disk, at the time it was opened for
reading. This is also implicitly set by read().
*/
- set_auto_resolve_externals()
C++ Interface: set_auto_resolve_externals(const EggData self, bool resolve)
- /**
Indicates whether the EggData object will automatically resolve any
external references when read() is called. The default is false.
*/
- set_coordinate_system()
C++ Interface: set_coordinate_system(const EggData self, int coordsys)
- /**
Changes the coordinate system of the EggData. If the coordinate system was
previously different, this may result in a conversion of the data.
*/
- set_egg_filename()
C++ Interface: set_egg_filename(const EggData self, const Filename egg_filename)
- /**
Sets the filename–especially the directory part–in which the egg file is
considered to reside. This is also implicitly set by read().
*/
- set_egg_timestamp()
C++ Interface: set_egg_timestamp(const EggData self, int egg_timestamp)
- /**
Sets the timestamp of the egg file on disk, at the time it was opened for
reading. This is also implicitly set by read().
*/
- stripNormals()
C++ Interface: strip_normals(const EggData self)
- /**
Removes all normals from primitives, and the vertices they reference, at
this node and below.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the normal removed. Thus, it is a good idea to
call remove_unused_vertices() after calling this.
*/
- strip_normals()
C++ Interface: strip_normals(const EggData self)
- /**
Removes all normals from primitives, and the vertices they reference, at
this node and below.
This function does not remove or adjust vertices in the vertex pool; it
only adds new vertices with the normal removed. Thus, it is a good idea to
call remove_unused_vertices() after calling this.
*/
- writeEgg()
C++ Interface: write_egg(const EggData self, Filename filename) write_egg(const EggData self, ostream out)