diff --git a/README.md b/README.md index 24d922d..f15e124 100644 --- a/README.md +++ b/README.md @@ -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/) @@ -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)
!(Mac users be careful your OS can auto-unpack addon's which will make them break)! -- 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. @@ -62,5 +53,3 @@ Alternatively individual developers can link their donation links here: hlorus - Lead Dev - - diff --git a/__init__.py b/__init__.py index 2e9b5bd..b441d88 100644 --- a/__init__.py +++ b/__init__.py @@ -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", @@ -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 @@ -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 diff --git a/blender_manifest.toml b/blender_manifest.toml index 6a41fde..f64a181 100644 --- a/blender_manifest.toml +++ b/blender_manifest.toml @@ -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 " @@ -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", @@ -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", -] \ No newline at end of file +] diff --git a/docs/content/advanced.md b/docs/content/advanced.md index a7d7b85..d7f1fd4 100644 --- a/docs/content/advanced.md +++ b/docs/content/advanced.md @@ -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) @@ -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). @@ -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. @@ -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. diff --git a/docs/content/code_docs.md b/docs/content/code_docs.md index 4704cc2..4555947 100644 --- a/docs/content/code_docs.md +++ b/docs/content/code_docs.md @@ -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 @@ -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 @@ -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. @@ -92,17 +92,17 @@ 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. @@ -110,7 +110,7 @@ and get the tools shortcuts. 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: ``` diff --git a/docs/content/entities.md b/docs/content/entities.md index f83d508..7faac70 100644 --- a/docs/content/entities.md +++ b/docs/content/entities.md @@ -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). diff --git a/docs/content/getting_started.md b/docs/content/getting_started.md index 76d51aa..cbb3ac6 100644 --- a/docs/content/getting_started.md +++ b/docs/content/getting_started.md @@ -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;"} diff --git a/docs/content/index.md b/docs/content/index.md index da46659..0b75f86 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -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 @@ -27,7 +27,7 @@ to get native Blender geometry types which then allow further modifications with ## 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 diff --git a/docs/content/installation.md b/docs/content/installation.md index 73a743e..d9ce8f3 100644 --- a/docs/content/installation.md +++ b/docs/content/installation.md @@ -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" @@ -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" @@ -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" diff --git a/docs/content/integration.md b/docs/content/integration.md index 64d44b4..fe3a258 100644 --- a/docs/content/integration.md +++ b/docs/content/integration.md @@ -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. @@ -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 diff --git a/docs/content/interaction_system.md b/docs/content/interaction_system.md index 17a7245..3f076ee 100644 --- a/docs/content/interaction_system.md +++ b/docs/content/interaction_system.md @@ -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. diff --git a/docs/content/solver.md b/docs/content/solver.md index f1b5cd0..578613f 100644 --- a/docs/content/solver.md +++ b/docs/content/solver.md @@ -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. diff --git a/docs/content/tools.md b/docs/content/tools.md index 475adf7..4275175 100644 --- a/docs/content/tools.md +++ b/docs/content/tools.md @@ -17,12 +17,12 @@ Workspacetools are used to interactively create entities. You can access them fr the viewport's "T"-panel. Check the [tools section](tools.md) to get familiar with the behavior of CAD Sketcher tools. -> **INFO:** Interaction with addon geometry is only possible when one of the -addon tools is active. +> **INFO:** Interaction with extension geometry is only possible when one of the +extension tools is active. ### Workspacetool Access Keymap -Whenever one of the addon's tools is active the tool access keymap allows to quickly switch between the different tools. +Whenever one of the extension's tools is active the tool access keymap allows to quickly switch between the different tools. |Key|Modifier|Action| |:---:|---|---| diff --git a/docs/content/user_interface.md b/docs/content/user_interface.md index 333286b..73665b9 100644 --- a/docs/content/user_interface.md +++ b/docs/content/user_interface.md @@ -1,7 +1,7 @@ ## Sidebar ![!Sidebar](images/sidebar.png){style="width:200px; height:220px; object-fit:cover;" align=right} -The addon adds a some panels to the "N"-sidebar under the category "Sketcher". From +The extension adds a some panels to the "N"-sidebar under the category "Sketcher". From here you can set the active sketch, access its properties, add constraints and interact with elements via the browsers. {style="display:block; height:220px"} @@ -50,7 +50,7 @@ gizmo that supports it or through the corresponding button in one of the element > **INFO:** Only the hovered entity is used, the context menu ignores the selection. ## Preferences -Access the preferences by expanding the enabled addon under +Access the preferences by expanding the enabled extension under Edit > Preferences > Add-ons > CAD Sketcher. ![!Preferences](images/preferences.png){align=left style="height:300px; width:calc(50% - 1em); object-fit:cover;"} @@ -67,7 +67,7 @@ with caution. ### Theme ![!Preferences](images/theme_presets.png){align=right} -Colors that are used in the addon are defined under the theme section. The addon also +Colors that are used in the extension are defined under the theme section. The extension also supports theme presets. You can get the presets path by entering the following line into blenders python console: ``` py diff --git a/model/group_sketcher.py b/model/group_sketcher.py index 480b8c6..f603a49 100644 --- a/model/group_sketcher.py +++ b/model/group_sketcher.py @@ -38,8 +38,8 @@ class SketcherProps(PropertyGroup): ) version: IntVectorProperty( - name="Addon Version", - description="CAD Sketcher addon version this scene was saved with", + name="Extension Version", + description="CAD Sketcher extension version this scene was saved with", ) # This is needed for the sketches ui list diff --git a/operators/base_stateful.py b/operators/base_stateful.py index 0c5d0d2..14e9ad0 100644 --- a/operators/base_stateful.py +++ b/operators/base_stateful.py @@ -11,7 +11,7 @@ class GenericEntityOp(StatefulOperator): - """Extend StatefulOperator with addon specific types""" + """Extend StatefulOperator with extension specific types""" def check_event(self, event): return super().check_event(event)