How eversedevelopment/revit-gltf-exporter works
1. What this repository is
- A Windows/Revit add-in ecosystem for exporting Revit model data to glTF / GLB.
- The code is split into a shared exporter core, version-specific Revit host projects for multiple Revit releases, and a separate installer.
2. Top-level architecture
- The main reusable logic lives in Common_glTF_Exporter.
- Revit_glTF_Exporter_2019 through Revit_glTF_Exporter_2026 are thin host projects that compile the add-in against different Revit API versions.
- GltfInstaller packages and installs the add-in for end users.
3. Revit integration boundary
- Revit enters the system through ExternalApplication and ExternalCommand, which are the add-in entry points.
- These host the add-in inside Revit and connect Revit’s API/context to the shared exporter logic.
- The .addin manifest and PackageContents.xml define how Revit discovers and loads the extension.
4. UI and user interaction layer
- The exporter uses WPF windows (MainWindow, ProgressBarWindow, ErrorWindow, FeedbackWindow, AboutUsWindow, VersionWindow, etc.).
- View models such as ProgressBarWindowViewModel and UnitsViewModel keep UI state separate from export logic.
- The UI appears to collect export options, units, preferences, and update/version information before triggering export.
5. Export pipeline
- The flow is: Revit selection/view context → collection/services → geometry processing → glTF assembly → file output.
- Service/RevitCollectorService and utility collectors gather model elements from the active Revit document/view.
- Core/ProcessGeometry and Core/GlTFExportContext orchestrate conversion of Revit geometry into exportable model data.
- Export/ contains the final packaging steps for JSON, buffer data, binary GLB, or compressed archives.
6. Data/model layer
- Model/ contains exporter-specific DTOs and domain objects such as Payload, Room, FixedObject, MovableObject, GlbComponents, and load/material cache types.
- This layer acts as the internal representation between Revit’s API objects and the glTF file writer.
- The presence of LoadContext, Links, and object collections suggests the exporter maintains structured state across the export session.
7. Geometry and transform handling
- Transform/ handles model-space adjustments such as scale, rotation, and translation before writing output.
- Utils/GeometryUtils and Utils/GLTFBinaryDataUtils support conversion, packing, and binary layout of mesh data.
- This boundary is important because Revit geometry and glTF coordinate/data conventions differ.
8. Materials and textures subsystem
- Materials/ maps Revit material properties into glTF-compatible material and texture structures.
- Classes like RevitMaterials, MaterialProperties, MaterialTexture, and TextureLocation indicate a dedicated pipeline for extracting, caching, and locating textures.
- This subsystem likely depends on Utils/MaterialUtils and bitmap helpers to prepare texture assets for export.
9. File output and packaging formats
- Export/ includes concrete writers for GLB, glTF JSON, BIN buffers, and ZIP packaging.
- Classes such as GltfJson, GlbFile, GlbHeaderInfo, GlbJsonInfo, GlbBinInfo, BinFile, and FileExport suggest the exporter can emit both single-file and multi-file glTF variants.
- Compression.cs, Draco.cs, and MeshOpt.cs indicate optional geometry compression support.
10. Cross-cutting utilities
- Utils/ contains shared concerns: logging, file/directory helpers, settings, analytics, themeing, hyperlink handling, and Revit-specific helpers.
- ExportLog, LogConfiguration, SettingsConfig, and RevitIniReader show that configuration and diagnostics are first-class concerns.
- Analytics and ClickUpFormSender indicate optional telemetry/feedback integration outside the export path.
11. Versioning and update support
- Version/ handles update checks and version validation, including downloads and launch of local files.
- This is separated from the export path, suggesting the add-in can notify users about newer builds or installers.
12. Installer subsystem
- GltfInstaller is a standalone setup application with wizard-style dialogs for welcome, license, install directory, setup type, features, maintenance, progress, and exit.
- This is the deployment boundary for distributing the Revit add-in outside of Revit itself.
13. Build/release structure
- The repository uses GitHub Actions workflows for dev/PR/production automation and GitVersion.yml for versioning.
- The architecture is therefore release-oriented: shared exporter code, multiple Revit-targeted binaries, and installer packaging are all built and shipped together.
14. How to draw the diagram
- Put Revit on the left as the host runtime.
- Route it into version-specific add-in entry projects.
- From there, show a central shared exporter core that branches into:
- UI / options collection
- Revit data collection
- geometry + material conversion
- glTF/GLB file writing and compression
- Add side components for version/update checks, logging/settings, and installer packaging.
Main entry points: MainWindow.xaml Export UI · ProcessGeometry.cs Geometry core · ExternalApplication.cs Add-in entry · FileExport.cs File export
Components 21
Shared exporter
Reusable Revit-to-glTF export logic and user experience.
- Add-in entry · ExternalApplication and ExternalCommand entry points.
Common_glTF_Exporter/ExternalApplication.cs - Export UI · Main window and dialogs for options, feedback, progress, errors, and version info.
Common_glTF_Exporter/Windows/MainWindow.xaml - View models · UI state holders such as progress and units.
Common_glTF_Exporter/ViewModel/ViewModelBase.cs - Settings and logs · Configuration, logging, theme, file helpers, and Revit ini access.
Common_glTF_Exporter/Utils/SettingsConfig.cs - Update checks · Version validation, download, and local file launch support.
Common_glTF_Exporter/Version/VersionValidate.cs - Revit collect · Collector service and helpers that read document and view context.
Common_glTF_Exporter/Service/RevitCollectorService.cs - Export context · Coordinates export session state and geometry processing.
Common_glTF_Exporter/Core/GlTFExportContext.cs - Geometry core · Transforms Revit geometry into exportable mesh and scene data.
Common_glTF_Exporter/Core/ProcessGeometry.cs - Transforms · Scale, rotation, and translation before writing output.
Common_glTF_Exporter/Transform/ModelRotation.cs - Materials · Revit material extraction, texture handling, and material mapping.
Common_glTF_Exporter/Materials/RevitMaterials.cs - Domain model · Payload, objects, rooms, links, caches, and related exporter state.
Common_glTF_Exporter/Model/Payload.cs - File export · Writes glTF JSON, BIN, GLB, ZIP, and compressed variants.
Common_glTF_Exporter/Export/FileExport.cs - Binary utils · Binary layout and mesh/geometry packing helpers.
Common_glTF_Exporter/Utils/GLTFBinaryDataUtils.cs - Compression · Draco and MeshOpt integration for compressed geometry.
Common_glTF_Exporter/Export/Draco.cs
Revit hosts
Version-specific add-in projects that bind the shared exporter to Revit APIs.
- Revit · The external application runtime that loads the add-in.
- Version hosts · Thin projects for Revit 2019-2026.
- Manifest files · .addin manifest and PackageContents.xml used for discovery and loading.
Common_glTF_Exporter/Leia_glTF_Exporter.addin
Installer
Standalone setup application for distributing the add-in.
- Installer app · Standalone installer shell for deployment.
GltfInstaller/Program.cs - Setup dialogs · Wizard dialogs for welcome, license, features, directory, progress, and exit.
GltfInstaller/Dialogs/WelcomeDialog.xaml
Build and release
Automation and versioning used to ship the exporter.
- CI workflows · GitHub Actions workflows for development, PR, and production builds.
.github/workflows/dev_actions.yml - Versioning · GitVersion configuration used to stamp builds and releases.
GitVersion.yml
Connections 22
- Revit → Version hosts: loads · Revit loads the version-specific add-in binaries.
- Version hosts → Manifest files: registered by · Hosts are discovered through add-in and package manifests.
- Version hosts → Add-in entry: starts · Each target version binds Revit entry points.
- Add-in entry → Export UI: opens · Entry points launch the export UI and dialogs.
- Add-in entry → Revit collect: invokes · Entry points hand Revit context to collection services.
- Export UI → View models: binds to · WPF windows are backed by view models.
- Export UI → Update checks: shows · UI includes version and update-related screens.
- Revit collect → Export context: feeds · Collected Revit data enters the export session context.
- Export context → Geometry core: orchestrates · The context drives geometry processing.
- Geometry core → Transforms: applies · Geometry is adjusted into glTF-friendly coordinates.
- Geometry core → Materials: maps · Geometry processing depends on material and texture mapping.
- Geometry core → Domain model: populates · Processing builds internal exporter domain objects.
- Domain model → File export: serialized by · Internal DTOs are written into glTF outputs.
- File export → Binary utils: packs · File writers rely on binary packing helpers.
- File export → Compression: optionally uses · Export can add Draco or MeshOpt compression.
- Settings and logs → Export UI: configures · Settings and logging support the user-facing workflow.
- Settings and logs → Revit collect: supports · Collectors use shared utilities and configuration.
- Update checks → Export UI: drives · Update/version checks surface in the UI.
- Installer app → Setup dialogs: contains · Installer shell is composed of setup dialogs.
- CI workflows → Version hosts: builds · Automation builds the multi-version host projects.
- CI workflows → Installer app: packages · Automation also builds and ships the installer.
- Versioning → CI workflows: stamps · Version metadata feeds release automation.