Previous topic

collada.material.CImage

Next topic

collada.material.Map

This Page

collada.material.Effect

class collada.material.Effect(id, params, shadingtype, bumpmap=None, double_sided=False, emission=(0.0, 0.0, 0.0), ambient=(0.0, 0.0, 0.0), diffuse=(0.0, 0.0, 0.0), specular=(0.0, 0.0, 0.0), shininess=0.0, reflective=(0.0, 0.0, 0.0), reflectivity=0.0, transparent=(0.0, 0.0, 0.0), transparency=0.0, xmlnode=None)

Bases: collada.DaeObject

Class containing data coming from an <effect> tag.

__init__(id, params, shadingtype, bumpmap=None, double_sided=False, emission=(0.0, 0.0, 0.0), ambient=(0.0, 0.0, 0.0), diffuse=(0.0, 0.0, 0.0), specular=(0.0, 0.0, 0.0), shininess=0.0, reflective=(0.0, 0.0, 0.0), reflectivity=0.0, transparent=(0.0, 0.0, 0.0), transparency=0.0, xmlnode=None)

Create an effect instance out of properties.

Parameters:
  • id (str) – A string identifier for the effect
  • params (list) – A list containing elements of type collada.material.Sampler2D and collada.material.Surface
  • shadingtype (str) – The type of shader to be used for this effect. Right now, we only supper the shaders listed in shaders
  • bumpmap (collada.material.Map) – The bump map for this effect, or None if there isn’t one
  • double_sided (bool) – Whether or not the material should be rendered double sided
  • emission – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • ambient – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • diffuse – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • specular – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • shininess – Either a single float or an instance of collada.material.Map
  • reflective – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • reflectivity – Either a single float or an instance of collada.material.Map
  • transparent (tuple) – Either an RGB-format tuple of three floats or an instance of collada.material.Map
  • transparency – Either a single float or an instance of collada.material.Map
  • xmlnode – If loaded from xml, the xml node

Methods

__init__(id, params, shadingtype, 0, 0, 0, ...) Create an effect instance out of properties.
load(collada, localscope, node)
save() Saves the effect back to xmlnode
supported

Supported material properties list.

shaders

Supported shader list.

id

The string identifier for the effect

params

A list containing elements of type collada.material.Sampler2D and collada.material.Surface

shadingtype

String with the type of the shading.

bumpmap

Either the bump map of the effect of type collada.material.Map or None if there is none.

double_sided

A boolean indicating whether or not the material should be rendered double sided

emission

Either an RGB-format tuple of three floats or an instance of collada.material.Map

ambient

Either an RGB-format tuple of three floats or an instance of collada.material.Map

diffuse

Either an RGB-format tuple of three floats or an instance of collada.material.Map

specular

Either an RGB-format tuple of three floats or an instance of collada.material.Map

shininess

Either a single float or an instance of collada.material.Map

reflective

Either an RGB-format tuple of three floats or an instance of collada.material.Map

reflectivity

Either a single float or an instance of collada.material.Map

transparent

Either an RGB-format tuple of three floats or an instance of collada.material.Map

transparency

Either a single float or an instance of collada.material.Map

xmlnode

ElementTree representation of the effect

save()

Saves the effect back to xmlnode

almostEqual(other)

Checks if this effect is almost equal (within float precision) to the given effect.

Parameters:other (collada.material.Effect) – Effect to compare to
Return type:bool