panda3d.core.MaterialAttrib

class MaterialAttrib

Bases: RenderAttrib

Indicates which, if any, material should be applied to geometry. The material is used primarily to control lighting effects, and isn’t necessary (or useful) in the absence of lighting.

Inheritance diagram

Inheritance diagram of MaterialAttrib

static make(material: Material) → RenderAttrib

Constructs a new MaterialAttrib object suitable for rendering the indicated material onto geometry.

Return type

RenderAttrib

static makeOff() → RenderAttrib

Constructs a new MaterialAttrib object suitable for rendering unmateriald geometry.

Return type

RenderAttrib

static makeDefault() → RenderAttrib

Returns a RenderAttrib that corresponds to whatever the standard default properties for render attributes of this type ought to be.

Return type

RenderAttrib

isOff() → bool

Returns true if the MaterialAttrib is an ‘off’ MaterialAttrib, indicating that it should disable the use of materials.

getMaterial() → Material

If the MaterialAttrib is not an ‘off’ MaterialAttrib, returns the material that is associated. Otherwise, return NULL.

Return type

Material

static getClassSlot() → int
static getClassType() → TypeHandle
Return type

TypeHandle

property material

If the MaterialAttrib is not an ‘off’ MaterialAttrib, returns the material that is associated. Otherwise, return NULL.

Return type

Material

property class_slot
Return type

int