panda3d.core.RenderEffects

class RenderEffects

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

addEffect(effect: RenderEffect) → RenderEffects

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

Return type

RenderEffects

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
Return type

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.

Return type

RenderEffect

getEffect(n: size_t) → RenderEffect

Returns the nth effect in the state.

Return type

RenderEffect

getNumEffects() → size_t

Returns the number of separate effects indicated in the state.

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

Return type

size_t

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.

Return type

RenderEffects

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

Returns a RenderEffects with two effects set.

Return type

RenderEffects

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

Returns a RenderEffects with three effects set.

Return type

RenderEffects

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

Returns a RenderEffects with four effects set.

Return type

RenderEffects

static makeEmpty() → RenderEffects

Returns a RenderEffects with no effects set.

Return type

RenderEffects

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.

Return type

RenderEffects

size() → size_t

Returns the number of separate effects indicated in the state.

Return type

size_t

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