diff options
Diffstat (limited to 'curve_tools')
-rw-r--r-- | curve_tools/auto_loft.py | 1 | ||||
-rw-r--r-- | curve_tools/operators.py | 9 | ||||
-rw-r--r-- | curve_tools/path_finder.py | 13 | ||||
-rw-r--r-- | curve_tools/show_resolution.py | 1 | ||||
-rw-r--r-- | curve_tools/splines_sequence.py | 4 |
5 files changed, 18 insertions, 10 deletions
diff --git a/curve_tools/auto_loft.py b/curve_tools/auto_loft.py index 3092e6b8..b14aaf3b 100644 --- a/curve_tools/auto_loft.py +++ b/curve_tools/auto_loft.py @@ -12,6 +12,7 @@ class OperatorAutoLoftCurves(Operator): bl_idname = "curvetools.create_auto_loft" bl_label = "Loft" bl_description = "Lofts selected curves" + bl_options = {'UNDO'} @classmethod def poll(cls, context): diff --git a/curve_tools/operators.py b/curve_tools/operators.py index e4480f88..d4ada318 100644 --- a/curve_tools/operators.py +++ b/curve_tools/operators.py @@ -145,6 +145,7 @@ class OperatorOriginToSpline0Start(bpy.types.Operator): bl_idname = "curvetools.operatororigintospline0start" bl_label = "OriginToSpline0Start" bl_description = "Sets the origin of the active/selected curve to the starting point of the (first) spline. Nice for curve modifiers" + bl_options = {'UNDO'} @classmethod @@ -182,6 +183,7 @@ class OperatorIntersectCurves(bpy.types.Operator): bl_idname = "curvetools.operatorintersectcurves" bl_label = "Intersect" bl_description = "Intersects selected curves" + bl_options = {'UNDO'} @classmethod @@ -233,6 +235,7 @@ class OperatorLoftCurves(bpy.types.Operator): bl_idname = "curvetools.operatorloftcurves" bl_label = "Loft" bl_description = "Lofts selected curves" + bl_options = {'UNDO'} @classmethod @@ -258,6 +261,7 @@ class OperatorSweepCurves(bpy.types.Operator): bl_idname = "curvetools.operatorsweepcurves" bl_label = "Sweep" bl_description = "Sweeps the active curve along to other curve (rail)" + bl_options = {'UNDO'} @classmethod @@ -283,6 +287,7 @@ class OperatorBirail(bpy.types.Operator): bl_idname = "curvetools.operatorbirail" bl_label = "Birail" bl_description = "Generates a birailed surface from 3 selected curves -- in order: rail1, rail2 and profile" + bl_options = {'UNDO'} @classmethod @@ -306,6 +311,7 @@ class OperatorSplinesSetResolution(bpy.types.Operator): bl_idname = "curvetools.operatorsplinessetresolution" bl_label = "SplinesSetResolution" bl_description = "Sets the resolution of all splines" + bl_options = {'UNDO'} @classmethod @@ -330,6 +336,7 @@ class OperatorSplinesRemoveZeroSegment(bpy.types.Operator): bl_idname = "curvetools.operatorsplinesremovezerosegment" bl_label = "SplinesRemoveZeroSegment" bl_description = "Removes splines with no segments -- they seem to creep up, sometimes" + bl_options = {'UNDO'} @classmethod @@ -364,6 +371,7 @@ class OperatorSplinesRemoveShort(bpy.types.Operator): bl_idname = "curvetools.operatorsplinesremoveshort" bl_label = "SplinesRemoveShort" bl_description = "Removes splines with a length smaller than the threshold" + bl_options = {'UNDO'} @classmethod @@ -393,6 +401,7 @@ class OperatorSplinesJoinNeighbouring(bpy.types.Operator): bl_idname = "curvetools.operatorsplinesjoinneighbouring" bl_label = "SplinesJoinNeighbouring" bl_description = "Joins neighbouring splines within a distance smaller than the threshold" + bl_options = {'UNDO'} @classmethod diff --git a/curve_tools/path_finder.py b/curve_tools/path_finder.py index abf53a6c..242ed27c 100644 --- a/curve_tools/path_finder.py +++ b/curve_tools/path_finder.py @@ -3,8 +3,8 @@ bl_info = { 'name': 'PathFinder', 'author': 'Spivak Vladimir (cwolf3d)', - 'version': (0, 5, 0), - 'blender': (2, 80, 0), + 'version': (0, 5, 1), + 'blender': (3, 0, 0), 'location': 'Curve Tools addon. (N) Panel', 'description': 'PathFinder - quick search, selection, removal of splines', 'warning': '', # used for warning icon and text in addons panel @@ -17,7 +17,6 @@ import time import threading import gpu -import bgl from gpu_extras.batch import batch_for_shader import bpy @@ -85,8 +84,8 @@ def draw_bezier_points(self, context, spline, matrix_world, path_color, path_thi shader.bind() shader.uniform_float("color", path_color) - bgl.glEnable(bgl.GL_BLEND) - bgl.glLineWidth(path_thickness) + gpu.state.blend_set('ALPHA') + gpu.state.line_width_set(path_thickness) batch.draw(shader) def draw_points(self, context, spline, matrix_world, path_color, path_thickness): @@ -98,8 +97,8 @@ def draw_points(self, context, spline, matrix_world, path_color, path_thickness) shader.bind() shader.uniform_float("color", path_color) - bgl.glEnable(bgl.GL_BLEND) - bgl.glLineWidth(path_thickness) + gpu.state.blend_set('ALPHA') + gpu.state.line_width_set(path_thickness) batch.draw(shader) def near(location3D, point, radius): diff --git a/curve_tools/show_resolution.py b/curve_tools/show_resolution.py index b2dbda7f..07a06540 100644 --- a/curve_tools/show_resolution.py +++ b/curve_tools/show_resolution.py @@ -6,7 +6,6 @@ import bpy from bpy import * from bpy.props import * -import bgl import blf import gpu from gpu_extras.batch import batch_for_shader diff --git a/curve_tools/splines_sequence.py b/curve_tools/splines_sequence.py index 98766058..89b9624c 100644 --- a/curve_tools/splines_sequence.py +++ b/curve_tools/splines_sequence.py @@ -3,7 +3,6 @@ import bpy -import bgl import blf import gpu from gpu_extras.batch import batch_for_shader @@ -66,7 +65,7 @@ def draw(self, context, splines, sequence_color, font_thickness, font_size, matr batch = batch_for_shader(shader, 'LINES', {"pos": points}) shader.bind() - bgl.glLineWidth(font_thickness) + gpu.state.line_width_set(font_thickness) shader.uniform_float("color", sequence_color) batch.draw(shader) i += font_size + font_size * 0.5 @@ -215,6 +214,7 @@ class RearrangeSpline(bpy.types.Operator): bl_idname = "curvetools.rearrange_spline" bl_label = "Rearrange Spline" bl_description = "Rearrange Spline" + bl_options = {'UNDO'} Types = [('NEXT', "Next", "next"), ('PREV', "Prev", "prev")] |