collada.Collada¶
- class collada.Collada(filename=None, ignore=None, aux_file_loader=None, zip_filename=None, validate_output=False)¶
This is the main class used to create and load collada documents
- __init__(filename=None, ignore=None, aux_file_loader=None, zip_filename=None, validate_output=False)¶
Load collada data from filename or file like object.
- Parameters:
filename – String containing path to filename to open or file-like object. Uncompressed .dae files are supported, as well as zip file archives. If this is set to
None
, a new collada instance is created.ignore (list) – A list of
common.DaeError
types that should be ignored when loading the collada document. Instances of these types will be added toerrors
after loading but won’t be raised. Only used if filename is notNone
.aux_file_loader (function) – Referenced files (e.g. texture images) are loaded from disk when reading from the local filesystem and from the zip archive when loading from a zip file. If these files are coming from another source (e.g. database) and/or you’re loading with StringIO, set this to a function that given a filename, returns the binary data in the file. If filename is
None
, you must set this parameter if you want to load auxiliary files.zip_filename (str) – If the file being loaded is a zip archive, you can set this parameter to indicate the file within the archive that should be loaded. If not set, a file that ends with .dae will be searched.
validate_output (bool) – If set to True, the XML written when calling
save()
will be validated against the COLLADA 1.4.1 schema. If validation fails, thecommon.DaeSaveValidationError
exception will be thrown.
Methods
__init__
([filename, ignore, ...])Load collada data from filename or file like object.
handleError
(error)ignoreErrors
(*args)Add exceptions to the mask for ignoring or clear the mask if None given.
save
()Saves the collada document back to
xmlnode
write
(fp)Writes out the collada document to a file.
Attributes
animations
A list of
collada.animation.Animation
objects.cameras
A list of
collada.camera.Camera
objects.controllers
A list of
collada.controller.Controller
objects.effects
A list of
collada.material.Effect
objects.geometries
A list of
collada.geometry.Geometry
objects.images
A list of
collada.material.CImage
objects.lights
A list of
collada.light.Light
objects.materials
A list of
collada.material.Effect
objects.nodes
A list of
collada.scene.Node
objects.scenes
A list of
collada.scene.Scene
objects.errors
List of
common.common.DaeError
objects representing errors encountered while loading collada fileassetInfo
Instance of
collada.asset.Asset
containing asset informationscene
The default scene.
xmlnode
ElementTree representation of the collada document