Previous topic

collada.source.InputList

Next topic

collada.source.Source

This Page

collada.source.NameSource

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

Bases: collada.source.Source

Contains a source array of strings, as defined in the collada <Name_array> inside a <source>.

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

digraph inheritance7607915fbc { rankdir=LR; size="8.0, 12.0"; "InputList" [style="setlinewidth(0.5)",URL="collada.source.InputList.html#collada.source.InputList",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "IDRefSource" [style="setlinewidth(0.5)",URL="collada.source.IDRefSource.html#collada.source.IDRefSource",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "Source" -> "IDRefSource" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Source" [style="setlinewidth(0.5)",URL="collada.source.Source.html#collada.source.Source",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "DaeObject" -> "Source" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NameSource" [style="setlinewidth(0.5)",URL="#collada.source.NameSource",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "Source" -> "NameSource" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DaeObject" [style="setlinewidth(0.5)",URL="collada.common.DaeObject.html#collada.common.DaeObject",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "FloatSource" [style="setlinewidth(0.5)",URL="collada.source.FloatSource.html#collada.source.FloatSource",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10]; "Source" -> "FloatSource" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

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

Create a name 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. ('JOINT') would cause data to be reshaped as (-1, 1)
  • xmlnode – When loaded, the xmlnode it comes from.

Methods

__init__(id, data, components[, xmlnode]) Create a name source instance.
load(collada, localscope, node)
save() Saves the source back to xmlnode
id = None

The unique string identifier for the source

data = None

Numpy array with the source values. This will be shaped as (-1,N) where N = len(self.components)

components = None

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

xmlnode = None

ElementTree representation of the source.

save()

Saves the source back to xmlnode