Archived – Now maintained in the Netherlands3D Main Repository; OpenUPM updates suspended.
This package provides scripts that allow you to export triangle lists or Unity GameObjects containing a mesh to a Collada file using streamwriting. This can be useful for creating 3D models that can be used in other applications or for sharing with others. With the ColladaFile class, you can easily create, fill, and export a Collada file from triangles. Additionally, the GameObjectToColladaFile script can retrieve the triangles from a GameObject Mesh (or nested meshes) and export them to a Collada file.
This package is provided through OpenUPM, to install it using the CLI you can perform the following:
$ openupm add eu.netherlands3d.colladaor, you have to add https://package.openupm.com as a scoped registry with, at least, the following scopes:
eu.netherlands3d
The following example shows how to export a custom triangle (made from 3 verts)
The GameObjectToColladaFile is a script that does this by retrieving the triangles from a GameObject Mesh ( or nested meshes )
Please note that currently the exported Collada is exported as triangles without 'sharing' any vertices, causing the exported mesh to have seperated triangles.
// Create a new collada file in memory that we will construct
var collada = new ColladaFile();
// Add a mesh to the collada file by adding a list of vertices that make up the triangles
// A single vertex is defined as a double[] array
var vertexList = new List<double[]>();
vertexList.Add(new double[] { 0, 0, 0 });
vertexList.Add(new double[] { 1, 0, 0 });
vertexList.Add(new double[] { 1, 1, 0 });
collada.AddObjectTriangles(vertexList, "MyTriangle", material);
// Finish the document
collada.Finish();
// Save the collada document as a local file
collada.Save(filePath);This repository has been archived and is no longer maintained independently.
The contents of this package have been merged into the
Netherlands3D Main Repository
into the Packages folder.
The latest version and future updates of this package will be maintained inside the Netherlands3D main repository as part of an effort to simplify and unify our development workflow.
To streamline development and reduce overhead, the Netherlands3D packages are being integrated into the main repository.
This approach allows for better coordination between packages and features, while we continue to evaluate whether a full monorepo setup (including versioning) is desirable in the future.
Please open issues and pull requests in the Netherlands3D Main Repository.
Updates to this package on OpenUPM are suspended until further notice.
Future releases will be managed from the main repository once the new development flow has been finalized.
This repository remains available in read-only mode as a historical record of its standalone development.