RenderEffects

from panda3d.core import RenderEffects
class RenderEffects

Bases:

Bases: TypedWritableReferenceCount

This represents a unique collection of RenderEffect objects that correspond to a particular renderable state.

You should not attempt to create or modify a RenderEffects object directly. Instead, call one of the make() functions to create one for you. And instead of modifying a RenderEffects object, create a new one.

Inheritance diagram

Inheritance diagram of RenderEffects

__getitem__(type: TypeHandle) RenderEffect

Returns the effect in the state with the given type.

__getitem__(n: int) RenderEffect

Returns the nth effect in the state.

__lt__(other: RenderEffects) bool
add_effect(effect: RenderEffect) RenderEffects

Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added. If there is already a RenderEffect with the same type, it is replaced.

find_effect(type: TypeHandle) int

Searches for an effect with the indicated type in the state, and returns its index if it is found, or -1 if it is not.

static get_class_type() TypeHandle
get_effect(type: TypeHandle) RenderEffect

Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not.

get_effect(n: int) RenderEffect

Returns the nth effect in the state.

get_num_effects() int

Returns the number of separate effects indicated in the state.

Deprecated: in Python, use len(effects) instead, or effects.size() in C++.

static get_num_states() int

Returns the total number of unique RenderEffects objects allocated in the world. This will go up and down during normal operations.

is_empty() bool

Returns true if the state is empty, false otherwise.

static list_states(out: ostream)

Lists all of the RenderEffects in the cache to the output stream, one per line. This can be quite a lot of output if the cache is large, so be prepared.

static make(effect: RenderEffect) RenderEffects

Returns a RenderEffects with one effect set.

static make(effect1: RenderEffect, effect2: RenderEffect) RenderEffects

Returns a RenderEffects with two effects set.

static make(effect1: RenderEffect, effect2: RenderEffect, effect3: RenderEffect) RenderEffects

Returns a RenderEffects with three effects set.

static make(effect1: RenderEffect, effect2: RenderEffect, effect3: RenderEffect, effect4: RenderEffect) RenderEffects

Returns a RenderEffects with four effects set.

static make_empty() RenderEffects

Returns a RenderEffects with no effects set.

output(out: ostream)
remove_effect(type: TypeHandle) RenderEffects

Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed.

size() int

Returns the number of separate effects indicated in the state.

static validate_states() bool

Ensures that the cache is still stored in sorted order. Returns true if so, false if there is a problem (which implies someone has modified one of the supposedly-const RenderEffects objects).

write(out: ostream, indent_level: int)