collada.material.Map¶
-
class
collada.material.
Map
(sampler, texcoord, xmlnode=None)¶ Bases:
collada.common.DaeObject
Class containing data coming from <texture> tag inside material.
When a material defines its properties like diffuse, it can give you a color or a texture. In the latter, the texture is mapped with a sampler and a texture coordinate channel. If a material defined a texture for one of its properties, you’ll find an object of this class in the corresponding attribute.
-
__init__
(sampler, texcoord, xmlnode=None)¶ Create a map instance to a sampler using a texcoord channel.
Parameters: - sampler (collada.material.Sampler2D) – A sampler object to map
- texcoord (str) – Texture coordinate channel symbol to use
- xmlnode – If loaded from xml, the xml node
Methods
__init__
(sampler, texcoord[, xmlnode])Create a map instance to a sampler using a texcoord channel. load
(collada, localscope, node)Load and return a class instance from an XML node. save
()Saves the map back to xmlnode
-
sampler
= None¶ collada.material.Sampler2D
object to map
-
texcoord
= None¶ Texture coordinate channel symbol to use
-
xmlnode
= None¶ ElementTree representation of the map
-
static
load
(collada, localscope, node)¶ Load and return a class instance from an XML node.
Inspect the data inside node, which must match this class tag and create an instance out of it.
Parameters: - collada (collada.Collada) – The collada file object where this object lives
- localscope (dict) – If there is a local scope where we should look for local ids (sid) this is the dictionary. Otherwise empty dict ({})
- node – An Element from python’s ElementTree API
-