From 9a79de5b3a5ab015b96afa0eae746ad36fd6a7fb Mon Sep 17 00:00:00 2001 From: Michael Witrant Date: Tue, 15 Aug 2023 11:29:04 +0200 Subject: [PATCH 1/2] Curve tools: Calculate length on multiple curves --- curve_tools/operators.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/curve_tools/operators.py b/curve_tools/operators.py index 42ca560a2..91b483b05 100644 --- a/curve_tools/operators.py +++ b/curve_tools/operators.py @@ -52,18 +52,23 @@ class OperatorCurveInfo(bpy.types.Operator): class OperatorCurveLength(bpy.types.Operator): bl_idname = "curvetools.operatorcurvelength" bl_label = "Length" - bl_description = "Calculates the length of the active/selected curve" + bl_description = "Calculates the length of the active/selected curves" @classmethod def poll(cls, context): - return util.Selected1Curve() + return util.Selected1OrMoreCurves() def execute(self, context): - curve = curves.Curve(context.active_object) + selCurves = util.GetSelectedCurves() - context.scene.curvetools.CurveLength = curve.length + length = 0 + for blCurve in selCurves: + curve = curves.Curve(blCurve) + length += curve.length + + context.scene.curvetools.CurveLength = length return {'FINISHED'} -- 2.30.2 From c54d35654d57ef2df9ef3d67e14f9bff9b9f65ec Mon Sep 17 00:00:00 2001 From: Michael Witrant Date: Tue, 15 Aug 2023 19:16:45 +0200 Subject: [PATCH 2/2] Curve tools: Bump version to 0.4.6 --- curve_tools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curve_tools/__init__.py b/curve_tools/__init__.py index e29685a66..09b1c762e 100644 --- a/curve_tools/__init__.py +++ b/curve_tools/__init__.py @@ -6,7 +6,7 @@ bl_info = { "name": "Curve Tools", "description": "Adds some functionality for bezier/nurbs curve/surface modeling", "author": "Mackraken, Spivak Vladimir (cwolf3d)", - "version": (0, 4, 5), + "version": (0, 4, 6), "blender": (2, 80, 0), "location": "View3D > Tool Shelf > Edit Tab", "doc_url": "{BLENDER_MANUAL_URL}/addons/add_curve/curve_tools.html", -- 2.30.2