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.Sampler2Dandcollada.material.Surfaceshadingtype (str) – The type of shader to be used for this effect. Right now, we only supper the shaders listed in
shadersbumpmap (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.Mapambient – Either an RGBA-format tuple of four floats or an instance of
collada.material.Mapdiffuse – Either an RGBA-format tuple of four floats or an instance of
collada.material.Mapspecular – Either an RGBA-format tuple of four floats or an instance of
collada.material.Mapshininess – Either a single float or an instance of
collada.material.Mapreflective – Either an RGBA-format tuple of four floats or an instance of
collada.material.Mapreflectivity – Either a single float or an instance of
collada.material.Maptransparent (tuple) – Either an RGBA-format tuple of four floats or an instance of
collada.material.Maptransparency – Either a single float or an instance of
collada.material.Mapindex_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
xmlnodeAttributes
shadersSupported shader list.
supportedSupported material properties list.
xmlnodeElementTree representation of the effect
idThe string identifier for the effect
paramsA list containing elements of type
collada.material.Sampler2Dandcollada.material.SurfaceshadingtypeString with the type of the shading.
bumpmapEither the bump map of the effect of type
collada.material.Mapor None if there is none.double_sidedA boolean indicating whether or not the material should be rendered double sided
emissionEither an RGB-format tuple of three floats or an instance of
collada.material.MapambientEither an RGB-format tuple of three floats or an instance of
collada.material.MapdiffuseEither an RGB-format tuple of three floats or an instance of
collada.material.MapspecularEither an RGB-format tuple of three floats or an instance of
collada.material.MapshininessEither a single float or an instance of
collada.material.MapreflectiveEither an RGB-format tuple of three floats or an instance of
collada.material.MapreflectivityEither a single float or an instance of
collada.material.MaptransparentEither an RGB-format tuple of three floats or an instance of
collada.material.MaptransparencyEither a single float or an instance of
collada.material.Mapindex_of_refractionA single float indicating the index of refraction for perfectly refracted light
opaque_modeThe opaque mode for the effect.