Skip to content

Commit

Permalink
Update version and installation docs
Browse files Browse the repository at this point in the history
- Don't access bl_info
- Rename addon to extension
  • Loading branch information
hlorus committed Jul 20, 2024
1 parent a3af41b commit 745513e
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 72 deletions.
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Constraint-based sketcher addon for [Blender](https://www.blender.org/) that all

> :warning: **Experimental addon:** This is still work in progress, don't use it on production files without a backup.
Minimum version: Blender 3.3
Minimum version: Blender 4.2

## More than just an addon learn more: [CADsketcher.com](http://cadsketcher.com/)

Expand All @@ -32,18 +32,9 @@ Minimum version: Blender 3.3
- [Gumroad](https://gumroad.com/a/891069555) Download (This way we can update you about big updates and ask your opinion on big changes)
- Download the [ZIP archive](https://github.com/hlorus/CAD-Sketcher/archive/refs/heads/main.zip) (do not unpack it after downloading)
<br><b>!(Mac users be careful your OS can auto-unpack addon's which will make them break)!</b>
- Open Blender and go to: Edit > Preferences > Add-ons > Press "Install..." button
- Browse to the location of the ZIP and select it, then press "Install Add-on"
- Enable the addon by pressing the checkbox
- Open Blender and go to: Edit > Preferences > Get Extensions > Extension Settings (Arrow in the top right corner) > Press "Install from Disk..." button
- Browse to the location of the ZIP and select it, then press "Install from Disk"

## Dependency installation

CAD sketcher heavily depends on the [solvespace python module](https://pypi.org/project/py-slvs/) and won't be functional without it.

- Inside the addon's preferences check the "Solver Module" tab to see if the module is already available
- Press "Install from PIP"

Check the [installation](https://hlorus.github.io/CAD_Sketcher/installation) chapter for in-depth instructions.

## Usage
Follow the [getting started](https://hlorus.github.io/CAD_Sketcher/getting_started) guide to get familiar with the addon.
Expand All @@ -62,5 +53,3 @@ Alternatively individual developers can link their donation links here:
<a href="https://www.paypal.com/donate/?business=4A9SCSHAU3ZP6&no_recurring=0&currency_code=CHF">
hlorus - Lead Dev
</a>


11 changes: 2 additions & 9 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

from bpy.app import background, version, version_string


bl_info = {
"name": "CAD Sketcher",
"author": "hlorus",
"version": (0, 27, 4),
"version": (0, 27, 5),
"blender": (3, 3, 0),
"location": "View3D > Toolbar",
"description": "Parametric, constraint-based geometry sketcher",
Expand All @@ -16,16 +17,11 @@
"tracker_url": "https://github.com/hlorus/CAD_Sketcher/discussions/categories/announcements",
}

def get_bl_info():
return bl_info


def get_addon_version_tuple() -> tuple:
"""Return addon version as a tuple e.g. (0, 27, 1)"""

if version < (4, 20):
return get_bl_info()["version"]

manifest = pathlib.Path(__file__).parent.parent / "blender_manifest.toml"
try:
import toml
Expand All @@ -45,9 +41,6 @@ def get_addon_version() -> str:
def get_min_blender_version() -> str:
"""Returns the minimal required blender version from manifest file"""

if version < (4, 20):
return str(get_bl_info()["version"])

manifest = pathlib.Path(__file__).parent.parent / "blender_manifest.toml"
try:
import toml
Expand Down
6 changes: 3 additions & 3 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version = "1.0.0"

id = "CAD_Sketcher"
version = "0.27.4"
version = "0.27.5"
name = "CAD Sketcher"
tagline = "Parametric, constraint-based geometry sketcher"
maintainer = "hlorus <[email protected]>"
Expand All @@ -13,7 +13,7 @@ website = "https://www.cadsketcher.com/"

tags = ["3D View", "Modeling", "Mesh", "Object"]

blender_version_min = "3.3.0"
blender_version_min = "4.2.0"

license = [
"SPDX:GPL-3.0-or-later",
Expand All @@ -31,4 +31,4 @@ wheels = [
"./wheels/py_slvs-1.0.6-cp311-cp311-musllinux_1_1_x86_64.whl",
"./wheels/py_slvs-1.0.6-cp311-cp311-win_amd64.whl",
"./wheels/py_slvs-1.0.6-cp311-cp311-win32.whl",
]
]
18 changes: 9 additions & 9 deletions docs/content/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Whenever encountering a bug follow these steps:

- Check if the bug is already reported on [github](https://github.com/hlorus/CAD_Sketcher/labels/bug)
- Try to reliably reproduce the bug and simplify the steps to reproduce
- Collect the [addon logs](#access-logs)
- Collect the [extension logs](#access-logs)
- In case of a crash also collect blender's [crash report](https://docs.blender.org/manual/en/latest/troubleshooting/crash.html#:~:text=%2Do%20%25MEM%20.-,Crash%20Log,as%20some%20other%20debug%20information)
- Post the bug on [github](https://github.com/hlorus/CAD_Sketcher/issues/new?assignees=&labels=bug&template=bug-report.md&title=%5BBUG%5D)

Expand All @@ -25,14 +25,14 @@ CAD sketcher for debugging purposes depends on the library [debugpy](https://pyp
through VSCode. Installing this library with ```$pip install``` will further mean that the window in VSCode will need to be reloaded using ```command Palette > Reload window``` .

## Access Logs
Logs are helpful for debugging. Note that there are logs from the addon as well as from blender itself.
Logs are helpful for debugging. Note that there are logs from the extension as well as from blender itself.

### Addon Logs
The addon logs information to the [system console](#console-output) and to the system's temporary
### Extension Logs
The extension logs information to the [system console](#console-output) and to the system's temporary
folder. The filepath to this folder will be printed to the console whenever the
addon gets registered.
extension gets registered.

> CAD_Sketcher:{INFO}: Logging into: C:\Users\USERNAME\AppData\Local\Temp\CAD_Sketcher.log
> CAD_Sketcher:{INFO}: Logging into: /tmp/bl_ext.user_default.CAD_Sketcher.log
### Blender Crash Log
When blender crashes it writes a crash report file, see: [crash report](https://docs.blender.org/manual/en/latest/troubleshooting/crash.html#crash-log).
Expand All @@ -44,14 +44,14 @@ Help is always welcome. There are multiple ways to support the project.
### Testing
Just grab the latest version, play around, provide feedback and redo!

If you've made code changes to the addon and want to test those, zip the project folder and install it through ```Blender Preferences > Add-ons > Install```.
If you've made code changes to the extension and want to test those, zip the project folder and install it through ```Blender Preferences > Add-ons > Install```.

### Documentation
Documentation is generated from the source repository with [MkDocs](https://www.mkdocs.org/).
In order to contribute either post a pull request with your changes on
[github](https://github.com/hlorus/CAD_Sketcher) or ask on [discord](https://discord.gg/GzpJsShgxa) for commit access.

> **Note:** There are github workflows which will automatically test and build the documentation after changes are made.
> **Note:** There are github workflows which will automatically test and build the documentation after changes are made.
<!-- TODO: Workboard -->

Expand All @@ -68,6 +68,6 @@ currently lies.

**Code Style**

The project uses the [Black Formatter](https://github.com/psf/black), make sure to enable it in your code editor before pushing pull requests.
The project uses the [Black Formatter](https://github.com/psf/black), make sure to enable it in your code editor before pushing pull requests.

<!-- ### Donate -->
20 changes: 10 additions & 10 deletions docs/content/code_docs.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Code Documentation
## Core
At the base of the addon there's the properties structure. The [model subpackage](https://github.com/hlorus/CAD_Sketcher/tree/main/model) defines
At the base of the extension there's the properties structure. The [model subpackage](https://github.com/hlorus/CAD_Sketcher/tree/main/model) defines
a set of blender [PropertyGroups](https://docs.blender.org/api/current/bpy.types.PropertyGroup.html). This is needed so that values are stored to disk on file save. These PropertyGroups have to be registered
and then be pointed to from somewhere by a PointerProperty.

Additionally to pure properties PropertyGroups can also hold methods and attributes,
the addon makes heavy use of that as it leads to a convenient way of working with the data.
the extension makes heavy use of that as it leads to a convenient way of working with the data.

The root of the addon's data structure is SketcherProps which is registered on blender's
The root of the extension's data structure is SketcherProps which is registered on blender's
Scene type and can therefore be accessed as follows:
```
bpy.context.scene.sketcher
Expand Down Expand Up @@ -59,9 +59,9 @@ to tag entities as dirty however this is currently still disabled by default.

> **NOTE:** In order to draw anything a draw handler has to be registered on the viewport type.
This usually happens from an operator that the user invokes. As this is rather bad UX the
addon registers the handler when the addon is registered. More precisely, as the
extension registers the handler when the extension is registered. More precisely, as the
the context at register time is limited, a [Application Timer](https://docs.blender.org/api/current/bpy.app.timers.html) is used to register
the draw handler shortly after the addon has been registered.
the draw handler shortly after the extension has been registered.

### Selection
Entity selection is done by simply drawing entities a second time in an [Offscreen Texture](https://docs.blender.org/api/current/gpu.html#generate-a-texture-using-offscreen-rendering). The color however is used
Expand All @@ -75,7 +75,7 @@ can be used to write the current selection texture to an image data-block in ord
to inspect it.

### Preselection
The addon makes great use of preselection highlighting. To achieve that the
The extension makes great use of preselection highlighting. To achieve that the
VIEW3D_GT_slvs_preselection gizmo is used which looks up the currently hovered pixel and writes
the index to global_data.hover whenever the "test_select" method is called.

Expand All @@ -92,25 +92,25 @@ make use of the [Gizmo API](https://docs.blender.org/api/current/bpy.types.Gizmo

## Interaction
There's a set of operators defined in operators.py which are used to create the
interaction between the user and the addon. Note that the addon also has to define
interaction between the user and the extension. Note that the extension also has to define
operators for basic interactions like selection or calling the context menu due to
the fact that entities are implemented from scratch.

Most of the viewport operators inherit from the StatefulOperator class which is a
framework to allow defining complex tools in a declarative fashion. Besides the
base class itself which implements logic for native blender types there's also
the GenericEntityOp which adds support for addon specific types. Have a look at
the GenericEntityOp which adds support for extension specific types. Have a look at
the [interaction chapter](interaction_system.md) in the docs.

The addon also makes heavy use of workspacetools. Note that they depend on some
The extension also makes heavy use of workspacetools. Note that they depend on some
functionality defined in the StatefulOperator class to display the correct description
and get the tools shortcuts.

> **NOTE:** Tools that need to be able to select entities have to use the preselection gizmo
in order to get updated selection.

## Solver
The addon uses the [Python Binding](https://pypi.org/project/py-slvs/) of [Solvespace](https://solvespace.com/index.pl). As the solver module isn't well documented it's best to inspect it through
The extension uses the [Python Binding](https://pypi.org/project/py-slvs/) of [Solvespace](https://solvespace.com/index.pl). As the solver module isn't well documented it's best to inspect it through
the an interactive python interpreter. This can be done inside blender's python console
when the solver module has been installed, something like this:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/content/entities.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Entities are the basic elements which are used to draw geometry in CAD Sketcher. They differ from regular blender mesh or curve elements which means native blender tools aren't able to interact with it as long as they aren't converted. See the chapter [integration](integration.md) for further details on how to process addon specific geometry.
Entities are the basic elements which are used to draw geometry in CAD Sketcher. They differ from regular blender mesh or curve elements which means native blender tools aren't able to interact with it as long as they aren't converted. See the chapter [integration](integration.md) for further details on how to process extension specific geometry.

Entities are defined by a set of parameters and pointers to other entities which are editable at any point in time. This allows non-destructive workflows and also ensures that geometry is resolution independent. A curve will always follow a given radius no matter how it's transformed. Entities can be created with the various [Workspacetools](user_interface.md#workspacetools).

Expand Down
9 changes: 4 additions & 5 deletions docs/content/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
This guide takes you through the first steps in order to get familiar with the addon.
This guide takes you through the first steps in order to get familiar with the extension.

## Installation
![!Preferences](images/preferences.png){style="width:100%; height:200px; object-fit:cover;"}

Download the [Latest Release](https://github.com/hlorus/CAD_Sketcher/releases)
of the addon and install it from the addons tab in blender's preferences. Get the
solvespace module by pressing the install button in the addon's preferences.
See [here](installation.md) if
you have trouble installing the addon.
of the extension and install it from the "Get Extensions" tab in blender's preferences.
See the [installation guide](installation.md) if
you have trouble installing the extension.

## Create a Sketch
![!Add Sketch](images/add_sketch.png){style="width:100%; height:200px; object-fit:cover;"}
Expand Down
4 changes: 2 additions & 2 deletions docs/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## What is CAD Sketcher?

CAD Sketcher is a constraint-based sketcher addon for [Blender](https://www.blender.org/download/) that allows to create precise 2d shapes by defining a set of geometric constraints like tangent, distance, angle, equal and more. Sketches stay editable and support a fully non-destructive workflow.
CAD Sketcher is a constraint-based sketcher extension for [Blender](https://www.blender.org/download/) that allows to create precise 2d shapes by defining a set of geometric constraints like tangent, distance, angle, equal and more. Sketches stay editable and support a fully non-destructive workflow.

## Overview

Expand All @@ -27,7 +27,7 @@ to get native Blender geometry types which then allow further modifications with
<!-- Check the [Workflow](solver.md#Workflow) section to see how it's intended to be used. -->

## Links
- [Releases](https://github.com/hlorus/CAD_Sketcher/releases) - Get the addon
- [Releases](https://github.com/hlorus/CAD_Sketcher/releases) - Get the extension
- [Bug Report](https://github.com/hlorus/CAD_Sketcher/wiki/Advanced#Report-a-Bug) - Report a bug
- [Github Issues](https://github.com/hlorus/CAD_Sketcher/issues) - Suggest features and follow the development
- [Discord](https://discord.gg/GzpJsShgxa) - A place for discussions
Expand Down
14 changes: 10 additions & 4 deletions docs/content/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Addon installation
=== "ZIP File"
## Installation
=== "Extension ZIP File"
- Download the [ZIP archive](https://github.com/hlorus/CAD_Sketcher/archive/refs/heads/main.zip) from github (ensure it's a ZIP Archive, on Mac you might have to repack as it gets unzipped automatically)
- Open Blender and go to: Edit > Preferences > Get Extensions > Extension Settings (Arrow in the top right corner) > Press "Install from Disk..." button
- Browse to the location of the ZIP and select it, then press "Install from Disk"
=== "Legacy addon"
- Download the [ZIP archive](https://github.com/hlorus/CAD_Sketcher/archive/refs/heads/main.zip) from github (ensure it's a ZIP Archive, on Mac you might have to repack as it gets unzipped automatically)
- Open Blender and go to: Edit > Preferences > Add-ons > Press "Install..." button
- Browse to the location of the ZIP and select it, then press "Install Add-on"
Expand Down Expand Up @@ -30,6 +34,8 @@ CAD Sketcher heavily depends on the [solvespace python module](https://pypi.org/

Once the 3D View CAD Sketcher plugin is installed check its preferences for the "Solver Module" tab to see if the module is already available, otherwise follow one of the guides below.

=== Blender >=4.2 Extensions
If you install CAD Skecther as a Blender Extension you can skip this step

=== "Install from PIP"
- Press "Install from PIP"
Expand All @@ -49,15 +55,15 @@ There are multiple reasons why the installation might fail. Try the following:
- If you're on windows start blender as administrator when installing the dependency
- If you've installed blender through a package manager try again with a version from [blender.org](https://www.blender.org/download/)
- Check the application's output in the system console for any warnings or hints to find out why it's failing
- Blender can be installed through package managers, installing external python packages with such installations might not be possible. Try to use the addon with Blender installed from the official website.
- Blender can be installed through package managers, installing external python packages with such installations might not be possible. Try to use the extension with Blender installed from the official website.
- Ask for help

## Updating

=== "Manual"

- Delete the old version from the addons/extensions list under Edit > Preferences > Add-ons/Get Extensions
- Simply redo the installation steps with the latest addon version
- Delete the old version from the addons list under Edit > Preferences > Add-ons

=== "Git"

Expand Down
4 changes: 2 additions & 2 deletions docs/content/integration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The geometry that is used in the addon isn't native blender geometry, that means
The geometry that is used in the extension isn't native blender geometry, that means
blender doesn't know anything about it and native tools cannot work with it.
So in order to further process drawn shapes they have to be converted to a native type first.

Expand Down Expand Up @@ -26,7 +26,7 @@ won't have surfaces at all but rather just edges.
## Limitations
### 3D Geometry
Conversion requires a sketch, the addon currently doesn't support creating 3D sketches
Conversion requires a sketch, the extension currently doesn't support creating 3D sketches
and is therefor limited to the conversion of 2D entities.

### Non-Persistent Geometry
Expand Down
6 changes: 3 additions & 3 deletions docs/content/interaction_system.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The focus of the addon lies on different aspects than blender itself. Addon tools usually work on one specific entity or between a few entities where the order of
selection matters. As the existing system of selection isn't ideal in this context the addon defines a generic interaction system which allows for a powerful and flexible workflow.
The focus of the extension lies on different aspects than blender itself. Extension tools usually work on one specific entity or between a few entities where the order of
selection matters. As the existing system of selection isn't ideal in this context the extension defines a generic interaction system which allows for a powerful and flexible workflow.

## Stateful Operations

Most tools in the addon are implemented as stateful tools. In this context a state represents one target like a selection or a value. When running a tool you will iterate through these states until all states have valid input.
Most tools in the extension are implemented as stateful tools. In this context a state represents one target like a selection or a value. When running a tool you will iterate through these states until all states have valid input.

Let's take the "Add Circle" tool as an example. Since a circle is represented by its center and radius the tool will have two states. One to define the center element and one to set the radius.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/solver.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The addon utilizes the solver from [solvespace](https://solvespace.com/index.pl) which
The extension utilizes the solver from [solvespace](https://solvespace.com/index.pl) which
takes a set of entities with an initial position and a set of constraints which
describe geometric relationships between entities. When the solver runs it will try
to adjust entity locations to satisfy the constraints.
Expand Down
Loading

0 comments on commit 745513e

Please sign in to comment.