Registry / serialization / pycollada

pycollada

JSON →
library0.9.3pypypi✓ verified 26d ago

pycollada is a Python library for reading, writing, and creating COLLADA (COLLAborative Design Activity) documents, an interchange file format for interactive 3D applications. It allows users to load a COLLADA file and interact with it as a Python object, supporting creation from scratch and in-place editing. The current version is 0.9.3, released on January 24, 2026, with a fairly active release cadence addressing compatibility and performance improvements.

pip install pycollada
INSTALL
IMPORT
SIG · PYCOLLADA
P
pycollada
serializationpythonv0.9.3
Install
3.8s avg
Import
371ms
Disk
92MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.9.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.374s · 91.5MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.368s · 88MB
92MB installed
● package 92MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Collada
✓ from collada import Collada
✗ import collada
The primary class for interacting with COLLADA documents is `Collada`, typically imported directly.
*
✓ from collada import *
Common for quick access to all pycollada components in small scripts or interactive sessions.

This quickstart demonstrates how to create a simple COLLADA document containing a single red triangle and then save it. It also shows how to load an existing COLLADA file and access its basic properties. Requires numpy to be installed.

import os from collada import Collada, material, geometry, source import numpy as np # 1. Create a new COLLADA document mesh = Collada() # 2. Define geometry: a simple triangle # Vertices verts = np.array([ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0 ]) normals = np.array([ 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0 ]) vert_src = source.FloatSource('my_verts-positions', verts, ('X', 'Y', 'Z')) norm_src = source.FloatSource('my_normals-normals', normals, ('X', 'Y', 'Z')) # Indices for a single triangle triangles = np.array([0, 0, 1, 1, 2, 2]) # vertex index, normal index, ... geom = geometry.Geometry(mesh, 'geometry0', 'my_triangle_geometry', [geometry.Triangles(vert_src, norm_src, triangles, 'material0')]) mesh.geometries.append(geom) # 3. Create a material effect = material.Effect('effect0', [], 'phong', diffuse=(1, 0, 0, 1)) mat = material.Material('material0', 'red_material', effect) mesh.materials.append(mat) mesh.effects.append(effect) # 4. Save the COLLADA document output_file = 'my_first_collada.dae' mesh.write(output_file) print(f"Created '{output_file}'") # 5. Load an existing COLLADA document (or the one we just created) # For demonstration, we'll try to load the file we just saved. if os.path.exists(output_file): loaded_mesh = Collada(output_file) print(f"Loaded '{output_file}' with {len(loaded_mesh.geometries)} geometries.") # Example: Accessing a geometry if loaded_mesh.geometries: print(f"First geometry ID: {loaded_mesh.geometries[0].id}") else: print(f"Could not load '{output_file}'. Make sure the file exists.")
Debug
Known issues
breakingPython 3.9 support was removed in pycollada 0.9.3, as Python 3.9 reached end-of-life. Python versions prior to 3.8 were dropped in 0.8.
fix
Ensure you are using a supported Python version. For pycollada 0.9.3, Python 3.14+ is supported, and for 0.8+, Python 3.8+ (up to 3.12 for 0.8) is required. Python 3.9 is not supported by 0.9.3.
affects: 0.9.3+, 0.8+
breakingNumPy became an explicit install requirement starting from version 0.8. Prior to this, it might have been an implicit dependency or optional. Additionally, versions 0.9.2 and 0.9 included fixes for compatibility with NumPy 2.0/2.3 after `fromstring` byte deprecation.
fix
Always explicitly install `numpy` alongside `pycollada` (`pip install pycollada numpy`). If encountering issues with NumPy versions, ensure you have the latest `pycollada` (0.9.2 or newer for NumPy 2.x compatibility).
affects: 0.8+, 0.9+, 0.9.2+
gotchaLoading large COLLADA XML documents might fail without explicit `huge_tree` support enabled for the underlying `lxml` parser. This was addressed in version 0.8.
fix
Upgrade to pycollada 0.8 or newer. If you are unable to upgrade and dealing with large XML, you might need to manually configure `lxml` parsing options if pycollada exposes them, or consider pre-processing the DAE file.
affects: 0.1 - 0.7.2
gotchaWhen loading COLLADA documents, `pycollada` can raise exceptions like `DaeUnsupportedError` or `DaeBrokenRefError`. By default, these can halt loading.
fix
To ignore specific errors and attempt to continue loading, pass a list of exception types to the `ignore` parameter of the `Collada` constructor: `mesh = Collada('file.dae', ignore=[DaeUnsupportedError, DaeBrokenRefError])`. Any errors encountered will be available in `Collada.errors`.
affects: All versions
gotchaWhile pycollada 0.9.3 introduced compatibility with Python's built-in `ElementTree` API, `lxml` is still the recommended XML parser for better performance and robustness.
fix
For optimal performance and to avoid potential parsing quirks, ensure `lxml` is installed (`pip install lxml`).
affects: 0.9.3+
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pycollada'
The 'pycollada' package is not installed in the current Python environment, or the Python interpreter cannot locate it in its search path.
fix
Install the library using pip: `pip install pycollada`
collada.common.DaeUnsupportedError
The COLLADA (.dae) file being loaded contains features, elements, or specifications that the current version of pycollada does not support.
fix
When loading the COLLADA document, you can choose to ignore unsupported features: `from collada import Collada, DaeUnsupportedError, DaeBrokenRefError; mesh = Collada('file.dae', ignore=[DaeUnsupportedError, DaeBrokenRefError])`. Alternatively, ensure the .dae file conforms to a COLLADA specification version fully supported by pycollada.
xml.etree.ElementTree.ParseError
The COLLADA (.dae) file has malformed XML syntax, invalid characters, or issues like an 'unbound prefix' that prevent Python's underlying `xml.etree.ElementTree` parser (used by pycollada) from processing the document.
fix
Validate the XML syntax of the .dae file using an XML validator. If the issue is related to namespaces (e.g., 'unbound prefix'), ensure all prefixes used in the XML tags are correctly declared with a corresponding namespace URI. Manual inspection and correction of the .dae file might be necessary.
Upgrade
Version history
0.9.3latest on PyPI · released Jan 24, 2026
Audit
Dependencies
numpyrequiredUsed for numerical arrays, made an explicit install requirement since version 0.8.
lxmloptionalRecommended for XML loading, construction, and saving due to performance, though compatible with Python's built-in ElementTree API since 0.9.3.
Agent activity
10 hits · last 30 days
node
8
Resources
pycollada — pip install pycollada · libregistry