xcode-collada: Fixing Collada Files for Xcode


While working on importing Mixamo and Rokoko animations into Xcode, I kept running into the same problem: Xcode refuses to load most Collada (DAE) files without manual cleanup. Rather than fixing each file by hand, I wrote a CLI tool to automate the process.

The Collada Format

Collada is an XML-based format for 3D assets. Unlike OBJ files which only store vertex data, Collada files can include both geometry and animations within a tree hierarchy. Xcode can import these files and lets you manipulate the hierarchy at runtime using SceneKit — but it is surprisingly strict about how the XML is structured.

What Goes Wrong

DAE files exported from Mixamo, Blender and other tools exhibit several issues that cause Xcode to either reject the file or silently ignore the animation data.

Fragmented Animation Tags

Exporters often create separate <animation> tags for each bone rather than wrapping all bone animations under a single <animation> element. Blender and Maya can also add an extra nesting level. Xcode expects a flat structure with one wrapping animation tag per clip.

Spaces in IDs

Some exporters include spaces in element IDs, which causes Xcode to fail with:

The document "Foo Bar.dae" could not be opened.
The document does not have a scene.

Inconsistent XML Formatting

Malformed newlines and whitespace can trip up Xcode’s parser. Running xmllint --format helps but doesn’t fix the structural issues above.

Prefixed Node Names

When round-tripping through Blender (import FBX, export DAE), bone names and IDs can pick up prefixes from the import process. These prefixes break the name matching that Xcode uses to bind animations to the skeleton.

Extra Nodes

Retargeting workflows in Blender can leave behind extra nodes in the hierarchy that Xcode doesn’t know how to handle.

The Tool

xcode-collada resolves all of the above in a single pass. Install and run it with:

yarn add xcode-collada
yarn run xcode-collada ./original.dae ./clean.dae

It parses the DAE file, restructures the animation tags, strips ID prefixes and spaces, removes extraneous nodes, and reformats the XML. The output file is ready for Xcode.

For how this fits into a full animation pipeline, see: