collada.material.Sampler2D

class collada.material.Sampler2D(id, surface, minfilter=None, magfilter=None, xmlnode=None)

Bases: collada.common.DaeObject

Class containing data coming from <sampler2D> tag in material.

Collada uses the <sampler2D> tag to map to a <surface>. The only information we store about the sampler right now is minfilter and magfilter. Theoretically, the collada spec has many more parameters here, but no one seems to be using them in the wild, so they are currently unimplemented.

__init__(id, surface, minfilter=None, magfilter=None, xmlnode=None)

Create a Sampler2D object.

Parameters:
  • id (str) – A string identifier for the sampler within the local scope of the material
  • surface (collada.material.Surface) – Surface instance that this object samples from
  • minfilter (str) – Minification filter string id, see collada spec for details
  • magfilter (str) – Maximization filter string id, see collada spec for details
  • xmlnode – If loaded from xml, the xml node

Methods

__init__(id, surface[, minfilter, …]) Create a Sampler2D object.
load(collada, localscope, node) Load and return a class instance from an XML node.
save() Saves the sampler data back to xmlnode
id = None

The string identifier for the sampler within the local scope of the material

surface = None

Surface instance that this object samples from

minfilter = None

Minification filter string id, see collada spec for details

magfilter = None

Maximization filter string id, see collada spec for details

xmlnode = None

ElementTree representation of the sampler.

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
save()

Saves the sampler data back to xmlnode