TextureCollection

from panda3d.core import TextureCollection
class TextureCollection

Manages a list of Texture objects, as returned by TexturePool.findAllTextures().

Inheritance diagram

Inheritance diagram of TextureCollection

__add__(other: TextureCollection)TextureCollection
__getitem__(index: int)Texture

Returns the nth Texture in the collection. This is the same as getTexture(), but it may be a more convenient way to access it.

__iadd__(other: TextureCollection)TextureCollection
__init__()
__init__(sequence: object)
__init__(copy: TextureCollection)
__reduce__()object
addTexture(texture: Texture)None

Adds a new Texture to the collection.

addTexturesFrom(other: TextureCollection)None

Adds all the Textures indicated in the other collection to this texture. The other textures are simply appended to the end of the textures in this list; duplicates are not automatically removed.

append(texture: Texture)None

Adds a new Texture to the collection. This method duplicates the addTexture() method; it is provided to satisfy Python’s naming convention.

assign(copy: TextureCollection)TextureCollection
clear()None

Removes all Textures from the collection.

extend(other: TextureCollection)None

Appends the other list onto the end of this one. This method duplicates the += operator; it is provided to satisfy Python’s naming convention.

findTexture(name: str)Texture

Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name.

getNumTextures()int

Returns the number of Textures in the collection.

getTexture(index: int)Texture

Returns the nth Texture in the collection.

getTextures()list
hasTexture(texture: Texture)bool

Returns true if the indicated Texture appears in this collection, false otherwise.

output(out: ostream)None

Writes a brief one-line description of the TextureCollection to the indicated output stream.

removeDuplicateTextures()None

Removes any duplicate entries of the same Textures on this collection. If a Texture appears multiple times, the first appearance is retained; subsequent appearances are removed.

removeTexture(texture: Texture)bool

Removes the indicated Texture from the collection. Returns true if the texture was removed, false if it was not a member of the collection.

removeTexturesFrom(other: TextureCollection)None

Removes from this collection all of the Textures listed in the other collection.

reserve(num: int)None

This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding.

size()int

Returns the number of textures in the collection. This is the same thing as getNumTextures().

write(out: ostream, indent_level: int)None

Writes a complete multi-line description of the TextureCollection to the indicated output stream.