{"id":22497411,"url":"https://github.com/pingbird/contrado-tools","last_synced_at":"2026-07-11T17:31:22.977Z","repository":{"id":265463907,"uuid":"828317245","full_name":"pingbird/contrado-tools","owner":"pingbird","description":"Scripts for downloading and working with 3d assets from Contrado","archived":false,"fork":false,"pushed_at":"2024-07-14T06:17:41.000Z","size":2839,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-17T12:06:01.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pingbird.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-13T19:02:26.000Z","updated_at":"2024-07-14T06:17:43.000Z","dependencies_parsed_at":"2024-11-29T13:54:49.943Z","dependency_job_id":"3031021e-d7a2-40d5-899f-47a91e842803","html_url":"https://github.com/pingbird/contrado-tools","commit_stats":null,"previous_names":["pingbird/contrado-tools"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pingbird/contrado-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingbird%2Fcontrado-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingbird%2Fcontrado-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingbird%2Fcontrado-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingbird%2Fcontrado-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pingbird","download_url":"https://codeload.github.com/pingbird/contrado-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pingbird%2Fcontrado-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35370428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-06T20:19:11.793Z","updated_at":"2026-07-11T17:31:22.953Z","avatar_url":"https://github.com/pingbird.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contrado Tools\n\nThis repository contains tools that can be used to scrape metadata\nand 3d models from the [Contrado](https://www.contrado.com/) website.\n\nContrado is a print-on-demand service that allows users to upload their\nown designs and have them printed on various products such as shirts,\ndresses, and bags.\n\nI created these tools to help me create designs using professional 3d\nmodelling and texturing software, otherwise, you would have to use\nContrado's online design tool which is quite limited and slow.\n\n## Tools\n\n### `contrado_dl/scrape.dart`\n\nThis script uses puppeteer to crawl the Contrado website for product IDs,\ndownloads the JSON metadata for each product/variant, and downloads the\nactual glTF model files.\n\n```\ncache/links.txt - list of URLs that were crawled\ncache/http/... - cached HTTP responses\ncache/products/\u003cid\u003e/options.html - HTML form containing some settings, such as thread color\ncache/products/\u003cid\u003e/model_config.json - Metadata containing the list of sizes and texture configuration\ncache/products/\u003cid\u003e/\u003csize\u003e/template.json - Metadata containing texture/mask sizes\ncache/products/\u003cid\u003e/\u003csize\u003e/\u003citem\u003e.glb - The actual model \n```\n\nIf you don't want to run it yourself you can check out [releases](https://github.com/pingbird/contrado-tools/releases).\nNote that all of these assets are owned by Contrado and should not be\nused for commercial purposes.\n\n### `contrado_dl/mask_fix.dart`\n\nThis script positions and scales the mask so that they align correctly with\ntextures made for the model, this is necessary because the web UI does not\nhave any sort of alignment tool.\n\nTo use it, upload your textures to the correct patches of fabric in the\nweb UI (notice they are misaligned), go into the network tab of DevTools,\nright-click the network request for `savedesignstate`, and click\n`Copy \u003e Copy as fetch`:\n\n![](pics/copy_as_fetch.png)\n\nPaste this into `contrado/input.js` and run `mask_fix.dart`, it will\noutput a new `output.js` with a fetch request that contains the fixed\nmask positions. Paste this into the DevTools console, refresh the page,\nand your textures should now be aligned correctly, yay!\n\n### `blender/importer.py`\n\nThis is a Blender script that can be used to import the downloaded models\ninto Blender. It uses the `model_config.json` and `template.json` files\nto create separate textures for each patch of fabric, and positions them\ncorrectly on the model with a shader. It also paints a nice wireframe for\neach patch, so you can easily see the borders.\n\nTo use it, open Blender, go to the `Scripting` tab, create a new script,\npaste the contents of `importer.py`, update the relevant paths, and run it.\n\nBlender may freeze for a minute since it generates very high resolution\ntextures, if successful, you should see a colorful model with wireframes:\n\n![](pics/blender_import.png)\n\n## Full workflow\n\n### 1. Locate a product on the Contrado website\n\nThis must be a product that has a 3d model available, such as the\n[Custom Skater Dress](https://www.contrado.com/custom-skater-dress).\n\nNote the product ID in the design tool URL, in this case it's `1614`.\n\nYou can tell if a product has a 3d model by going into the design tool and\npressing the \"Preview\" button in the bottom right, you should have a 360\nview:\n\n![](pics/dress_model.png)\n\n### 2. Pick a size and extract the model\n\nTo get the assets, run `scrape.dart` or download them from the\n[releases](https://github.com/pingbird/contrado-tools/releases).\n\nEach size has a different model, so if you get the wrong size you will\nhave to re-design your textures. My measurements closely matched the\n`M_10_12UK` size for the above dress, so I use that.\n\nThe relevant files are:\n\n```\ncache/products/1614/model_config.json\ncache/products/1614/M_10_12UK/Skater_Dress.glb\ncache/products/1614/M_10_12UK/template.json\n```\n\n### 3. Import model into Blender\n\nAs mentioned above, use the `importer.py` script to import the model\ninto Blender. You will need to update the paths in the script to point\nto the correct files.\n\n```python\nmodel_path = r'C:\\Users\\ping\\IdeaProjects\\contrado-tools\\contrado_dl\\cache\\products\\1614\\M_10_12UK\\Skater_Dress.glb'\nmodel_config_path = r'C:\\Users\\ping\\IdeaProjects\\contrado-tools\\contrado_dl\\cache\\products\\1614\\model_config.json'\ntemplate_config_path = r'C:\\Users\\ping\\IdeaProjects\\contrado-tools\\contrado_dl\\cache\\products\\1614\\M_10_12UK\\template.json'\nproject_path = r'C:\\Users\\ping\\Documents\\art\\vhs_doggy'\n```\n\nYou should now have a model with correctly positioned textures, you should\nalso see a bunch of texture files in the project directory:\n\n![](pics/dress_wireframe.png)\n\n### 4. Design your textures\n\nYou can now design your textures in your favorite 2d software, such as\nPhotoshop, Affinity Designer, or GIMP. You can use the wireframes as a\nguide to where the patches are.\n\nTo re-import the textures back into blender, I highly recommend installing\nthe [Auto Reload Plugin](https://github.com/samytichadou/Auto_Reload_Blender_addon),\nthis will automatically reload the textures when you save them in your image\neditor.\n\n![](pics/band_or_something.png)\n\nMy design has the logo of like... a band or something. :-)\n\n### 5. Upload textures\n\nIn the design tool, click each patch of fabric and upload the corresponding\ntexture:\n\n![](pics/contrado_editor.png)\n\nYou may notice that the textures are misaligned, this is where the\n`mask_fix.dart` script comes in. Follow the instructions above to fix\nthe mask positions:\n\n![](pics/mask_fixed.png)\n\n### 6. Profit\n\nYou should now have a beautiful dress with your own custom design!!!\n\n![](pics/all_set.png)\n![](pics/shipped.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpingbird%2Fcontrado-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpingbird%2Fcontrado-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpingbird%2Fcontrado-tools/lists"}