Skip to content

Commit

Permalink
1 create initial commit (#2)
Browse files Browse the repository at this point in the history
* Initial commit of the blender plugin.

* Adding a quick table of contents to the top of the README.md

* Formatting

* isort

* code cleanup

* lint readme

* Updating default prompt for a large 2m x 2m object

* Updating README.md. Adding a note about long execution time. New banner

* Black formatting

---------

Co-authored-by: Greg Sweeney <[email protected]>
  • Loading branch information
r-barton and greg-kcio authored Mar 4, 2024
1 parent 6edbd07 commit cac85ae
Show file tree
Hide file tree
Showing 18 changed files with 518 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
32 changes: 32 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: black
on:
push:
branches: main
paths:
- '**.py'
- .github/workflows/black.yml
- 'requirements.txt'
pull_request:
paths:
- '**.py'
- .github/workflows/black.yml
- 'requirements.txt'
jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: 'pip'

- name: Install dependencies
shell: bash
run: |
pip install black[jupyter]
- name: Run black
shell: bash
run: |
black --check --diff . */*.py
19 changes: 19 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ruff
on:
push:
branches: main
paths:
- '**.py'
- .github/workflows/ruff.yml
- 'requirements.txt'
pull_request:
paths:
- '**.py'
- .github/workflows/ruff.yml
- 'requirements.txt'
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,8 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/


# Blender files
*.blend*
70 changes: 68 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,68 @@
# text-to-cad-blender-plugin
A Blender plugin to interact with the text-to-cad API
![Zoo Logo](assets/zoo-banner.png)

## Zoo's Text To CAD Plugin For Blender

A [Blender](https://blender.org) plugin to interact with Zoo's Text-to-CAD API, brought to you by the [Zoo Team](https://zoo.dev)

## Table of Contents

- [Zoo's Text To CAD Plugin For Blender](#zoos-text-to-cad-plugin-for-blender)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)

## Prerequisites

1. Create an account at [zoo.dev/signup](https://zoo.dev/signup)
2. Create an API token for your account at [zoo.dev/account/api-tokens](https://zoo.dev/account/api-tokens)
3. Add your API token to your environment with the name `KITTYCAD_API_TOKEN`

## Installation

Download the [text_to_cad.py](src/text_to_cad.py) from [`src`](src)

Open the preferences menu in Blender. *Edit* -> *Preferences*

![](assets/open_preferences.png)

Select the *Addons* tab and click the *Install* button

![](assets/install_addon.png)

Navigate to your downloaded *text_to_cad.py* and *Install Add-on*

![](assets/install_addon_2.png)

Make sure the *Text To CAD* addon is *enabled* by checking the box next to the plugin

![](assets/enable_addon.png)

## Usage

The plugin can be accessed via shortcut `ctrl + shift + T` or while in Object Mode under the Add Menu

#### NOTE: This plugin may take several minutes to run while your prompt is processing. Please check your [dashboard](https://text-to-cad.zoo.dev/dashboard) for progess

![](assets/launch_addon_menu.png)

There are 3 inputs to this plugin

![](assets/plugin.png)

- The text prompt:
- Describe an object that can be represented in geometric shapes, not nebulous concepts such as "a tiger" or "the universe", unless you're just curious what it does with that 😏
- Be as explicit as possible. For example, if you want a plate with 4 holes, say where you want the holes placed and how big of a diameter each should have
- Our ML models are better at describing single objects than assemblies for now
- The output format:
- This is required as the model needs to be downloaded and saved locally.
- The output directory:
- Where the downloaded model should be saved. If you need to re-access this model for any reason or want to download in a different format you can go back to your [dashboard](https://text-to-cad.zoo.dev/dashboard)

## Contributing

Before you submit a contribution PR to this repo, please ensure that:

- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
- You have separated out refactoring commits from feature commits as much as possible
Binary file added assets/enable_addon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/install_addon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/install_addon_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/launch_addon_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/open_preferences.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/zoo-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
black==24.2.0
bpy==4.0.0
pillow==10.2.0
ruff==0.2.2
Binary file added src/icons/zoo-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/zoo-icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cac85ae

Please sign in to comment.