[Bf-extensions-cvs] [8efd0457] master: Curve Tools 2: small refactoring
Spivak Vladimir cwolf3d
noreply at git.blender.org
Mon Sep 2 23:36:36 CEST 2019
Commit: 8efd0457af30a9c87351e4782c49750c2dbff876
Author: Spivak Vladimir (cwolf3d)
Date: Tue Sep 3 00:36:01 2019 +0300
Branches: master
https://developer.blender.org/rBAC8efd0457af30a9c87351e4782c49750c2dbff876
Curve Tools 2: small refactoring
===================================================================
M curve_tools/__init__.py
M curve_tools/auto_loft.py
===================================================================
diff --git a/curve_tools/__init__.py b/curve_tools/__init__.py
index 5ae767a9..b5c2bd2c 100644
--- a/curve_tools/__init__.py
+++ b/curve_tools/__init__.py
@@ -304,27 +304,10 @@ class VIEW3D_PT_CurvePanel(Panel):
row = col.row(align=True)
row.operator("curve.remove_doubles", text="Remove Doubles")
row = col.row(align=True)
- vertex = []
- selected = []
- n = 0
- obj = context.active_object
- if obj is not None:
- if obj.type == 'CURVE':
- for i in obj.data.splines:
- for j in i.bezier_points:
- n += 1
- if j.select_control_point:
- selected.append(n)
- vertex.append(obj.matrix_world @ j.co)
-
- if len(vertex) > 0 and n > 2:
- row = col.row(align=True)
- row.operator("curve.bezier_points_fillet", text='Fillet')
-
- if len(vertex) == 2 and abs(selected[0] - selected[1]) == 1:
- row = col.row(align=True)
- row.operator("curve.bezier_spline_divide", text='Divide')
-
+ row = col.row(align=True)
+ row.operator("curve.bezier_points_fillet", text='Fillet')
+ row = col.row(align=True)
+ row.operator("curve.bezier_spline_divide", text='Divide')
row = col.row(align=True)
row.operator("curvetools2.operatorbirail", text="Birail")
# Utils Curve options
diff --git a/curve_tools/auto_loft.py b/curve_tools/auto_loft.py
index 2d0e6e68..630fbba9 100644
--- a/curve_tools/auto_loft.py
+++ b/curve_tools/auto_loft.py
@@ -11,12 +11,10 @@ class OperatorAutoLoftCurves(Operator):
bl_label = "Loft"
bl_description = "Lofts selected curves"
-
@classmethod
def poll(cls, context):
return Util.Selected2Curves()
-
def execute(self, context):
#print("### TODO: OperatorLoftCurves.execute()")
mesh = bpy.data.meshes.new("LoftMesh")
@@ -44,7 +42,6 @@ class OperatorAutoLoftCurves(Operator):
return {'FINISHED'}
-
class AutoLoftModalOperator(Operator):
"""Auto Loft"""
bl_idname = "curvetools2.update_auto_loft_curves"
@@ -73,17 +70,6 @@ class AutoLoftModalOperator(Operator):
ls.bMesh.to_mesh(loftmesh.data)
return {'FINISHED'}
- def cancel(self, context):
- wm = context.window_manager
- wm.event_timer_remove(self._timer)
-
-
-
-def run_auto_loft(self, context):
- if self.auto_loft:
- bpy.ops.wm.auto_loft_curve()
- return None
-
def register():
bpy.utils.register_class(AutoLoftModalOperator)
bpy.utils.register_class(OperatorAutoLoftCurves)
@@ -97,7 +83,3 @@ def unregister():
if __name__ == "__main__":
register()
-
-
- # test call
- #bpy.ops.wm.modal_timer_operator()
More information about the Bf-extensions-cvs
mailing list