collada.source.IDRefSource

class collada.source.IDRefSource(id, data, components, xmlnode=None)

Contains a source array of ID references, as defined in the collada <IDREF_array> inside a <source>.

If r is an instance of collada.source.IDRefSource, then len(r) is the length of the shaped source. len(r)*len(r.components) would give you the number of values in the source. r[i] is the ith item in the source array.

__init__(id, data, components, xmlnode=None)

Create an id ref source instance.

Parameters:
  • id (str) – A unique string identifier for the source

  • data (numpy.array) – Numpy array (unshaped) with the source values

  • components (tuple) – Tuple of strings describing the semantic of the data, e.g. ('MORPH_TARGET') would cause data to be reshaped as (-1, 1)

  • xmlnode – When loaded, the xmlnode it comes from.

Methods

__init__(id, data, components[, xmlnode])

Create an id ref source instance.

load(collada, localscope, node)

Load and return a class instance from an XML node.

save()

Saves the source back to xmlnode

Attributes

xmlnode

ElementTree representation of the source.

id

The unique string identifier for the source

data

Numpy array with the source values.

components

Tuple of strings describing the semantic of the data, e.g. ('MORPH_TARGET').