Previous topic

collada.scene.MatrixTransform

Next topic

collada.scene.NodeNode

This Page

collada.scene.Node

class collada.scene.Node(id, sid=None, name=None, type=None, layer=None, children=None, transforms=None, extras=None, xmlnode=None)

Bases: collada.scene.SceneNode

Represents a node object, which is a point on the scene graph, as defined in the collada <node> tag.

Contains the list of transformations effecting the node as well as any children.

__init__(id, sid=None, name=None, type=None, layer=None, children=None, transforms=None, extras=None, xmlnode=None)

Create a node in the scene graph.

Parameters:
  • id (str) – A unique string identifier for the node
  • children (list) – A list of child nodes of this node. This can contain any object that inherits from collada.scene.SceneNode
  • transforms (list) – A list of transformations effecting the node. This can contain any object that inherits from collada.transform.Transform
  • xmlnode – When loaded, the xmlnode it comes from

Methods

__init__(id[, sid, name, type, layer, ...]) Create a node in the scene graph.
load(collada, node, localscope)
objects(tipo[, matrix]) Iterate through all objects under this node that match tipo.
save([recurse]) Saves the geometry back to xmlnode.
layer = None

The unique string identifier for the node

children = None

A list of child nodes of this node. This can contain any object that inherits from collada.scene.SceneNode

matrix = None

A numpy.array of size 4x4 containing a transformation matrix that combines all the transformations in transforms. This will only be updated after calling save().

xmlnode = None

ElementTree representation of the transform.

objects(tipo, matrix=None)

Iterate through all objects under this node that match tipo. The objects will be bound and transformed via the scene transformations.

Parameters:
  • tipo (str) – A string for the desired object type. This can be one of ‘geometry’, ‘camera’, ‘light’, or ‘controller’.
  • matrix (numpy.matrix) – An optional transformation matrix
Return type:

generator that yields the type specified

save(recurse=True)

Saves the geometry back to xmlnode. Also updates matrix if transforms has been modified.