{"id":31762326,"url":"https://github.com/elderlansouza/c4d-colmap-tracking-importer","last_synced_at":"2026-05-16T17:39:21.527Z","repository":{"id":317572642,"uuid":"1067972734","full_name":"elderlansouza/c4d-colmap-tracking-importer","owner":"elderlansouza","description":"Cinema 4D Python importer for COLMAP/GLOMAP camera tracking. Builds Redshift-compatible animated cameras, imports sparse point clouds, and configures scene settings for seamless photogrammetry workflows—an alternative to Blender’s photogrammetry importer, adapted for C4D.","archived":false,"fork":false,"pushed_at":"2025-10-06T16:19:06.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-09T22:18:26.696Z","etag":null,"topics":["camera-tracking","cinema4d","cinema4d-script","colmap","fooh","glomap","matchmove","motion-graphics","motiontracking","photogrammetry","vfx-tools","windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elderlansouza.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-01T16:56:05.000Z","updated_at":"2025-10-06T16:19:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ceb4154-8454-4937-9d27-d1a5630864fb","html_url":"https://github.com/elderlansouza/c4d-colmap-tracking-importer","commit_stats":null,"previous_names":["elderlansouza/c4d-colmap-tracking-importer"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/elderlansouza/c4d-colmap-tracking-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elderlansouza%2Fc4d-colmap-tracking-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elderlansouza%2Fc4d-colmap-tracking-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elderlansouza%2Fc4d-colmap-tracking-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elderlansouza%2Fc4d-colmap-tracking-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elderlansouza","download_url":"https://codeload.github.com/elderlansouza/c4d-colmap-tracking-importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elderlansouza%2Fc4d-colmap-tracking-importer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33112360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera-tracking","cinema4d","cinema4d-script","colmap","fooh","glomap","matchmove","motion-graphics","motiontracking","photogrammetry","vfx-tools","windows"],"created_at":"2025-10-09T22:18:06.215Z","updated_at":"2026-05-16T17:39:21.522Z","avatar_url":"https://github.com/elderlansouza.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COLMAP Tracking Importer C4D V1.3 — Readme\n\n## Need help?\n- Found a bug or have a feature request? Please open an **Issue** using the **Issues** tab.\n- For quick questions or suggestions, you can also email me: **elderlan.design@gmail.com**.\n- When filing an issue, include: Cinema 4D version, Redshift version, OS, a short repro, and any console errors.\n\n## Tutorial\n- Installing and using COLMAP on Windows: [How to use COLMAP](https://www.youtube.com/watch?v=PhdEk_RxkGQ)\n- Installing COLMAP on macOS: https://gist.github.com/celestial-33/07438792a11964ee5f6f02847b6dbb03 and https://gist.github.com/celestial-33/a016465fd854d79a1b93458f167baa6a\n\n## Required Tools \u0026 Links\n1️⃣ **COLMAP (v3.12.3)**: Required for its libraries, which GLOMAP utilises.  \n👉 https://github.com/colmap/colmap/releases/tag/3.12.0\n\n2️⃣ **GLOMAP (v1.1.0)**: Faster reconstruction tool. Use the `WINDOWS-NOCUDA` version.  \n👉 https://github.com/colmap/glomap/releases/tag/v1.1.0\n\n3️⃣ **FFMPEG**: Command-line tool for converting video into an image sequence.  \n👉 https://www.gyan.dev/ffmpeg/builds/\n\n4️⃣ **AutoTracker v1.4 Batch Script**: Updated script designed to work with GLOMAP on Windows 11.  \n👉 https://gist.github.com/polyfjord/fc213bac33b7eaaef4a80f4b6d9e5823\n\n## Credits\nBig thanks to **@Polyfjord**  \nYouTube: https://www.youtube.com/polyfjord\n\nIn his video, Polyfjord built upon the previous automated 3D tracking photogrammetry workflow by introducing GLOMAP instead of just COLMAP. He explains how to download and prepare the necessary tools to make this workflow 100% open source.\n\n## Where this Script Fits\nPolyfjord’s workflow focuses on Blender. However, exporting the tracking from Blender often causes bugs, framerate mismatches, or axis orientation issues when moving into other 3D software.\n\nThis Python importer for **Cinema 4D** fills that gap by:\n- Building a Redshift-compatible camera with correctly baked PSR and focal keyframes.\n- Handling axis conversion automatically (COLMAP → Cinema 4D).\n- Importing sparse point clouds and setting up Matrix objects.\n- Creating a constrained duplicate camera for flexible workflows.\n- Automatically configuring scene FPS, timeline ranges, and render resolution.\n\n⚠️ **Note**: To visualise the point cloud in the Cinema 4D viewport, you must manually set the **Matrix object Distribution to Vertex**.\n\n## Free Tool \u0026 Acknowledgment\nThis tool is completely **free**. If you use it in your projects, acknowledging **Elderlan Souza** as the creator of the Cinema 4D importer is greatly appreciated (but not compulsory).\n\nLooking forward to seeing what you’ll create using it! ✨\n\nFor **bugs, suggestions, or any other queries**, please feel free to contact me at:  \n📧 **elderlan.design@gmail.com**\n\n---\n\n## How to Use the Importer in Cinema 4D\n1. Launch **Cinema 4D**.\n2. Go to **Extensions → Script Manager → File → Load Script…** and load the Python script `colmap_importer.py`.\n3. Run the script from the **Script Manager** or assign it to a shortcut/menu.\n\u003cimg width=\"378\" height=\"268\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4b1aed7d-17e3-442b-90ff-e246bc0254e4\" /\u003e\n\n4. In the importer dialog:\n   - Select your **Scene Folder** (the one containing the `SPARSE` folder and `IMAGES`).\n   - Set **Sensor Width (mm)** (typically 36 mm for full-frame cameras).\n   - Enter your **video FPS**.\n   \u003cimg width=\"392\" height=\"455\" alt=\"image\" src=\"https://github.com/user-attachments/assets/0720a868-9572-4ebb-ad22-e5da7bc4dab6\" /\u003e\n\n   - Adjust **Global Scale** if needed (default: 100).\n   - Optionally, check **Import Sparse Point Cloud**.\n6. Click **OK** to import.\n7. The script will automatically:\n\u003cimg width=\"362\" height=\"256\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f0e7ac7c-ec1d-4129-88d1-996dd7fe9966\" /\u003e\n\n   - Create a **Redshift Camera** with baked animation.\n   - Duplicate it and add a **constraint** for flexibility.\n   - Import the **sparse point cloud**.\n   - Set **scene FPS, timeline, and render resolution**.\n8. ⚠️ Remember:\n   - To **see the point cloud in the viewport**, set the **Matrix object Distribution → Vertex** manually.\n   \u003cimg width=\"515\" height=\"500\" alt=\"image\" src=\"https://github.com/user-attachments/assets/894a681f-b2eb-48de-aad0-7e4f397afe3d\" /\u003e\n\n   \u003cimg width=\"1806\" height=\"1108\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9f4ddc66-deff-41bd-840d-4efe7dd9f200\" /\u003e\n\n   - To **configure the camera background**, do the following manually:\n   \u003cimg width=\"519\" height=\"1041\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cd5abde5-c264-4206-9ef8-91749640ff1c\" /\u003e\n\n     - Set **Background → Override** on the RS Camera.\n     - Select the first frame from the project’s `IMAGES` folder.\n     - Change mode from **Image** to **Animation**.\n     - Set **Animation Mode** to **Simple**.\n     - Set **Timing** to **Frame**.\n     - Press **Detect Frames** to load the sequence.\n     \u003cimg width=\"266\" height=\"40\" alt=\"image\" src=\"https://github.com/user-attachments/assets/76b34607-e983-452e-bca4-c10038fa9359\" /\u003e\n     \u003cimg width=\"1101\" height=\"662\" alt=\"image\" src=\"https://github.com/user-attachments/assets/550135a1-72da-45b6-8468-52b4d6be3a49\" /\u003e\n\n\n   - To **adjust the ground plane alignment**, move the **`GLoMap_Scene_Orient` group**.\n   \u003cimg width=\"1804\" height=\"1130\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ecfb99b1-6d36-407c-ad96-c24de36bdf60\" /\u003e\n   \u003cimg width=\"1589\" height=\"1105\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e822fe67-5417-4c6e-94cc-fc4300b0c811\" /\u003e\n\n\n   - The **RS_GLoMap_Render_Camera** uses a constraint to follow this transform.\n   \u003cimg width=\"460\" height=\"600\" alt=\"image\" src=\"https://github.com/user-attachments/assets/93e1bc9c-676a-430e-b804-0416ca79683e\" /\u003e\n\n   - If you need to export to other applications, you can bake the Render Camera’s final transform after alignment.\n\n### Known Bug: Resolution \u0026 Background Distortion\n- The scene resolution from COLMAP/GLOMAP isn’t always applied correctly. This causes the background image on the RS Camera to look distorted.\n- **Fix**: Open **Render Settings → Output**, and re-type the output width or height. This forces Cinema 4D to update the film aspect ratio and restores the correct background image proportions.\n\n---\n\n## Fixing the framerate mismatch in After Effects\n\nIf the video **framerate is 23.98 or 29.97 FPS**, you will likely experience a mismatch when compositing because Cinema 4D can’t export at these framerates.  \nTo demonstrate the issue, we can composite the image sequence generated by GLOMAP with the original footage. The fix also works for 3D sequences rendered from Cinema 4D.\n\n1. Launch **After Effects**.\n2. Import the **original footage** into After Effects and create a **new composition**.\n\u003cimg width=\"706\" height=\"648\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fa71c957-223a-4e2f-87a1-f17c036a02e1\" /\u003e\n\n3. Import the **rendered sequence** from GLOMAP (or Cinema 4D).\n\u003cimg width=\"714\" height=\"650\" alt=\"image\" src=\"https://github.com/user-attachments/assets/184d40f8-a8b9-4d37-8df5-dee5191bbe18\" /\u003e\n\n4. Select the **original footage**, right-click, **Interpret Footage → Remember Interpretation** (or **Ctrl+Alt+C** on Windows, **Cmd+Option+C** on Mac).\n\u003cimg width=\"768\" height=\"614\" alt=\"image\" src=\"https://github.com/user-attachments/assets/df7849fc-435a-4fda-997e-24da1a654854\" /\u003e\n\n5. Select the **image sequence**, right-click, **Interpret Footage → Apply Interpretation** (or **Ctrl+Alt+V** on Windows, **Cmd+Option+V** on Mac).\n\u003cimg width=\"751\" height=\"628\" alt=\"image\" src=\"https://github.com/user-attachments/assets/72f77a3b-a296-4ece-ac5c-682b0ca9e148\" /\u003e\n\n6. To visualise the frame mismatch, add the **image sequence** layer **on top of the original image** and change the mode to **Difference**.\n\u003cimg width=\"772\" height=\"132\" alt=\"image\" src=\"https://github.com/user-attachments/assets/c6fab1db-db0c-47b4-ad60-b5753fef63b9\" /\u003e\n\n7. You can now see where the pixels mismatch (inverted colour).\n\u003cimg width=\"1703\" height=\"970\" alt=\"image\" src=\"https://github.com/user-attachments/assets/528be034-bd47-4fe5-a8dd-df2775d82f97\" /\u003e\n\n8. To fix it, **stretch the duration by 0.01%** for the image sequence. Right-click the layer, **Time → Time Stretch**.\n\u003cimg width=\"561\" height=\"683\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fe12fcca-9bc9-4a58-972a-fab9d633108a\" /\u003e\n\n9. Change the **stretch factor to 100.01%** and click **OK**.\n\u003cimg width=\"800\" height=\"402\" alt=\"image\" src=\"https://github.com/user-attachments/assets/963eac91-ba2e-4ad2-910a-ec860ada70d2\" /\u003e\n\n10. If all the pixels match, the frame will turn black.\n\nThis method, using the GLOMAP image sequence, works to visualise the fix. It can be applied to any 3D sequence rendered from Cinema 4D, except for the **Difference** blend mode, which is used only to visualise the mismatch in this tutorial.\n\n---\n\n## Setup \u0026 Use: AutoTracker v1.4 (.bat)\nFollow these steps, extracted from the video transcript, to configure and run the batch script on Windows (CPU-only, no CUDA required):\n\n1. **Create the project folders**\n   - Make a new folder, e.g. `AUTOTRACKER V1.4`.\n   - Inside it, create these subfolders (exact names):\n     - `01 GLOMAP`\n     - `02 VIDEOS`\n     - `03 FFMPEG`\n     - `04 SCENES`\n     - `05 SCRIPT`\n\n2. **Download the tools**\n   - COLMAP **v3.12.3** (use this version specifically).\n   - GLOMAP **v1.1.0** (`WINDOWS-NOCUDA`).\n   - FFMPEG (release essentials build).\n   - AutoTracker **v1.4** batch script (save as `.BAT`, not `.TXT`).\n\n3. **Populate `01 GLOMAP` with COLMAP + GLOMAP**\n   - Extract the **COLMAP** download and open its `BIN/` folder. Select **all files** in `BIN` and **drag them into** `01 GLOMAP`.\n   - Extract the **GLOMAP** download, open its `BIN/` folder, select **all files**, and drag them into `01 GLOMAP` as well. When prompted, **skip identical files**.\n   - From the **root** of the extracted COLMAP folder, **copy the entire `PLUGINS/` folder** into `01 GLOMAP` (so `01 GLOMAP/PLUGINS` exists).\n   - Result: `01 GLOMAP` should now contain `COLMAP.EXE`, GLOMAP executables, many `.DLL` files, and a `PLUGINS/` folder.\n\n4. **Place your footage**\n   - Put your source video file(s) into `02 VIDEOS`.\n   - (From the video: disabling in-camera stabilisation and using a 180° shutter—e.g., **1/60** at 30 fps—can help produce better motion blur for tracking.)\n\n5. **Unpack FFMPEG**\n   - Extract the FFMPEG archive and move **its contents** into `03 FFMPEG` (you should see `BIN/` and related files inside `03 FFMPEG`).\n\n6. **Add the batch script**\n   - Save **`AUTOTRACKER 1.4.BAT`** into `05 SCRIPT`.\n   - Important: when downloading from the browser’s **RAW** view, some browsers append `.TXT`. Save as **ALL FILES** and make sure the filename **ends with `.BAT`** only.\n\n7. **Run the script**\n   - Double-click `05 SCRIPT/AUTOTRACKER 1.4.BAT`.\n   - The first Windows security prompt may appear; allow it to run.\n   - The script will:\n     - Use **FFMPEG** to **extract frames** from your video (CPU).\n     - Run **COLMAP feature extraction** over the frames.\n     - Run **GLOMAP** to reconstruct and produce a track.\n   - For faster processing, you can work with **1080p** footage instead of 4K.\n\n8. **Outputs**\n   - The script will populate your **`04 SCENES`** folder with the reconstructed project files (per the referenced script’s defaults).\n\n### Troubleshooting (from the video)\n- If the `.BAT` won’t run, confirm the extension isn’t `.BAT.TXT` and that SmartScreen isn’t blocking it.\n- CUDA isn’t required here; the demonstrated workflow runs **CPU-only** and is still ~4× faster than the older COLMAP-only setup.\n\n---\n\n## License\nThis importer is released as **free to use and modify**.  \nCredit to **Elderlan Souza** is appreciated but not compulsory when used in projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felderlansouza%2Fc4d-colmap-tracking-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felderlansouza%2Fc4d-colmap-tracking-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felderlansouza%2Fc4d-colmap-tracking-importer/lists"}