collada.material.Surface

class collada.material.Surface(id, img, format=None, xmlnode=None)

Bases: collada.common.DaeObject

Class containing data coming from a <surface> tag.

Collada materials use this to access to the <image> tag. The only extra information we store right now is the image format. In theory, this enables many more features according to the collada spec, but no one seems to actually use them in the wild, so for now, it’s unimplemented.

__init__(id, img, format=None, xmlnode=None)

Creates a surface.

Parameters:
  • id (str) – A string identifier for the surface within the local scope of the material
  • img (collada.material.CImage) – The image object
  • format (str) – The format of the image
  • xmlnode – If loaded from xml, the xml node

Methods

__init__(id, img[, format, xmlnode]) Creates a surface.
load(collada, localscope, node) Load and return a class instance from an XML node.
save() Saves the surface data back to xmlnode
id = None

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

image = None

collada.material.CImage object from the image library.

format = None

Format string.

xmlnode = None

ElementTree representation of the surface.

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 surface data back to xmlnode