EggTexture

class EggTexture

Bases: EggFilenameNode, EggRenderMode, EggTransform

Defines a texture map that may be applied to geometry.

Inheritance diagram

digraph inheritancedb9d40fb59 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "EggFilenameNode" [URL="acron.egg.EggFilenameNode.html#acron.egg.EggFilenameNode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "EggNode" -> "EggFilenameNode" [arrowsize=0.75,style=""]; "EggNamedObject" [URL="acron.egg.EggNamedObject.html#acron.egg.EggNamedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "EggObject" -> "EggNamedObject" [arrowsize=0.75,style=""]; "Namable" -> "EggNamedObject" [arrowsize=0.75,style=""]; "EggNode" [URL="acron.egg.EggNode.html#acron.egg.EggNode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "EggNamedObject" -> "EggNode" [arrowsize=0.75,style=""]; "EggObject" [URL="acron.egg.EggObject.html#acron.egg.EggObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "EggObject" [arrowsize=0.75,style=""]; "EggRenderMode" [URL="acron.egg.EggRenderMode.html#acron.egg.EggRenderMode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "EggRenderMode" [arrowsize=0.75,style=""]; "EggTexture" [URL="acron.egg.EggTexture.html#acron.egg.EggTexture",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "EggFilenameNode" -> "EggTexture" [arrowsize=0.75,style=""]; "EggRenderMode" -> "EggTexture" [arrowsize=0.75,style=""]; "EggTransform" -> "EggTexture" [arrowsize=0.75,style=""]; "EggTransform" [URL="acron.egg.EggTransform.html#acron.egg.EggTransform",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "EggTransform" [arrowsize=0.75,style=""]; "Namable" [URL="acron.core.Namable.html#acron.core.Namable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "Namable" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
enum CombineChannel
enumerator CC_rgb = 0
enumerator CC_alpha = 1
enumerator CC_num_channels = 2
enum CombineIndex
enumerator CI_num_indices = 3
enum CombineMode
enumerator CM_unspecified = 0
enumerator CM_replace = 1
enumerator CM_modulate = 2
enumerator CM_add = 3
enumerator CM_add_signed = 4
enumerator CM_interpolate = 5
enumerator CM_subtract = 6
enumerator CM_dot3_rgb = 7
enumerator CM_dot3_rgba = 8
enum CombineOperand
enumerator CO_unspecified = 0
enumerator CO_src_color = 1
enumerator CO_one_minus_src_color = 2
enumerator CO_src_alpha = 3
enumerator CO_one_minus_src_alpha = 4
enum CombineSource
enumerator CS_unspecified = 0
enumerator CS_texture = 1
enumerator CS_constant = 2
enumerator CS_primary_color = 3
enumerator CS_previous = 4
enumerator CS_constant_color_scale = 5
enumerator CS_last_saved_result = 6
enum CompressionMode
enumerator CM_default = 0
enumerator CM_off = 1
enumerator CM_on = 2
enumerator CM_fxt1 = 3
enumerator CM_dxt1 = 4
enumerator CM_dxt2 = 5
enumerator CM_dxt3 = 6
enumerator CM_dxt4 = 7
enumerator CM_dxt5 = 8
enum EnvType
enumerator ET_unspecified = 0
enumerator ET_modulate = 1
enumerator ET_decal = 2
enumerator ET_blend = 3
enumerator ET_replace = 4
enumerator ET_add = 5
enumerator ET_blend_color_scale = 6
enumerator ET_modulate_glow = 7
enumerator ET_modulate_gloss = 8
enumerator ET_normal = 9
enumerator ET_normal_height = 10
enumerator ET_glow = 11
enumerator ET_gloss = 12
enumerator ET_height = 13
enumerator ET_metallic_roughness = 14
enumerator ET_normal_gloss = 15
enumerator ET_emission = 16
enumerator ET_occlusion = 17
enumerator ET_occlusion_metallic_roughness = 18
enumerator ET_selector = 14
enum Equivalence
enumerator E_basename = 1
enumerator E_extension = 2
enumerator E_dirname = 4
enumerator E_complete_filename = 7
enumerator E_transform = 8
enumerator E_attributes = 16
enumerator E_tref_name = 32
enum FilterType
enumerator FT_unspecified = 0

Note that these type values match up, name-for-name, with a similar enumerated type in Acron’s Texture object. However, they do not match up numerically. You must convert between them using a switch statement.

enumerator FT_nearest = 1

Mag Filter and Min Filter

enumerator FT_linear = 2
enumerator FT_nearest_mipmap_nearest = 3

“mipmap point”

enumerator FT_linear_mipmap_nearest = 4

“mipmap linear”

enumerator FT_nearest_mipmap_linear = 5

“mipmap bilinear”

enumerator FT_linear_mipmap_linear = 6

“mipmap trilinear”

enum Format
enumerator F_unspecified = 0
enumerator F_rgba = 1
enumerator F_rgbm = 2
enumerator F_rgba12 = 3
enumerator F_rgba8 = 4
enumerator F_rgba4 = 5
enumerator F_rgba5 = 6
enumerator F_rgb = 7
enumerator F_rgb12 = 8
enumerator F_rgb8 = 9
enumerator F_rgb5 = 10
enumerator F_rgb332 = 11
enumerator F_red = 12
enumerator F_green = 13
enumerator F_blue = 14
enumerator F_alpha = 15
enumerator F_luminance = 16
enumerator F_luminance_alpha = 17
enumerator F_luminance_alphamask = 18
enumerator F_srgb = 19

Only for compatibility with .bam, use is discouraged!

enumerator F_srgb_alpha = 20

Only for compatibility with .bam, use is discouraged!

enumerator F_sluminance = 21
enumerator F_sluminance_alpha = 22
enum QualityLevel
enumerator QL_unspecified = 0
enumerator QL_default = 1
enumerator QL_fastest = 2
enumerator QL_normal = 3
enumerator QL_best = 4
enum TexGen
enumerator TG_unspecified = 0
enumerator TG_eye_sphere_map = 1
enumerator TG_world_cube_map = 2
enumerator TG_eye_cube_map = 3
enumerator TG_world_normal = 4
enumerator TG_eye_normal = 5
enumerator TG_world_position = 6
enumerator TG_eye_position = 7
enumerator TG_point_sprite = 8
enum TextureType
enumerator TT_unspecified = 0
enumerator TT_1d_texture = 1
enumerator TT_2d_texture = 2
enumerator TT_3d_texture = 3
enumerator TT_cube_map = 4
enum WrapMode
enumerator WM_unspecified = 0
enumerator WM_clamp = 1
enumerator WM_repeat = 2
enumerator WM_mirror = 3
enumerator WM_mirror_once = 4
enumerator WM_border_color = 5
EggTexture.__init__()
EggTexture.affects_polygon_alpha()

Returns true if this texture’s environment type or combine mode allows the texture to have an effect on the polygon’s alpha values, false otherwise.

EggTexture.assign()
EggTexture.clear_alpha_file_channel()

Removes the specification of a particular channel to use from the alpha- file image.

EggTexture.clear_alpha_filename()
EggTexture.clear_alpha_scale()

Removes the alpha_scale from the texture and restores it to the default value of 1.

EggTexture.clear_anisotropic_degree()

Removes the specification of anisotropic filtering from the texture.

EggTexture.clear_border_color()
EggTexture.clear_color()
EggTexture.clear_lod_bias()

Removes the specification of a maximum mipmap level from the texture.

EggTexture.clear_max_lod()

Removes the specification of a maximum mipmap level from the texture.

EggTexture.clear_min_lod()

Removes the specification of a minimum mipmap level from the texture.

EggTexture.clear_multitexture()

Resets the multitexture flags set by multitexture_over(). After this call, get_multitexture() will return false, and get_multitexture_sort() will return 0.

EggTexture.clear_num_views()

Removes the specification of the number of views for a 3-D multiview texture.

EggTexture.clear_priority()

Removes the specification of multitexture priority from the texture. The default priority value is 0.

EggTexture.clear_rgb_scale()

Removes the rgb_scale from the texture and restores it to the default value of 1.

EggTexture.clear_stage_name()

Removes the named TextureStage specification.

EggTexture.clear_uv_name()

Removes the restriction to a particular named set of texture coordinates and restores the texture to using the default texture coordinates.

EggTexture.determine_wrap_u()

Determines the appropriate wrap in the U direction. This is different from get_wrap_u() in that if the U wrap is unspecified, it returns the overall wrap value.

EggTexture.determine_wrap_v()

Determines the appropriate wrap in the V direction. This is different from get_wrap_v() in that if the V wrap is unspecified, it returns the overall wrap value.

EggTexture.determine_wrap_w()

Determines the appropriate wrap in the W direction. This is different from get_wrap_w() in that if the W wrap is unspecified, it returns the overall wrap value.

EggTexture.get_alpha_file_channel()

Returns the particular channel that has been specified for the alpha-file image, or 0 if no channel has been specified. See set_alpha_file_channel().

EggTexture.get_alpha_filename()

Returns the separate file assigned for the alpha channel. It is an error to call this unless has_alpha_filename() returns true. See set_alpha_filename().

EggTexture.get_alpha_fullpath()

Returns the full pathname to the alpha file, if it is known; otherwise, returns the same thing as get_alpha_filename().

This function simply returns whatever was set by the last call to set_alpha_fullpath(). This string is not written to the egg file; its main purpose is to record the full path to the alpha filename if it is known, for egg structures that are generated in-memory and then immediately converted to a scene graph.

EggTexture.get_alpha_scale()

Returns the alpha_scale value that has been specified for the texture, or 1 if no alpha_scale value has been specified.

EggTexture.get_anisotropic_degree()

Returns the anisotropic filtering degree that has been specified for this texture, or 0 if nothing has been specified.

EggTexture.get_border_color()

Returns the border color if one has been specified, or (0, 0, 0, 1) otherwise.

static EggTexture.get_class_type()
EggTexture.get_color()

Returns the blend color if one has been specified, or (0, 0, 0, 1) otherwise.

EggTexture.get_combine_mode()
EggTexture.get_combine_operand()
EggTexture.get_combine_source()
EggTexture.get_compression_mode()
EggTexture.get_env_type()
EggTexture.get_format()
EggTexture.get_lod_bias()

Returns the maximum mipmap level that has been specified for this texture.

EggTexture.get_magfilter()
EggTexture.get_max_lod()

Returns the maximum mipmap level that has been specified for this texture.

EggTexture.get_min_lod()

Returns the minimum mipmap level that has been specified for this texture.

EggTexture.get_minfilter()
EggTexture.get_multitexture_sort()

Returns an integer that represents the depth to which this texture is layered on all other textures in the egg file. In general, if texture A is layered over texture B, then sort(A) > sort(B). If texture A is never layered over any other texture, then sort(A) == 0. More than that is difficult to guarantee.

EggTexture.get_multiview()

Returns the current setting of the multiview flag. See set_multiview().

EggTexture.get_num_views()

Returns the specified number of views specified for the 3-D multiview texture. See set_num_views().

EggTexture.get_priority()

Returns the multitexture importance value that has been specified for the texture, or 0 if no priority value has been specified.

EggTexture.get_quality_level()
EggTexture.get_read_mipmaps()

Returns the current setting of the read_mipmaps flag. See set_read_mipmaps().

EggTexture.get_rgb_scale()

Returns the rgb_scale value that has been specified for the texture, or 1 if no rgb_scale value has been specified.

EggTexture.get_saved_result()

Returns the current setting of the saved_result flag. See set_saved_result().

EggTexture.get_stage_name()

Returns the stage name that has been specified for this texture, or the tref name if no texture stage has explicitly been specified.

EggTexture.get_tex_gen()
EggTexture.get_texture_type()
EggTexture.get_uv_name()

Returns the texcoord name that has been specified for this texture, or the empty string if no texcoord name has explicitly been specified.

EggTexture.get_wrap_mode()
EggTexture.get_wrap_u()

Returns the amount specified for U wrap. This may be unspecified, even if there is an overall wrap value.

EggTexture.get_wrap_v()

Returns the amount specified for V wrap. This may be unspecified, even if there is an overall wrap value.

EggTexture.get_wrap_w()

Returns the amount specified for W wrap. This may be unspecified, even if there is an overall wrap value.

EggTexture.has_alpha_channel()

Given the number of color components (channels) in the image file as actually read from the disk, return true if this texture seems to have an alpha channel or not. This depends on the EggTexture’s format as well as the number of channels.

EggTexture.has_alpha_file_channel()

Returns true if a particular channel has been specified for the alpha-file image, false otherwise.

EggTexture.has_alpha_filename()

Returns true if a separate file for the alpha component has been applied, false otherwise. See set_alpha_filename().

EggTexture.has_alpha_scale()

Returns true if an alpha_scale has been specified for the texture, false otherwise.

EggTexture.has_anisotropic_degree()

Returns true if a value for the anisotropic filtering degree has been specified for this texture, false otherwise.

EggTexture.has_border_color()

Returns true if a border color has been specified for the texture.

EggTexture.has_color()

Returns true if a blend color has been specified for the texture.

EggTexture.has_lod_bias()

Returns true if a value for the maximum mipmap level has been specified for this texture, false otherwise.

EggTexture.has_max_lod()

Returns true if a value for the maximum mipmap level has been specified for this texture, false otherwise.

EggTexture.has_min_lod()

Returns true if a value for the minimum mipmap level has been specified for this texture, false otherwise.

EggTexture.has_num_views()

Returns true if the number of views has been specified for the 3-D multiview texture, false otherwise.

EggTexture.has_priority()

Returns true if a priority value for multitexture importance has been specified for the texture, false otherwise.

EggTexture.has_rgb_scale()

Returns true if an rgb_scale has been specified for the texture, false otherwise.

EggTexture.has_stage_name()

Returns true if a stage name has been explicitly specified for this texture, false otherwise.

EggTexture.has_uv_name()

Returns true if a texcoord name has been explicitly specified for this texture, false otherwise.

EggTexture.is_equivalent_to()

Returns true if the two textures are equivalent in all relevant properties (according to eq), false otherwise.

The Equivalence parameter, eq, should be set to the bitwise OR of the following properties, according to what you consider relevant:

EggTexture::E_basename: The basename part of the texture filename, without the directory prefix or the filename extension.

EggTexture::E_extension: The extension part of the texture filename.

EggTexture::E_dirname: The directory prefix of the texture filename.

EggTexture::E_complete_filename: The union of the above three; that is, the complete filename, with directory, basename, and extension.

EggTexture::E_transform: The texture matrix.

EggTexture::E_attributes: All remaining texture attributes (mode, mipmap, etc.) except TRef name.

EggTexture::E_tref_name: The TRef name.

EggTexture.multitexture_over()

Indicates that this texture should be layered on top of the other texture. This will guarantee that this->get_multitexture_sort() > other->get_multitexture_sort(), at least until clear_multitexture() is called on either one.

The return value is true if successful, or false if there is a failure because the other texture was already layered on top of this one (or there is a three- or more-way cycle).

EggTexture.set_alpha_file_channel()

If a separate alpha-file is specified, this indicates which channel number should be extracted from this file to derive the alpha channel for the final image. The default is 0, which means the grayscale combination of r, g, b. Otherwise, this should be the 1-based channel number, for instance 1, 2, or 3 for r, g, or b, respectively, or 4 for the alpha channel of a four-component image.

EggTexture.set_alpha_filename()

Specifies a separate file that will be loaded in with the 1- or 3-component texture and applied as the alpha channel. This is useful when loading textures from file formats that do not support alpha, for instance jpg.

EggTexture.set_alpha_fullpath()

Records the full pathname to the file, for the benefit of get_alpha_fullpath().

EggTexture.set_alpha_scale()

Sets an additional factor that will scale the alpha component after the texture has been applied. This is used only when a combine mode is in effect.

The only legal values are 1, 2, or 4.

EggTexture.set_anisotropic_degree()

Sets the degree of anisotropic filtering for this texture. 1 is off; higher levels indicate filtering in effect.

EggTexture.set_border_color()
EggTexture.set_color()
EggTexture.set_combine_mode()
EggTexture.set_combine_operand()
EggTexture.set_combine_source()
EggTexture.set_compression_mode()
EggTexture.set_env_type()
EggTexture.set_format()
EggTexture.set_lod_bias()

Sets the mipmap level bias that is added to the mipmap level to be sampled.

EggTexture.set_magfilter()
EggTexture.set_max_lod()

Sets the maximum mipmap level that may be sampled.

EggTexture.set_min_lod()

Sets the minimum mipmap level that may be sampled.

EggTexture.set_minfilter()
EggTexture.set_multiview()

Sets the multiview flag.

If multiview is true, the filename should contain a hash mark (‘#’), which will be filled in with the view number; and a multiview texture will be defined with a series of images, one for each view.

A multiview texture is most often used for stereo textures, but other uses are also possible, such as for texture animation.

EggTexture.set_num_views()

When loading a 3-D multiview texture, this parameter is necessary to specify how many views will be expected. The z size is determined implicitly from the number of images loaded.

EggTexture.set_priority()

Sets the importance of this texture with respect to other textures also applied on the same geometry. This is only meaningful in the presence of multitexturing.

EggTexture.set_quality_level()
EggTexture.set_read_mipmaps()

Sets the read_mipmaps flag.

If read_mipmaps is true, the filename should contain a hash mark (‘#’), which will be filled in with the mipmap level number; and the texture will be defined with a series of images, one for each mipmap level.

If the filename is of a type that already requires a hash mark, such as a cube map or a 3-d texture, then the filename should now require two hash marks, and the first one indicates the mipmap level number, while the second indicates the face number or 3-d level number.

EggTexture.set_rgb_scale()

Sets an additional factor that will scale all three r, g, b components after the texture has been applied. This is used only when a combine mode is in effect.

The only legal values are 1, 2, or 4.

EggTexture.set_saved_result()

Sets the saved_result flag. When this is true, the output of this stage is not part of the normal pipeline–that is, it will not be supplied as the “previous” source for the next texture stage–but it will instead be supplied as the “last_saved_result” source for any future stages, until the next TextureStage with a saved_result set true is encountered.

This can be used to reuse the results of this texture stage as input to more than one stage later in the pipeline.

The last texture in the pipeline (the one with the highest sort value) should not have this flag set.

EggTexture.set_stage_name()

Specifies the particular TextureStage this texture will be rendered on by name. If this is omitted, the texture will be rendered on the default TextureStage, unless some other stage-specific property is specificied, in which case the texture will be rendered on a TextureStage with the same name as the tref. This is in support of multitexturing.

Each different TextureStage in the world must be uniquely named.

EggTexture.set_tex_gen()
EggTexture.set_texture_type()
EggTexture.set_uv_name()

Specifies the named set of texture coordinates that this texture will use when it is applied to geometry. Geometry may have multiple sets of texture coordinates defined, by name.

If this is not specified for a particular texture, the default set of texture coordinates will be used.

EggTexture.set_wrap_mode()
EggTexture.set_wrap_u()
EggTexture.set_wrap_v()
EggTexture.set_wrap_w()
EggTexture.sorts_less_than()

An ordering operator to compare two textures for sorting order. This imposes an arbitrary ordering useful to identify unique textures, according to the indicated Equivalence factor. See is_equivalent_to().

static EggTexture.string_combine_mode()

Returns the CombineMode value associated with the given string representation, or CM_unspecified if the string does not match any known CombineMode value.

static EggTexture.string_combine_operand()

Returns the CombineOperand value associated with the given string representation, or CO_unspecified if the string does not match any known CombineOperand value.

static EggTexture.string_combine_source()

Returns the CombineSource value associated with the given string representation, or CS_unspecified if the string does not match any known CombineSource value.

static EggTexture.string_compression_mode()

Returns the CompressionMode value associated with the given string representation, or CM_default if the string does not match any known CompressionMode value.

static EggTexture.string_env_type()

Returns the EnvType value associated with the given string representation, or ET_unspecified if the string does not match any known EnvType value.

static EggTexture.string_filter_type()

Returns the FilterType value associated with the given string representation, or FT_unspecified if the string does not match any known FilterType value.

static EggTexture.string_format()

Returns the Format value associated with the given string representation, or F_unspecified if the string does not match any known Format value.

static EggTexture.string_quality_level()

Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value.

static EggTexture.string_tex_gen()

Returns the TexGen value associated with the given string representation, or ET_unspecified if the string does not match any known TexGen value.

static EggTexture.string_texture_type()

Returns the Texture_ype value associated with the given string representation, or TT_unspecified if the string does not match any known TextureType value.

static EggTexture.string_wrap_mode()

Returns the WrapMode value associated with the given string representation, or WM_unspecified if the string does not match any known WrapMode value.

EggTexture.write()

Writes the texture definition to the indicated output stream in Egg format.