collada.material.Effect¶
- class collada.material.Effect(id, params, shadingtype, bumpmap=None, double_sided=False, emission=(0.0, 0.0, 0.0, 1.0), ambient=(0.0, 0.0, 0.0, 1.0), diffuse=(0.0, 0.0, 0.0, 1.0), specular=(0.0, 0.0, 0.0, 1.0), shininess=0.0, reflective=(0.0, 0.0, 0.0, 1.0), reflectivity=0.0, transparent=(0.0, 0.0, 0.0, 1.0), transparency=None, index_of_refraction=None, opaque_mode=None, xmlnode=None)¶
Class containing data coming from an <effect> tag.
- __init__(id, params, shadingtype, bumpmap=None, double_sided=False, emission=(0.0, 0.0, 0.0, 1.0), ambient=(0.0, 0.0, 0.0, 1.0), diffuse=(0.0, 0.0, 0.0, 1.0), specular=(0.0, 0.0, 0.0, 1.0), shininess=0.0, reflective=(0.0, 0.0, 0.0, 1.0), reflectivity=0.0, transparent=(0.0, 0.0, 0.0, 1.0), transparency=None, index_of_refraction=None, opaque_mode=None, 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
andcollada.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 RGBA-format tuple of four floats or an instance of
collada.material.Map
ambient – Either an RGBA-format tuple of four floats or an instance of
collada.material.Map
diffuse – Either an RGBA-format tuple of four floats or an instance of
collada.material.Map
specular – Either an RGBA-format tuple of four floats or an instance of
collada.material.Map
shininess – Either a single float or an instance of
collada.material.Map
reflective – Either an RGBA-format tuple of four floats or an instance of
collada.material.Map
reflectivity – Either a single float or an instance of
collada.material.Map
transparent (tuple) – Either an RGBA-format tuple of four floats or an instance of
collada.material.Map
transparency – Either a single float or an instance of
collada.material.Map
index_of_refraction (float) – A single float indicating the index of refraction for perfectly refracted light
opaque_mode (collada.material.OPAQUE_MODE) – The opaque mode for the effect. If not specified, defaults to A_ONE.
xmlnode – If loaded from xml, the xml node
Methods
__init__
(id, params, shadingtype[, bumpmap, ...])Create an effect instance out of properties.
almostEqual
(other)Checks if this effect is almost equal (within float precision) to the given effect.
getEffectParameters
(collada, parentnode, ...)load
(collada, localscope, node)Load and return a class instance from an XML node.
save
()Saves the effect back to
xmlnode
Attributes
shaders
Supported shader list.
supported
Supported material properties list.
xmlnode
ElementTree representation of the effect
id
The string identifier for the effect
params
A list containing elements of type
collada.material.Sampler2D
andcollada.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
index_of_refraction
A single float indicating the index of refraction for perfectly refracted light
opaque_mode
The opaque mode for the effect.