Package pyffi :: Package formats :: Package dae
[hide private]
[frames] | no frames]

Package dae

source code

This module is not yet fully implemented, and is certainly not yet useful in its current state.

Implementation

Regression tests

Create a DAE file

>>> daedata = DaeFormat.Data()
>>> print(daedata.collada) # doctest: +ELLIPSIS
<pyffi.formats.dae.Collada object at ...>

Read a DAE file

>>> # check and read dae file
>>> stream = open('tests/dae/cube.dae', 'rb')
>>> daedata = DaeFormat.Data()
>>> daedata.read(stream) # doctest: +ELLIPSIS
Traceback (most recent call last):
    ...
NotImplementedError
>>> # get DAE file root element
>>> #print(daedata.getRootElement())
>>> stream.close()

Parse all DAE files in a directory tree

>>> for stream, data in DaeFormat.walkData('tests/dae'):
...     try:
...         # the replace call makes the doctest also pass on windows
...         print("reading %s" % stream.name.replace("\\", "/"))
...         data.read(stream)
...     except Exception:
...         print("Warning: read failed due corrupt file, corrupt format description, or bug.")
reading tests/dae/cube.dae
Warning: read failed due corrupt file, corrupt format description, or bug.

Create a DAE file from scratch and write to file

>>> daedata = DaeFormat.Data()
>>> from tempfile import TemporaryFile
>>> stream = TemporaryFile()
>>> daedata.write(stream) # doctest: +ELLIPSIS
Traceback (most recent call last):
    ...
NotImplementedError
Classes [hide private]
  DaeFormat
This class implements the DAE format.
Variables [hide private]
  __package__ = 'pyffi.formats.dae'