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", 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'}