# RenderEffects¶

from panda3d.core import RenderEffects

class RenderEffects

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

__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
addEffect(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.

findEffect(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 getClassType()TypeHandle
getEffect(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.

getEffect(n: int)RenderEffect

Returns the nth effect in the state.

getNumEffects()int

Returns the number of separate effects indicated in the state.

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

static getNumStates()int

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

isEmpty()bool

Returns true if the state is empty, false otherwise.

static listStates(out: ostream)None

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 makeEmpty()RenderEffects

Returns a RenderEffects with no effects set.

output(out: ostream)None
removeEffect(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 validateStates()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)None