hlorus / CAD_Sketcher

Constraint-based geometry sketcher for blender
GNU General Public License v3.0
2.59k stars 122 forks source link

Checks for duplicate constraints. #461

Closed TimStrauven closed 2 months ago

TimStrauven commented 2 months ago

On constraint creation checks are added to see if it exists on the selected entity or entitiies. The exists method was added to GenericConstraintOp for this. Line distances have been replaced for point to point distances.

linked to: [BUG] CAD Sketcher allows us to apply the hor/vert constraints multiple times to an element #430 Cannot set Distance constraint to horizontal or vertical for lines [BUG] #459

hlorus commented 2 months ago

Line distances have been replaced for point to point distances.

linked to: #430 Cannot set Distance constraint to horizontal or vertical for lines [BUG] #459

Note: In order to solve 430 we'll have to migrate old distance constraints to also contrain point to point.

hlorus commented 2 months ago

To migrate existing constraints:

TimStrauven commented 2 months ago

To migrate existing constraints:

* Bump the addon version (e.g. 0.27.4) in **init**.py bl_info and blender_mainfest.toml

* Add a check for files older than that new version in versioning.py

* Loop through constraints of type distance and replace line entity with the two points of the line

Yes I figured this out yesterday, but while looking trough it I noticed the versioning system is broken for blender before 4.20 because of the changes made in the last month. I'll create another bug report...

TimStrauven commented 2 months ago

To migrate existing constraints:

* Bump the addon version (e.g. 0.27.4) in **init**.py bl_info and blender_mainfest.toml

* Add a check for files older than that new version in versioning.py

* Loop through constraints of type distance and replace line entity with the two points of the line

Think this is all. I added quite some checks into versioning to be really sure to select only the right ones (since e.g. angle constraints are also in dimensional).

Let me know if anything doesn't look right.

hlorus commented 2 months ago

This is ok to go in, feel free to merge yourself when you're ready. I've added you as a collaborator to the project.

TimStrauven commented 2 months ago

This is ok to go in, feel free to merge yourself when you're ready. I've added you as a collaborator to the project.

Thanks, but i've declined the request for now, maybe at a later point when I know all details of the project better.